[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240819151512.2363698-1-surenb@google.com>
Date: Mon, 19 Aug 2024 08:15:06 -0700
From: Suren Baghdasaryan <surenb@...gle.com>
To: akpm@...ux-foundation.org
Cc: kent.overstreet@...ux.dev, corbet@....net, arnd@...db.de,
mcgrof@...nel.org, rppt@...nel.org, paulmck@...nel.org, thuth@...hat.com,
tglx@...utronix.de, bp@...en8.de, xiongwei.song@...driver.com,
ardb@...nel.org, david@...hat.com, vbabka@...e.cz, mhocko@...e.com,
hannes@...xchg.org, roman.gushchin@...ux.dev, dave@...olabs.net,
willy@...radead.org, liam.howlett@...cle.com, pasha.tatashin@...een.com,
souravpanda@...gle.com, keescook@...omium.org, dennis@...nel.org,
jhubbard@...dia.com, yuzhao@...gle.com, vvvvvv@...gle.com,
rostedt@...dmis.org, iamjoonsoo.kim@....com, rientjes@...gle.com,
minchan@...gle.com, kaleshsingh@...gle.com, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org, linux-mm@...ck.org,
linux-modules@...r.kernel.org, kernel-team@...roid.com, surenb@...gle.com
Subject: [PATCH 0/5] page allocation tag compression
This patchset implements several improvements:
1. Gracefully handles module unloading while there are used allocations
allocated from that module;
2. Provides an option to reduce memory overhead from storing page
allocation references by indexing allocation tags;
3. Provides an option to store page allocation tag references in the
page flags, removing dependency on page extensions and eliminating the
memory overhead from storing page allocation references (~0.2% of total
system memory).
4. Improves page allocation performance when CONFIG_MEM_ALLOC_PROFILING
is enabled by eliminating page extension lookup. Page allocation
performance overhead is reduced from 14% to 5.5%.
Patch #1 copies module tags into virtually contiguous memory which
serves two purposes:
- Lets us deal with the situation when module is unloaded while there
are still live allocations from that module. Since we are using a copy
version of the tags we can safely unload the module. Space and gaps in
this contiguous memory are managed using a maple tree.
- Enables simple indexing of the tags in the later patches.
Preallocated virtually contiguous memory size can be configured using
max_module_alloc_tags kernel parameter.
Patch #2 is a code cleanup to simplify later changes.
Patch #3 abstracts page allocation tag reference to simplify later
changes.
Patch #4 lets us control page allocation tag reference sizes and
introduces tag indexing.
Patch #5 adds a config to store page allocation tag references inside
page flags if they fit.
Patchset applies to mm-unstable.
Suren Baghdasaryan (5):
alloc_tag: load module tags into separate continuous memory
alloc_tag: eliminate alloc_tag_ref_set
alloc_tag: introduce pgalloc_tag_ref to abstract page tag references
alloc_tag: make page allocation tag reference size configurable
alloc_tag: config to store page allocation tag refs in page flags
.../admin-guide/kernel-parameters.txt | 4 +
include/asm-generic/codetag.lds.h | 19 ++
include/linux/alloc_tag.h | 46 ++-
include/linux/codetag.h | 38 ++-
include/linux/mmzone.h | 3 +
include/linux/page-flags-layout.h | 10 +-
include/linux/pgalloc_tag.h | 257 ++++++++++++---
kernel/module/main.c | 67 ++--
lib/Kconfig.debug | 36 ++-
lib/alloc_tag.c | 300 ++++++++++++++++--
lib/codetag.c | 105 +++++-
mm/mm_init.c | 1 +
mm/page_ext.c | 2 +-
scripts/module.lds.S | 5 +-
14 files changed, 759 insertions(+), 134 deletions(-)
base-commit: 651c8c1d735983040bec4f71d0e2e690f3c0fc2d
--
2.46.0.184.g6999bdac58-goog
Powered by blists - more mailing lists