All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch V2 0/3] signals: Allow caching one sigqueue object per task
@ 2021-03-11 13:20 Thomas Gleixner
  2021-03-11 13:20 ` [patch V2 1/3] signal: Provide and use exit_task_sighand() Thomas Gleixner
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Thomas Gleixner @ 2021-03-11 13:20 UTC (permalink / raw)
  To: LKML
  Cc: Oleg Nesterov, Sebastian Andrzej Siewior, Ingo Molnar,
	Peter Zijlstra, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, Matt Fleming, Eric W. Biederman

This is a follow up to the initial submission which can be found here:

  https://lore.kernel.org/r/20210303142025.wbbt2nnr6dtgwjfi@linutronix.de

Signal sending requires a kmem cache allocation at the sender side and the
receiver hands it back to the kmem cache when consuming the signal.

This works pretty well even for realtime workloads except for the case when
the kmem cache allocation has to go into the slow path which is rare but
happens.

Preempt-RT carries a patch which allows caching of one sigqueue object per
task. The object is not preallocated. It's cached when the task receives a
signal. The cache is freed when the task exits.

The memory overhead for a standard distro setup is pretty small. After boot
there are less than 10 objects cached in about 1500 tasks. The speedup for
sending a signal from a cached sigqueue object is small (~3us) per signal
and almost invisible, but for signal heavy workloads it's definitely
measurable and for the targeted realtime workloads it's solving a real
world latency issue.

Changes vs V1:

   - the caching is now unconditional
   - drop the pointless cmpxchg
   - split the patch up for better readability
   - add a proper analysis to the changelog vs. the impact and benefits

Thanks,

	tglx
---
 include/linux/sched.h  |    1 +
 include/linux/signal.h |    1 +
 kernel/exit.c          |    3 +--
 kernel/fork.c          |    1 +
 kernel/signal.c        |   44 +++++++++++++++++++++++++++++++++-----------
 5 files changed, 37 insertions(+), 13 deletions(-)

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-03-16 12:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 13:20 [patch V2 0/3] signals: Allow caching one sigqueue object per task Thomas Gleixner
2021-03-11 13:20 ` [patch V2 1/3] signal: Provide and use exit_task_sighand() Thomas Gleixner
2021-03-11 13:20 ` [patch V2 2/3] signal: Hand SIGQUEUE_PREALLOC flag to __sigqueue_alloc() Thomas Gleixner
2021-03-11 13:20 ` [patch V2 3/3] signal: Allow tasks to cache one sigqueue struct Thomas Gleixner
2021-03-12 11:35   ` Sebastian Andrzej Siewior
2021-03-12 16:18     ` Oleg Nesterov
2021-03-12 19:25       ` Thomas Gleixner
2021-03-12 16:11   ` Oleg Nesterov
2021-03-12 19:26     ` Thomas Gleixner
2021-03-12 21:13       ` Thomas Gleixner
2021-03-13 11:17         ` [patch V3 " Thomas Gleixner
2021-03-13 16:49         ` [patch V2 " Oleg Nesterov
2021-03-16 12:36           ` Thomas Gleixner
2021-03-11 21:13 ` [patch V2 0/3] signals: Allow caching one sigqueue object per task Eric W. Biederman
2021-03-12 20:02   ` Thomas Gleixner

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.