Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

0 votes
0 answers
46 views
How to wait for child processes to finish and then restart the systemctl service to avoid downtime?
I have a situation where I want to migration from using system slice to ABC slice for a systemctl service. Now that service is running some child processes as well during communication from data plane to control plane. I am trying to find out a way to safely restart this systemctl service without /...
I have a situation where I want to migration from using system slice to ABC slice for a systemctl service. Now that service is running some child processes as well during communication from data plane to control plane. I am trying to find out a way to safely restart this systemctl service without / minimum downtime of this service so that communication from control plane to data plane is not broken due to service downtime. For this to achieve, we need to find a way to wait for all child processes to complete and then update the slice from system to ABC. If we restart without waiting for child processes to complete, those processes would still remain in the system slice and the cgroup would not reflect to use ABC slice. In this case, once all child processes are completed, then on restart it would reflect ABC slice. Below is the journalctl logs we get while restarting the service to reflect the ABC slice while it is running child processes.
systemd: Stopped pqr-agent Service. 
Jan 03 20:21:45 ip-10-10-80-7.ap-south-1.pqr.internal systemd: pqr-agent.service: Found left-over process 8309 (cmd_execute) in control group while starting unit. Ignoring. 
Jan 03 20:21:45 ip-10-10-80-7.ap-south-1.pqr.internal systemd: This usually indicates unclean termination of a previous run, or service implementation deficiencies. 
Jan 03 20:21:45 ip-10-10-80-7.ap-south-1.pqr.internal systemd: pqr-agent.service: Found left-over process 8314 (pqr-upgrade) in control group while starting unit. Ignoring. 
Jan 03 20:21:45 ip-10-10-80-7.ap-south-1.pqr.internal systemd: This usually indicates unclean termination of a previous run, or service implementation deficiencies.  
Jan 03 20:21:45 ip-10-10-80-7.ap-south-1.pqr.internal systemd: pqr-agent.service: Found left-over process 8331 (python3) in control group while starting unit. Ignoring. 
Jan 03 20:21:45 ip-10-10-80-7.ap-south-1.pqr.internal systemd: This usually indicates unclean termination of a previous run, or service implementation deficiencies. 
Jan 03 20:21:45 ip-10-10-80-7.ap-south-1.pqr.internal systemd: pqr-agent.service: Found left-over process 8334 (quota-governanc) in control group while starting unit. Ignoring. 
Jan 03 20:21:45 ip-10-10-80-7.ap-south-1.pqr.internal systemd: This usually indicates unclean termination of a previous run, or service implementation deficiencies
1. ExecStopPre is not supported by systemd service. It is was supported, we would have used it to wait for all the child processes and then restarted the service. 2. ExecStop would lead to the downtime of service since it would first move the service to deactivating state (stopping) due to which it would not be able to receive further commands and till the time it waits for child processes to complete, communication from control plane to data plane is broken. 3. If we use ExecStartPost, then we would not be able to track the child processes (because restart works as stop and start, the MainPID would change so the new MainPID would not have any child processes) and here the service restart would work only if we wait for the time duration until all the child processes in older cgroup are completed. Restart should happen to reflect ABC slice with minimum downtime of service.
samay varshney (1 rep)
Feb 10, 2025, 07:11 AM
2 votes
1 answers
2269 views
My thinkpad is being throttled to 400mhz per core. Is there any way I can force it to clock to normal speeds with the kernel?
there seems to be a common issue with Lenovo ThinkPad and the Intel CPUs being throttled to 400mhz per core: - https://forums.lenovo.com/t5/ThinkPad-L-R-and-SL-series/L380-stuck-on-0-4-GHz-when-loading/td-p/4333148 - https://www.reddit.com/r/thinkpad/comments/96gnur/yoga_370_cpu_stuck_at_038_ghz/ -...
there seems to be a common issue with Lenovo ThinkPad and the Intel CPUs being throttled to 400mhz per core: - https://forums.lenovo.com/t5/ThinkPad-L-R-and-SL-series/L380-stuck-on-0-4-GHz-when-loading/td-p/4333148 - https://www.reddit.com/r/thinkpad/comments/96gnur/yoga_370_cpu_stuck_at_038_ghz/ - https://www.reddit.com/r/thinkpad/comments/6uhu31/t470_cpu_throttling_stuck_on_400_mhz_when_on/ The interesting thing is that this is not merely on an operating system basis. Even in BIOS or Diagnostics, this throttling occurs. It sometimes returns to normal speeds, but not forever. The battery is also not charging when it's under throttled. There does not seem to be a clear answer as to what causes this and as to what is the solution. The catalyst for me seems to when I let the laptop discharge while in sleep. I have been dealing with this issue for a week. I have already: - Updated the BIOS - Rollbacked the BIOS - Tried different chargers - Unplugged the battery and drained the capacitors - Unplugged the clock battery - Changing the CPU settings in BIOS - Pressed and hold down the reset And pretty much everything short of getting a new battery, and playing with the kernel. As far as I understand, people have tried getting a new battery, and that solution only works some of the time. I'd like to see what I can do with the kernel; I am fine programming in C++, Qt, and C, but I just don't know my way around the kernel or have any experience working with CPUs and the like. 1. Is there a kernel module I can explore to deal with this? 1. Can the kernel force higher clock speeds to even begin with? 1. Are there perhaps more streamlined existing solutions that will force my computer to go back to regular clock speeds? Thanks. ----------- Edit: After changing the governor from Powersave to Performance, I am still seeing the same issue: Before:
➜  ~ cpupower -c all frequency-info
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 3.40 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 3.40 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 400 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
analyzing CPU 1:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 1
  CPUs which need to have their frequency coordinated by software: 1
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 3.40 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 3.40 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 400 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
analyzing CPU 2:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 2
  CPUs which need to have their frequency coordinated by software: 2
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 3.40 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 3.40 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 400 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
analyzing CPU 3:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 3
  CPUs which need to have their frequency coordinated by software: 3
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 3.40 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 3.40 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 400 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
------- After:
➜  ~ sudo cpupower frequency-set -g performance       
[sudo] password for anon: 
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3
➜  ~ cpupower -c all frequency-info            
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 3.40 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 3.40 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 400 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
analyzing CPU 1:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 1
  CPUs which need to have their frequency coordinated by software: 1
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 3.40 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 3.40 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 400 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
analyzing CPU 2:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 2
  CPUs which need to have their frequency coordinated by software: 2
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 3.40 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 3.40 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 400 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
analyzing CPU 3:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 3
  CPUs which need to have their frequency coordinated by software: 3
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 3.40 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 3.40 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 400 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
Jannies - They do it for free (143 rep)
Dec 27, 2020, 02:03 AM • Last activity: Oct 25, 2023, 05:45 AM
5 votes
4 answers
8866 views
How can I make my Linux server sleep and wake on LAN when not in use?
I have recently purchased myself an HP rack server for use as a personal fileserver. This server currently lives under my bed as I have nowhere else to put it. For those not aware (as I was not fully) this server is **VERY LOUD**. I need to be able to access my files a lot of the time during the day...
I have recently purchased myself an HP rack server for use as a personal fileserver. This server currently lives under my bed as I have nowhere else to put it. For those not aware (as I was not fully) this server is **VERY LOUD**. I need to be able to access my files a lot of the time during the day, and due to the situation of my server, turning it off every night at the wall (it likes to suddenly spring into action for no apparent reason) isn't really an option. I would _really_ like if the server could remain powered on all the time, but when not in use enter a sleep state such that the fans turn off, if nothing else, over LAN. The server also runs Debian. If this kind of setup can't happen for whatever reason, I could settle for the machine shutting down at a certain time of day (or night) and starting up again in the morning, or something to that effect. I have very little idea about how to go about such a task, other than to use wake/sleep-on-LAN.
James Stone (51 rep)
Jan 24, 2018, 05:25 PM • Last activity: Oct 10, 2023, 04:07 PM
5 votes
4 answers
15382 views
System calls source code
C library provides functions such as write(),read(),open()...that we can use in our C program to make system calls. where can I find source code for these functions?
C library provides functions such as write(),read(),open()...that we can use in our C program to make system calls. where can I find source code for these functions?
saurav1405 (379 rep)
Jul 16, 2014, 02:28 PM • Last activity: Jul 22, 2022, 08:23 AM
1 votes
2 answers
848 views
How to pass a parameter in a command without run the parameter content?
Good days. I have a little problem. I have this function in bash script function denyCheck(){ file=$(readlink -f $(which $(printf "%s\n" "$1"))) if [[ -x $file ]];then return false else return true fi } denyCheck "firefox" This function I pass her a string, what is a comman, and this resolv the orgi...
Good days. I have a little problem. I have this function in bash script function denyCheck(){ file=$(readlink -f $(which $(printf "%s\n" "$1"))) if [[ -x $file ]];then return false else return true fi } denyCheck "firefox" This function I pass her a string, what is a comman, and this resolv the orginal path where is the command (by example: /usr/lib/firefox/firefox.sh) and if the file is executable return true else false. But the problem is...The parameter (in the example "firefox") run it as command and open the browser firefox. How can I do for that the parameter not run it? Thank you very much.
cleanet (13 rep)
May 14, 2022, 10:21 AM • Last activity: May 14, 2022, 05:15 PM
1 votes
1 answers
1700 views
A simple global keyboard shortcut handler
Yeah, I know there's [actkbd][1] which allows to assign global keyboard shortcuts which will work everywhere including the text console and a graphical session but I don't want to run an extra daemon (long unmaintained as well) for a single keyboard shortcut. I want something a lot simpler with no c...
Yeah, I know there's actkbd which allows to assign global keyboard shortcuts which will work everywhere including the text console and a graphical session but I don't want to run an extra daemon (long unmaintained as well) for a single keyboard shortcut. I want something a lot simpler with no configuration options and which has the absolute minimum amount of code. The task is to run a command when this key combination is pressed: Win + End -> systemctl suspend This is probably worth posting in stackoverflow.com instead but I'm not entirely sure.
Artem S. Tashkinov (32730 rep)
Mar 23, 2022, 02:11 PM • Last activity: Mar 24, 2022, 05:44 PM
0 votes
0 answers
198 views
Does setting TCP_NODELAY disable auto-corking?
Does setting TCP_NODELAY turn off the auto corking behavior? Is there a way to disable it on a per connection basis?
Does setting TCP_NODELAY turn off the auto corking behavior? Is there a way to disable it on a per connection basis?
Jason Nordwick (101 rep)
Mar 20, 2022, 04:54 AM
0 votes
1 answers
51 views
using greeter as base for locking app
I am a hobbyist (not IT specialist) and just had idea to write some lockscreen app/script to learn and repeat regex. I could use bash or Python, but don't know where to start. Could you point me directions? We are using Operating Systems based on X (Manjaro and Ubuntu) And please do not hate me as a...
I am a hobbyist (not IT specialist) and just had idea to write some lockscreen app/script to learn and repeat regex. I could use bash or Python, but don't know where to start. Could you point me directions? We are using Operating Systems based on X (Manjaro and Ubuntu) And please do not hate me as a noob. I always wanted to have knowledge in programming area, but never been determined enough to spend time on this (my wife hates computers at all). But some time ago I sat down (and started to learn) and wrote Python app to determine time my son spends playing on computer. It took me 3 months but finally it worked as expected - I designed it myself, I wrote including refactoring and the conversion to an exe file, I went through the update because my son broke the first security measures, and I think it's great fun :) So as mentioned earlier I need some tool (wrote by myself of course) to repeat regex, and I think locking screen will be best. Maybe I could use greeter (In first line it should print some text instead of user, and unlocking password will be matching regex) It is just idea, which I wanted to install on my sons computer too (hes 15 now and learns for IT specialist). Greeter is only my suggestion. Maybe there is something better to use. Could you please guide me ? Thanks in advance :)
user455944 (1 rep)
Feb 13, 2021, 11:12 AM • Last activity: Jan 19, 2022, 03:24 PM
0 votes
1 answers
1650 views
Is it possible to dynamically update systemd-timer's onCalendar?
`sytemd-timer` has a feature "onCalendar" using which we can execute a script on points of time (on calendar). Is it possible to dynamically (programmatically) update or mutate that field? For example consider this application: 1- Executing a script (as a pre-task) and finding out the new date inter...
sytemd-timer has a feature "onCalendar" using which we can execute a script on points of time (on calendar). Is it possible to dynamically (programmatically) update or mutate that field? For example consider this application: 1- Executing a script (as a pre-task) and finding out the new date intervals that the main script should be run. 2- Updating the corresponding systemd-timer to use the new date (calendar) intervals. If it's not possible with systemd, how can we do it?
Zeta.Investigator (1190 rep)
Sep 22, 2021, 10:37 AM • Last activity: Sep 22, 2021, 12:15 PM
0 votes
1 answers
496 views
blkid: blkid_probe_lookup_value() - strange partition types
I need to check filesystem type on a thumb drive in my C++ application. It must be done before mounting a new partition. I also prefer not to call `system()` function. I tried to use the following test code: #include #include int main() { blkid_probe pr; const char *ptname; const char* devname = "/d...
I need to check filesystem type on a thumb drive in my C++ application. It must be done before mounting a new partition. I also prefer not to call system() function. I tried to use the following test code: #include #include int main() { blkid_probe pr; const char *ptname; const char* devname = "/dev/sdb1"; pr = blkid_new_probe_from_filename(devname); if (!pr) printf("faild to open device\n"); else { blkid_probe_enable_partitions(pr, true); blkid_do_fullprobe(pr); blkid_probe_lookup_value(pr, "PTTYPE", &ptname, NULL); printf("%s partition type detected\n", ptname); blkid_free_probe(pr); } } When I plug in thumb drive with ntfs this piece of code shows that my partions is dos. When I plug in thumb drive with fat or ext4 the code returns strange string but the same for these two filesystems: AWAVI��AUATL�%� . What causes these strange outputs? Maybe there is a better way to check a filesystem? Thank you in advance for any help.
user6758 (23 rep)
May 12, 2021, 08:08 PM • Last activity: May 13, 2021, 03:51 AM
1 votes
1 answers
1809 views
How pass the file's content through Named Pipe and then copy it into another one?
I wrote 2 programs that normally 1.create the named pipe(server) and 2. pass the string from the shell to the server part. I understand how to hand over a string from the terminal to the server part of the named pipe.But, i don't have any idea how to pass files as arguments into the 2 program so tha...
I wrote 2 programs that normally 1.create the named pipe(server) and 2. pass the string from the shell to the server part. I understand how to hand over a string from the terminal to the server part of the named pipe.But, i don't have any idea how to pass files as arguments into the 2 program so that the file's content should be read and therefore passed out to ( likely the server part of the named pipe) another file. The idea is to copy the first file's content to the second file. Unfortunately, i don't have any idea how to implement this. #include #include #include #include #include #define FIFO_NAME "myfifo" #define BUF_SIZE 512 int main (void) { FILE * fifo; char * buf; if (mkfifo ("myfifo", 0640) == -1) { fprintf (stderr, "Can't create fifo\n"); return 1; } fifo = fopen (FIFO_NAME, "r"); if (fifo == NULL) { fprintf (stderr, "Cannot open fifo\n"); return 1; } buf = (char *) malloc (BUF_SIZE); if (buf == NULL) { fprintf (stderr, "malloc () error\n"); return 1; } fscanf (fifo, "%s", buf); printf ("%s\n", buf); fclose (fifo); free (buf); unlink (FIFO_NAME); return 0; } #include #include #include #include #include #define FIFO_NAME "myfifo" int main (int argc, char ** argv) { int fifo; if (argc < 2) { fprintf (stderr, "Too few arguments\n"); return 1; } fifo = open (FIFO_NAME, O_WRONLY); if (fifo == -1) { fprintf (stderr, "Cannot open fifo\n"); return 1; } if (write (fifo, argv, strlen (argv)) == -1) { fprintf (stderr, "write() error\n"); return 1; } close (fifo); return 0; }
Kirill Shvedov (11 rep)
Nov 10, 2020, 03:58 AM • Last activity: Feb 10, 2021, 02:43 AM
1 votes
1 answers
1080 views
Why below code is not able to unblock SIGINT signal
I am trying my hand on Linux Signals. Where I have created a scenario mentioned below: 1. Initially block all `SIGINT` signals using `sigprocmask()`. 2. If sender send `SIGUSR1` signal then unblock `SIGINT` for rest of the process life. However first step is successfully implemented but not able to...
I am trying my hand on Linux Signals. Where I have created a scenario mentioned below: 1. Initially block all SIGINT signals using sigprocmask(). 2. If sender send SIGUSR1 signal then unblock SIGINT for rest of the process life. However first step is successfully implemented but not able to unblock (or change) process mask using sigprocmask(). What am I doing wrong? #include #include #include sigset_t block_list, unblock_list; void sigint_handler(int sig) { printf("Ouch!!\n"); } void sigusr1_handler(int sig) { sigemptyset(&unblock_list); sigprocmask(SIG_SETMASK, &unblock_list, NULL); } int main(int argc, char **argv) { int count; signal(SIGINT, &sigint_handler); signal(SIGUSR1, &sigusr1_handler); sigemptyset(&block_list); sigaddset(&block_list, SIGINT); sigprocmask(SIG_SETMASK, &block_list, NULL); for(count=1; ;++count) { printf("Process id: %ld\t%d\n", (long)getpid(), count); sleep(4); } exit(EXIT_SUCCESS); } -------------------------------------------- $kill -n SIGINT $kill -n SIGUSER1 //This call should unblock sigint_handler() for rest of the process life, but it is only unblocking for one time. Everytime I have call $kill -n SIGUSER1 to unblock SIGINT. Note: Error handling has been removed for simplicity.
MankPan (77 rep)
Sep 23, 2019, 11:14 AM • Last activity: Dec 3, 2019, 08:43 PM
30 votes
9 answers
55550 views
What is the best book to learn Linux system programming?
I am trying to learn Linux system programming, which is the best book to learn this?
I am trying to learn Linux system programming, which is the best book to learn this?
Khaja Minhajuddin (857 rep)
Aug 11, 2010, 06:26 AM • Last activity: Feb 18, 2019, 08:49 PM
-1 votes
1 answers
193 views
CPU statistics calculation algorithm
I too many search on internet to found algorithm calculated %Us , %Sy , %Id , ... on result of top command . but can not found any documentation . some documents like [this][1] or [this][2] calculate cpu utilization but output not equal with output of top command . (too diff !!!) How do the top or m...
I too many search on internet to found algorithm calculated %Us , %Sy , %Id , ... on result of top command . but can not found any documentation . some documents like this or this calculate cpu utilization but output not equal with output of top command . (too diff !!!) How do the top or mpstat commands calculate cpu statistics ?
mah454 (318 rep)
Feb 11, 2019, 12:00 PM • Last activity: Feb 13, 2019, 11:36 AM
5 votes
3 answers
2209 views
Process creation time, shell script and system call overhead
I have a machine dual booted with Arch Linux and Ubuntu (16.04). I have recently started using the [Kakoune text editor][1], and noticed that its startup time is drastically different depending on which OS I am using. However I believe the underlying problem is **not** due to kakoune directly. On st...
I have a machine dual booted with Arch Linux and Ubuntu (16.04). I have recently started using the Kakoune text editor , and noticed that its startup time is drastically different depending on which OS I am using. However I believe the underlying problem is **not** due to kakoune directly. On startup, kakoune runs a bunch of shell scripts to enable integration with x11 and tmux, git, syntax highlighting/colorschemes, etc. This can be disabled to just load the 'vanilla' editor using the -n flag. The command: kak -e q will start kakoune, run all startup scripts and exit immediately. On Arch: time kak -e q takes **1 second** time kak -n -e q (no shell scripts) finishes in under **20 millis**. On Ubuntu: time kak -e q takes about **450 millis** time kak -n -e q is again under **20 millis** After trimming the fat and removing some of the startup scripts I did see an improvement on both OS's proportional to the amount removed. I ran some benchmarks with UnixBench and found that the major differences between the two systems are seen in the 'process creation' and 'shell scripts' tests. > The shells scripts test measures the number of times per minute a process can start and reap a set of one, two, four and eight concurrent copies of a shell scripts where the shell script applies a series of transformation to a data file. Here is the relevant output. Units in 'loops per second' more is better: Process creation (1 parallel copy of tests) Arch: 3,822 Ubuntu: 5,297 Process creation (4 parallel copies of tests) Arch: 18,935 Ubuntu: 30,341 Shell Scripts (1 concurrent) (1 parallel copy of tests) Arch: 972 Ubuntu: 5,141 Shell Scripts (1 concurrent) (4 parallel copies of tests) Arch: 7,697 Ubuntu: 24,942 Shell Scripts (8 concurrent) (1 parallel copy of tests) Arch: 807 Ubuntu: 2,257 Shell Scripts (8 concurrent) (4 parallel copies of tests) Arch: 1,289 Ubuntu: 3,001 As you can see the Ubuntu system performs much better. I have tested using different login shells, terminal emulators, recompiling kakoune, removing unneeded software to clean up the disk, etc. I am certain this is the bottleneck. **My question is:** what can I do to further investigate this and improve performance of the Arch Linux system to match Ubuntu? Should I look into tuning the kernel? Additional notes: - both systems use the same type of filesystem (ext4) - I tend to use the Archlinux system more, and have noticed performance degrading over time - Arch is on /dev/sda1 and is ~200GB. Ubuntu is on /dev/sda2, ~500GB. 1TB HDD. - Arch uname -a: Linux ark 4.14.13-1-ARCH #1 SMP PREEMPT Wed Jan 10 11:14:50 UTC 2018 x86_64 GNU/Linux - Ubuntu uname -a: Linux sierra 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Thanks
anon777 (63 rep)
Jan 20, 2018, 06:31 AM • Last activity: Jan 20, 2018, 08:46 PM
1 votes
1 answers
113 views
What does the STICKY_TIMEOUTS flag for personality(2) do?
Is there a good description of exactly what each of the flags you can pass to `personality(2)` does? I'm particularly interested in `STICKY_TIMEOUTS`, but a general detailed description of all of them would be nice. I've googled a bunch for this and can't find it. And I like knowing these things. Th...
Is there a good description of exactly what each of the flags you can pass to personality(2) does? I'm particularly interested in STICKY_TIMEOUTS, but a general detailed description of all of them would be nice. I've googled a bunch for this and can't find it. And I like knowing these things. This is a very specific programming question, but it's also very Unix/Linux specific. I wasn't sure if it should go here or on StackOverflow.
Omnifarious (1412 rep)
Aug 22, 2017, 05:18 PM • Last activity: Aug 22, 2017, 06:30 PM
6 votes
1 answers
4299 views
Concept of memory mapping in Unix like systems
Can some one explain in an easy to understand way the concept of memory mappings (achieved by mmap() system call) in Unix like systems ? When do we require this functionality ?
Can some one explain in an easy to understand way the concept of memory mappings (achieved by mmap() system call) in Unix like systems ? When do we require this functionality ?
Geek (6868 rep)
Dec 7, 2012, 10:22 AM • Last activity: Jun 23, 2017, 09:18 AM
2 votes
0 answers
269 views
How does vlan driver pass vlan info to the h/w ethernet driver
I'm trying to implement vlans on a target programmatically. But first I wanted to set up vlans manually to help get a better understanding of vlan setup. So I setup a vlan manually on my development system (ubuntu) using the vconfig/ifconfig command combination, but using the same command combinatio...
I'm trying to implement vlans on a target programmatically. But first I wanted to set up vlans manually to help get a better understanding of vlan setup. So I setup a vlan manually on my development system (ubuntu) using the vconfig/ifconfig command combination, but using the same command combination on the intended target doesn't work. Both systems use the same 8021q driver so the method of informing the lower level Ethernet driver of the vlan info should be the same (I would think). After looking at the vlan driver source it appears that it collects the vlan info and adds the info the sk_buff structure which is eventually passed to the ethernet driver, but it's not obvious where the vlan magic is suppose to happen (ethernet driver or 8021q driver). I looked at the source for the target system’s ethernet driver and it supports an ioctl method of setting up a vlan. But this does not seem like the conventional way that Linux sets up a vlan in the ethernet driver. By what mechanism does the vlan driver (8021q.ko) tell the Ethernet hardware about a vlan? Is it a special api call to the ethernet driver to set up a vlan in hardware, or should the vlan driver be adding the vlan tags to the packet? Any info on vlan implementation would also be helpful too.
carlh (21 rep)
Apr 26, 2017, 08:31 PM • Last activity: Apr 27, 2017, 02:57 PM
-2 votes
1 answers
865 views
Use supercomputer to run a program
I wrote a c++ program using some libraries called linbox, givaro, gmp. Now because my computer is to slow I want to run my program on a supercomputer. I am not very familiar with networks and my programming skills are not very high. I managed to upload the data that the program uses and the c++ prog...
I wrote a c++ program using some libraries called linbox, givaro, gmp. Now because my computer is to slow I want to run my program on a supercomputer. I am not very familiar with networks and my programming skills are not very high. I managed to upload the data that the program uses and the c++ program itself. But of course the supercomputer has not the libraries I need and so I can not compile/link. Can you tell me how can I proceed to get my program working or can you give me a good reference where I can learn to run c++ programs on supercomputers? I am using the supercomputer brutuswiki.ethz.ch/brutus/Getting_started_with_Euler
Valentin (99 rep)
Nov 7, 2016, 10:42 AM • Last activity: Nov 7, 2016, 11:05 AM
1 votes
1 answers
3152 views
How to specify a namespace when creating a tun/tap device?
On linux I can create a new tun/tap device in C using something like: int fd = open("/dev/net/tun", O_RDWR); ioctl(fd, TUNSETIFF, (void *)&ifr); This will create a new network interface in the current network namespace. I could afterwards use something like `ip link set tap0 netns foo` to move it to...
On linux I can create a new tun/tap device in C using something like: int fd = open("/dev/net/tun", O_RDWR); ioctl(fd, TUNSETIFF, (void *)&ifr); This will create a new network interface in the current network namespace. I could afterwards use something like ip link set tap0 netns foo to move it to another namespace from shell. What is the right way to create it in the correct namespace in the first place, or at least move it to that namespace from my C code?
michas (21862 rep)
Aug 1, 2016, 12:26 PM • Last activity: Oct 24, 2016, 02:13 PM
Showing page 1 of 20 total questions