[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <12759ac7-4a6c-89fa-5fd0-914728f6415e@redhat.com>
Date: Mon, 29 Aug 2022 14:18:58 +0200
From: David Hildenbrand <david@...hat.com>
To: Zhaoyang Huang <huangzhaoyang@...il.com>,
"zhaoyang.huang" <zhaoyang.huang@...soc.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Catalin Marinas <catalin.marinas@....com>,
"open list:MEMORY MANAGEMENT" <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>, Ke Wang <ke.wang@...soc.com>
Subject: Re: [PATCH] mm: skip reserved page for kmem leak scanning
On 26.08.22 05:23, Zhaoyang Huang wrote:
> On Fri, Aug 26, 2022 at 11:13 AM zhaoyang.huang
> <zhaoyang.huang@...soc.com> wrote:
>>
>> From: Zhaoyang Huang <zhaoyang.huang@...soc.com>
>>
>> It is no need to scan reserved page, skip it.
>>
>> Signed-off-by: Zhaoyang Huang <zhaoyang.huang@...soc.com>
>> ---
>> mm/kmemleak.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
>> index a182f5d..c546250 100644
>> --- a/mm/kmemleak.c
>> +++ b/mm/kmemleak.c
>> @@ -1471,7 +1471,7 @@ static void kmemleak_scan(void)
>> if (page_zone(page) != zone)
>> continue;
>> /* only scan if page is in use */
>> - if (page_count(page) == 0)
>> + if (page_count(page) == 0 || PageReserved(page))
> Sorry for previous stupid code by my faint, correct it here
Did you even test the initial patch?
I wonder why we should consider this change
(a) I doubt it's a performance issue. If it is, please provide numbers
before/after.
(b) We'll stop scanning early allocations. As the memmap is usually
allocated early during boot ... we'll stop scanning essentially the
whole mmap and that whole loop would be dead code? What am i
missing?
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists