All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] completion: Reduce stack usage caused by COMPLETION_INITIALIZER_ONSTACK()
@ 2017-08-23 15:25 ` Boqun Feng
  0 siblings, 0 replies; 26+ messages in thread
From: Boqun Feng @ 2017-08-23 15:25 UTC (permalink / raw)
  To: linux-kernel, linux-mm
  Cc: Peter Zijlstra, Ingo Molnar, Thomas Gleixner, walken,
	Byungchul Park, Arnd Bergmann, Andrew Morton, willy,
	Nicholas Piggin, kernel-team

With LOCKDEP_CROSSRELEASE and LOCKDEP_COMPLETIONS introduced, the growth
in kernel stack usage of several functions were reported:

	https://marc.info/?l=linux-kernel&m=150270063231284&w=2

The root cause of this is in COMPLETION_INITIALIZER_ONSTACK(), we use

	({init_completion(&work); work})

, which will create a temporary object when returned. However this
temporary object is unnecessary. And this patch fixes it by making the
statement expression in COMPLETION_INITIALIZER_ONSTACK() return a
pointer rather than a whole structure. This will reduce the stack usage
even if !LOCKDEP.

However, such a change does make one COMPLETION_INITIALIZER_ONSTACK()
callsite invalid, so we fix this first via converting to
init_completion().

Regards,
Boqun

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

end of thread, other threads:[~2017-08-29 14:30 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 15:25 [PATCH 0/2] completion: Reduce stack usage caused by COMPLETION_INITIALIZER_ONSTACK() Boqun Feng
2017-08-23 15:25 ` Boqun Feng
2017-08-23 15:25 ` [PATCH 1/2] nfit: Use init_completion() in acpi_nfit_flush_probe() Boqun Feng
2017-08-23 15:25   ` Boqun Feng
2017-08-23 22:08   ` Dan Williams
2017-08-23 22:08     ` Dan Williams
2017-08-23 22:08     ` Dan Williams
2017-08-24 13:07   ` Thomas Gleixner
2017-08-24 13:07     ` Thomas Gleixner
2017-08-24 13:28     ` Boqun Feng
2017-08-24 13:46       ` Arnd Bergmann
2017-08-24 13:46         ` Arnd Bergmann
2017-08-24 13:46         ` Arnd Bergmann
2017-08-24 14:22   ` [PATCH v2 1/2] nfit: Fix the abuse of COMPLETION_INITIALIZER_ONSTACK() Boqun Feng
2017-08-24 14:22     ` Boqun Feng
2017-08-24 14:22     ` Boqun Feng
2017-08-25  0:18     ` Boqun Feng
2017-08-25  0:36     ` Dan Williams
2017-08-25  0:36       ` Dan Williams
2017-08-25  0:36       ` Dan Williams
2017-08-29 14:24     ` [tip:locking/core] acpi/nfit: Fix COMPLETION_INITIALIZER_ONSTACK() abuse tip-bot for Boqun Feng
2017-08-23 15:25 ` [PATCH 2/2] completion: Avoid unnecessary stack allocation for COMPLETION_INITIALIZER_ONSTACK() Boqun Feng
2017-08-23 15:25   ` Boqun Feng
2017-08-29 14:24   ` [tip:locking/core] sched/completion: " tip-bot for Boqun Feng
2017-08-23 15:33 ` [PATCH 0/2] completion: Reduce stack usage caused by COMPLETION_INITIALIZER_ONSTACK() Arnd Bergmann
2017-08-23 15:33   ` Arnd Bergmann

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.