[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230607090734.1259-1-haifeng.xu@shopee.com>
Date: Wed, 7 Jun 2023 09:07:34 +0000
From: Haifeng Xu <haifeng.xu@...pee.com>
To: rppt@...nel.org
Cc: mhocko@...nel.org, akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Haifeng Xu <haifeng.xu@...pee.com>
Subject: [PATCH] mm/mm_init.c: add debug messsge for dma zone
If freesize is less than dma_reserve, print warning message to report
this case.
Signed-off-by: Haifeng Xu <haifeng.xu@...pee.com>
---
mm/mm_init.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/mm/mm_init.c b/mm/mm_init.c
index 232efac9a929..9a9d6a52471c 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -1561,9 +1561,14 @@ static void __init free_area_init_core(struct pglist_data *pgdat)
}
/* Account for reserved pages */
- if (j == 0 && freesize > dma_reserve) {
- freesize -= dma_reserve;
- pr_debug(" %s zone: %lu pages reserved\n", zone_names[0], dma_reserve);
+ if (j == 0) {
+ if (freesize >= dma_reserve) {
+ freesize -= dma_reserve;
+ pr_debug(" %s zone: %lu pages reserved\n",
+ zone_names[0], dma_reserve);
+ } else
+ pr_warn(" %s zone: %lu reserved pages exceeds freesize %lu\n",
+ zone_names[0], dma_reserve, freesize);
}
if (!is_highmem_idx(j))
--
2.25.1
Powered by blists - more mailing lists