Re: [PATCH RFC 05/13] mm/rmap: remove do_page_add_anon_rmap()

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

 



On 24.02.22 18:29, Linus Torvalds wrote:
> On Thu, Feb 24, 2022 at 4:29 AM David Hildenbrand <david@xxxxxxxxxx> wrote:
>>
>> ... and instead convert page_add_anon_rmap() to accept flags.
> 
> Can you fix the comment above the RMAP_xyz definitions? That one still says
> 
>   /* bitflags for do_page_add_anon_rmap() */
> 
> that tnow no longer exists.

Oh, yes sure.

> 
> Also, while this kind of code isn't unusual, I think it's still confusing:
> 
>> +               page_add_anon_rmap(page, vma, addr, 0);
> 
> because when reading that, at least I go "what does 0 mean? Is it a
> page offset, or what?"

Yes, I agree.

> 
> It might be a good idea to simply add a
> 
>   #define RMAP_PAGE 0x00
> 
> or something like that, just to have the callers all make it obvious
> that we're talking about that RMAP_xyz bits - even if some of them may
> be default.
> 
> (Then using an enum of a special type is something we do if we want to
> add extra clarity or sparse testing, I don't think there are enough
> users for that to make sense)
> 

Actually, I thought about doing it similarly to what I did in
page_alloc.c with fpi_t:

typedef int __bitwise fpi_t;

#define FPI_NONE		((__force fpi_t)0)


I can do something similar here.

-- 
Thanks,

David / dhildenb





[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