Re: [PATCH v2 3/9] mm/huge_page: cleanup clear_/copy_subpage()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthew Wilcox <willy@xxxxxxxxxxxxx> 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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux