Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

2024-09-01 Thread Andrew Morton
On Sun, 1 Sep 2024 21:41:28 -0700 Suren Baghdasaryan wrote: > Add CONFIG_PGALLOC_TAG_USE_PAGEFLAGS to store allocation tag > references directly in the page flags. This removes dependency on > page_ext and results in better performance for page allocations as > well as reduced page_ext memory ov

[PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

2024-09-01 Thread Suren Baghdasaryan
Add CONFIG_PGALLOC_TAG_USE_PAGEFLAGS to store allocation tag references directly in the page flags. This removes dependency on page_ext and results in better performance for page allocations as well as reduced page_ext memory overhead. CONFIG_PGALLOC_TAG_REF_BITS controls the number of bits require

[PATCH v2 1/6] maple_tree: add mas_for_each_rev() helper

2024-09-01 Thread Suren Baghdasaryan
Add mas_for_each_rev() function to iterate maple tree nodes in reverse order. Suggested-by: Liam R. Howlett Signed-off-by: Suren Baghdasaryan --- include/linux/maple_tree.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.

[PATCH v2 2/6] alloc_tag: load module tags into separate continuous memory

2024-09-01 Thread Suren Baghdasaryan
When a module gets unloaded there is a possibility that some of the allocations it made are still used and therefore the allocation tags corresponding to these allocations are still referenced. As such, the memory for these tags can't be freed. This is currently handled as an abnormal situation and

Re: [PATCH v2 5/6] alloc_tag: make page allocation tag reference size configurable

2024-09-01 Thread Andrew Morton
On Sun, 1 Sep 2024 21:41:27 -0700 Suren Baghdasaryan wrote: > Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the > page allocation tag references. When the size is configured to be > less than a direct pointer, the tags are searched using an index > stored as the tag reference. >

[PATCH v2 5/6] alloc_tag: make page allocation tag reference size configurable

2024-09-01 Thread Suren Baghdasaryan
Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the page allocation tag references. When the size is configured to be less than a direct pointer, the tags are searched using an index stored as the tag reference. Signed-off-by: Suren Baghdasaryan --- include/linux/alloc_tag.h | 10

[PATCH v2 3/6] alloc_tag: eliminate alloc_tag_ref_set

2024-09-01 Thread Suren Baghdasaryan
To simplify further refactoring, open-code the only two callers of alloc_tag_ref_set(). Signed-off-by: Suren Baghdasaryan --- include/linux/alloc_tag.h | 25 ++--- include/linux/pgalloc_tag.h | 12 +++- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git

[PATCH v2 0/6] page allocation tag compression

2024-09-01 Thread Suren Baghdasaryan
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

[PATCH v2 4/6] alloc_tag: introduce pgalloc_tag_ref to abstract page tag references

2024-09-01 Thread Suren Baghdasaryan
To simplify later changes to page tag references, introduce new pgalloc_tag_ref and pgtag_ref_handle types. This allows easy replacement of page_ext as a storage of page allocation tags Signed-off-by: Suren Baghdasaryan --- include/linux/pgalloc_tag.h | 144 +++-