[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <05e50d0c-4222-4c1f-b051-c7249f04c661@redhat.com>
Date: Wed, 5 Jun 2024 09:25:37 +0200
From: David Hildenbrand <david@...hat.com>
To: ran xiaokai <ranxiaokai627@....com>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, mhocko@...nel.org, v-songbaohua@...o.com,
ran.xiaokai@....com.cn, xu.xin16@....com.cn, yang.yang29@....com.cn,
ziy@...dia.com
Subject: Re: [PATCH linux-next] mm: huge_memory: fix misused
mapping_large_folio_support() for anon folios
On 05.06.24 04:20, ran xiaokai wrote:
>> On 04.06.24 07:47, xu.xin16@....com.cn wrote:
>>> From: Ran Xiaokai <ran.xiaokai@....com.cn>
>>>
>>> When I did a large folios split test, a WARNING
>>> "[ 5059.122759][ T166] Cannot split file folio to non-0 order"
>>> was triggered. But my test cases are only for anonmous folios.
>>> while mapping_large_folio_support() is only reasonable for page
>>> cache folios.
>>
>> Agreed.
>>
>> I wonder if mapping_large_folio_support() should either
>>
>> a) Complain if used for anon folios, so we can detect the wrong use more
>> easily. (VM_WARN_ON_ONCE())
>
>> b) Return "true" for anonymous mappings, although that's more debatable.
>>
>
> Hi, David,
> Thanks for the review.
> I think a) is better.
> But we have to add a new parameter "folio" to mapping_large_folio_support(), right ?
> something like mapping_large_folio_support(struct address_space *mapping, struct folio *folio) ?
> But in the __filemap_get_folio() path,
>
> __filemap_get_folio()
> no_page:
> ....
> if (!mapping_large_folio_support(mapping))
>
> the folio is not allocated yet, yes ?
> Or do you mean there is some other way to do this ?
If we really pass unmodified folio->mapping, you can do what
folio_test_anon() would and make sure PAGE_MAPPING_ANON is not set.
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists