[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <877cow1v6u.fsf@oracle.com>
Date: Mon, 11 Sep 2023 10:22:33 -0700
From: Ankur Arora <ankur.a.arora@...cle.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: Ankur Arora <ankur.a.arora@...cle.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, x86@...nel.org,
akpm@...ux-foundation.org, luto@...nel.org, bp@...en8.de,
dave.hansen@...ux.intel.com, hpa@...or.com, mingo@...hat.com,
juri.lelli@...hat.com, vincent.guittot@...aro.org, mgorman@...e.de,
peterz@...radead.org, rostedt@...dmis.org, tglx@...utronix.de,
jon.grimm@....com, bharata@....com, raghavendra.kt@....com,
boris.ostrovsky@...cle.com, konrad.wilk@...cle.com
Subject: Re: [PATCH v2 3/9] mm/huge_page: cleanup clear_/copy_subpage()
Matthew Wilcox <willy@...radead.org> writes:
> On Wed, Aug 30, 2023 at 11:49:52AM -0700, Ankur Arora wrote:
>> @@ -5945,9 +5935,7 @@ static int __clear_huge_page(
>> /* Process subpages at the end of huge page */
>> for (i = pages_per_huge_page - 1; i >= 2 * n; i--) {
>> cond_resched();
>> - ret = process_subpage(addr + i * PAGE_SIZE, i, arg);
>> - if (ret)
>> - return ret;
>> + clear_user_highpage(page + i, addr + i * PAGE_SIZE);
>
> It's possible for a 1GB page to cross a memmap discontiguity. This
> needs to be:
>
> clear_user_highpage(nth_page(page, i),
> addr + i * PAGE_SIZE);
>
> (similarly in other places)
Thanks, will fix.
I see that the pre-patch version of clear_gigantic_page() does the right thing:
for (i = 0; i < pages_per_huge_page; i++) {
p = nth_page(page, i);
cond_resched();
clear_user_highpage(p, addr + i * PAGE_SIZE);
}
But, the clear_subpage() does not:
clear_user_highpage(page + idx, addr);
I think that got missed in 14455eabd840 ("mm: use nth_page instead of
mem_map_offset mem_map_next").
Should I be sending a patch to stable?
Also, for my testing, what's the config option where you would see a
memmap discontiguity?
Thanks
--
ankur
Powered by blists - more mailing lists