All of lore.kernel.org
 help / color / mirror / Atom feed
* rfcomm watch busyloops taking 35% CPU on RPi4 (simple bug with fix)
@ 2022-01-27 20:54 thomas
  0 siblings, 0 replies; only message in thread
From: thomas @ 2022-01-27 20:54 UTC (permalink / raw)
  To: linux-bluetooth

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@habets.se" };
  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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-27 20:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-27 20:54 rfcomm watch busyloops taking 35% CPU on RPi4 (simple bug with fix) thomas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.