diff options
| author | Sergey Senozhatsky <senozhatsky@chromium.org> | 2023-01-18 09:52:07 +0900 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2023-02-02 22:33:22 -0800 |
| commit | 6260ae3583456808dceb4d78077e6388c49ca6d7 (patch) | |
| tree | fc9d7a6952771eb67bea36e940a43a3f3a3aab9a /include/linux/moduleparam.h | |
| parent | 076cf7ea67010d11a97912423f4cdbeff1bd1f5f (diff) | |
zsmalloc: rework zspage chain size selection
Patch series "zsmalloc: make zspage chain size configurable".
Computers are bad at division. We currently decide the best zspage chain
size (max number of physical pages per-zspage) by looking at a `used
percentage` value. This is not enough as we lose precision during usage
percentage calculations For example, let's look at size class 208:
pages per zspage wasted bytes used%
1 144 96
2 80 99
3 16 99
4 160 99
Current algorithm will select 2 page per zspage configuration, as it's the
first one to reach 99%. However, 3 pages per zspage waste less memory.
Change algorithm and select zspage configuration that has lowest wasted
value.
Link: https://lkml.kernel.org/r/20230118005210.2814763-1-senozhatsky@chromium.org
Link: https://lkml.kernel.org/r/20230118005210.2814763-2-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/moduleparam.h')
0 files changed, 0 insertions, 0 deletions
