[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241111162248.7af77e56c1ff4017d1ed4106@linux-foundation.org>
Date: Mon, 11 Nov 2024 16:22:48 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Qiang Liu <liuq131@...natelecom.cn>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org, Mel Gorman
<mgorman@...hsingularity.net>, Laura Abbott <labbott@...hat.com>
Subject: Re: [PATCH] mm/compaction: fix the total_isolated in strict mode
On Sat, 2 Nov 2024 20:16:21 +0000 Qiang Liu <liuq131@...natelecom.cn> wrote:
> If the last cycle reads bogus compound_order() and blockpfn > end_pfn occurs,
> it is possible that total_isolated will be less than nr_scanned. In this case,
> strict mode should return 0, but the “if (strict && blockpfn < end_pfn)”
> statement cannot recognize this situation
>
> ...
>
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -699,7 +699,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
> * pages requested were isolated. If there were any failures, 0 is
> * returned and CMA will fail.
> */
> - if (strict && blockpfn < end_pfn)
> + if (strict && (blockpfn < end_pfn || total_isolated != nr_scanned))
> total_isolated = 0;
>
> cc->total_free_scanned += nr_scanned;
That's really old code. What userspace-visible effects might this
have? Is this from code inspection, or was some misbehaviour observed?
Thanks.
Powered by blists - more mailing lists