diff options
| author | Zhongkun He <hezhongkun.hzk@bytedance.com> | 2025-05-09 16:35:28 +0800 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2025-05-22 14:55:36 -0700 |
| commit | 83b6d498d027002e79c2ce40b5729137500c3170 (patch) | |
| tree | 9efa723e86dd3c0d49b9615af1a5d21dff99e570 /mm/cma.h | |
| parent | 2616b370323a953c437ed2bf40a277e9deaa3709 (diff) | |
mm: cma: set early_pfn and bitmap as a union in cma_memrange
Since early_pfn and bitmap are never used at the same time, they can be
defined as a union to reduce the size of the data structure. This change
can save 8 * u64 entries per CMA.
Link: https://lkml.kernel.org/r/20250509083528.1360952-1-hezhongkun.hzk@bytedance.com
Signed-off-by: Zhongkun He <hezhongkun.hzk@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/cma.h')
| -rw-r--r-- | mm/cma.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -25,9 +25,11 @@ struct cma_kobject { */ struct cma_memrange { unsigned long base_pfn; - unsigned long early_pfn; unsigned long count; - unsigned long *bitmap; + union { + unsigned long early_pfn; + unsigned long *bitmap; + }; #ifdef CONFIG_CMA_DEBUGFS struct debugfs_u32_array dfs_bitmap; #endif |
