linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] optimize handling of memory debugging parameters
@ 2020-10-26 17:33 Vlastimil Babka
  2020-10-26 17:33 ` [PATCH 1/3] mm, page_alloc: do not rely on the order of page_poison and init_on_alloc/free parameters Vlastimil Babka
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Vlastimil Babka @ 2020-10-26 17:33 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, linux-kernel, Alexander Potapenko, Kees Cook,
	Michal Hocko, David Hildenbrand, Mateusz Nosek, Vlastimil Babka

We currently have several kernel parameters that affect page allocator wrt
debugging and hardening, some also with config options: init_on_alloc,
init_on_free, page_poison, debug_pagealloc.

These options generally have their own static keys, but sometimes a decision
for e.g. clearing a page depends on multiple options, and the handling is not
as efficient as it could be. This series addresses that by centralizing the
decisions into a new init_mem_debugging() function that enables individual
static keys, and most paths now rely on a single static key check. Subtle
dependency on the order of parameters is also eliminated (Patch 1). The result
is more efficient and hopefully also more readable code.

Vlastimil Babka (3):
  mm, page_alloc: do not rely on the order of page_poison and
    init_on_alloc/free parameters
  mm, page_poison: use static key more efficiently
  mm, page_alloc: reduce static keys in prep_new_page()

 drivers/virtio/virtio_balloon.c |   2 +-
 include/linux/mm.h              |  36 ++++-----
 init/main.c                     |   2 +-
 mm/page_alloc.c                 | 126 ++++++++++++++++++--------------
 mm/page_poison.c                |  40 ++--------
 5 files changed, 97 insertions(+), 109 deletions(-)

-- 
2.29.0



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

end of thread, other threads:[~2020-11-11 13:29 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 17:33 [PATCH 0/3] optimize handling of memory debugging parameters Vlastimil Babka
2020-10-26 17:33 ` [PATCH 1/3] mm, page_alloc: do not rely on the order of page_poison and init_on_alloc/free parameters Vlastimil Babka
2020-10-27  9:03   ` David Hildenbrand
2020-10-27  9:58     ` Vlastimil Babka
2020-10-27  9:58       ` David Hildenbrand
2020-10-28  8:31   ` Mike Rapoport
2020-10-26 17:33 ` [PATCH 2/3] mm, page_poison: use static key more efficiently Vlastimil Babka
2020-10-27  9:07   ` David Hildenbrand
2020-10-30 16:27   ` Luis Chamberlain
2020-10-30 22:56     ` Vlastimil Babka
2020-11-11 13:29       ` Luis Chamberlain
2020-10-26 17:33 ` [PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page() Vlastimil Babka
2020-10-27  9:10   ` David Hildenbrand
2020-10-27 11:05     ` Vlastimil Babka
2020-10-27 13:32       ` Vlastimil Babka
2020-10-27 17:41         ` Vlastimil Babka
2020-10-28  8:38           ` David Hildenbrand
2020-10-29 17:37         ` Alexander Potapenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).