lkml.org 
[lkml]   [2022]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 08/16] mm/rmap: drop "compound" parameter from page_add_new_anon_rmap()
From
On 13.04.22 14:26, Matthew Wilcox wrote:
> On Tue, Apr 12, 2022 at 11:37:09AM +0200, David Hildenbrand wrote:
>> On 12.04.22 10:47, Vlastimil Babka wrote:
>>> There's a VM_BUG_ON_PAGE(PageTransCompound(page), page); later in a
>>> !compound branch. Since compound is now determined by the same check, could
>>> be deleted.
>>
>> Yes, eventually we could get rid of both VM_BUG_ON_PAGE() on both
>> branches and add a single VM_BUG_ON_PAGE(PageTail(page), page) check on
>> the compound branch. (we could also make sure that we're not given a
>> hugetlb page)
>
> As a rule of thumb, if you find yourself wanting to add
> VM_BUG_ON_PAGE(PageTail(page), page), you probably want to change the
> interface to take a folio.

Yeah, I had the same in mind. Might be a reasonable addon on top --
although it would stick out in the rmap code a bit because most
functions deal with both, folios and subpages.

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2022-04-13 14:29    [W:0.099 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site