* + mm-cma-make-mm-cmah-self-contained-and-conditionalize-includes.patch added to mm-new branch
@ 2026-08-30 1:33 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-08-30 1:33 UTC (permalink / raw)
To: mm-commits, baohua, eamon112009, akpm
The patch titled
Subject: mm: cma: make mm/cma.h self-contained and conditionalize includes
has been added to the -mm mm-new branch. Its filename is
mm-cma-make-mm-cmah-self-contained-and-conditionalize-includes.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-cma-make-mm-cmah-self-contained-and-conditionalize-includes.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
The mm-new branch of mm.git is not included in linux-next
If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Eamon Sippy <eamon112009@gmail.com>
Subject: mm: cma: make mm/cma.h self-contained and conditionalize includes
Date: Sat, 15 Aug 2026 10:32:45 +0000
mm/cma.h uses types from <linux/spinlock.h>, <linux/mutex.h>,
<linux/atomic.h> and <linux/list.h> without explicitly including them,
violating the kernel header self-containment guidelines.
<linux/debugfs.h> and <linux/kobject.h> are also included unconditionally
even though they are only needed under CONFIG_CMA_DEBUGFS and
CONFIG_CMA_SYSFS respectively. Move the struct cma_kobject definition and
<linux/kobject.h> inside the CONFIG_CMA_SYSFS block, and move
<linux/debugfs.h> inside CONFIG_CMA_DEBUGFS.
Remove spurious trailing semicolons after the empty inline function bodies
in the CONFIG_CMA_SYSFS #else branch.
Add <linux/cma.h> so that MAX_CMA_AREAS and CMA_MAX_NAME are always
available when this header is included.
Link: https://lore.kernel.org/20260815103246.5315-1-eamon112009@gmail.com
Signed-off-by: Eamon Sippy <eamon112009@gmail.com>
Reviewed-by: Barry Song <baohua@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/cma.h | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
--- a/mm/cma.h~mm-cma-make-mm-cmah-self-contained-and-conditionalize-includes
+++ a/mm/cma.h
@@ -2,14 +2,24 @@
#ifndef __MM_CMA_H__
#define __MM_CMA_H__
+#include <linux/atomic.h>
#include <linux/cma.h>
+#include <linux/list.h>
+#include <linux/mutex.h>
+#include <linux/spinlock.h>
+
+#ifdef CONFIG_CMA_DEBUGFS
#include <linux/debugfs.h>
+#endif
+
+#ifdef CONFIG_CMA_SYSFS
#include <linux/kobject.h>
struct cma_kobject {
struct kobject kobj;
struct cma *cma;
};
+#endif
/*
* Multi-range support. This can be useful if the size of the allocation
@@ -38,10 +48,10 @@ struct cma_memrange {
#define CMA_MAX_RANGES 8
struct cma {
- unsigned long count;
- unsigned long available_count;
+ unsigned long count;
+ unsigned long available_count;
unsigned int order_per_bit; /* Order of pages represented by one bit */
- spinlock_t lock;
+ spinlock_t lock;
struct mutex alloc_mutex;
#ifdef CONFIG_CMA_DEBUGFS
struct hlist_head mem_head;
@@ -87,10 +97,11 @@ void cma_sysfs_account_fail_pages(struct
void cma_sysfs_account_release_pages(struct cma *cma, unsigned long nr_pages);
#else
static inline void cma_sysfs_account_success_pages(struct cma *cma,
- unsigned long nr_pages) {};
+ unsigned long nr_pages) {}
static inline void cma_sysfs_account_fail_pages(struct cma *cma,
- unsigned long nr_pages) {};
+ unsigned long nr_pages) {}
static inline void cma_sysfs_account_release_pages(struct cma *cma,
- unsigned long nr_pages) {};
+ unsigned long nr_pages) {}
#endif
+
#endif
_
Patches currently in -mm which might be from eamon112009@gmail.com are
mm-cma-make-mm-cmah-self-contained-and-conditionalize-includes.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-30 1:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-30 1:33 + mm-cma-make-mm-cmah-self-contained-and-conditionalize-includes.patch added to mm-new branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.