In pcpu_setup_first_chunk() pcpu_reserved_chunk is assigned to point to
static chunk. While pcpu_first_chunk is got from below code:

        pcpu_first_chunk = dchunk ?: schunk;

pcpu_first_chunk might point to static chunk too with possibility. Add a
WARN_ON here to yell out if that happened.*/

Signed-off-by: Baoquan He <[email protected]>
---
 mm/percpu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/mm/percpu.c b/mm/percpu.c
index 8cf18dc..974600b 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -2275,6 +2275,13 @@ void __init percpu_init_late(void)
        unsigned long flags;
        int i;
 
+       /* In pcpu_setup_first_chunk() pcpu_reserved_chunk is assigned to point 
to
+        * static chunk. While pcpu_first_chunk is got from below code:
+        *              pcpu_first_chunk = dchunk ?: schunk;
+        * pcpu_first_chunk might point to static chunk too with possibility. 
Add a
+        * WARN_ON here to yell out if that happened.*/
+       WARN_ON(pcpu_first_chunk == pcpu_reserved_chunk);
+
        for (i = 0; (chunk = target_chunks[i]); i++) {
                int *map;
                const size_t size = PERCPU_DYNAMIC_EARLY_SLOTS * sizeof(map[0]);
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to