lkml.org 
[lkml]   [2020]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH -V2] mm: Add PageLayzyFree() helper functions for MADV_FREE
Date
David Rientjes <rientjes@google.com> writes:

> On Thu, 5 Mar 2020, Huang, Ying wrote:
>
>> > In general, I don't think this patch really improves the situation ...
>> > it's only a handful of places where this change slightly makes the code
>> > easier to understand. And there, only slightly ... I'd prefer better
>> > comments instead (e.g., in PageAnon()), documenting what it means for a
>> > anon page to either have PageSwapBacked() set or not.
>>
>> Personally, I still prefer the better named functions than the comments
>> here and there. But I can understand that people may have different
>> flavor.
>>
>
> Maybe add a comment to page-flags.h referring to what PageSwapBacked
> indicates when PageAnon is true?

If someone find a confusing PageSwapBacked() invocation, and if we only
want to use comments to resolve the confusing, the best place to add the
comments is above the line where PageSwapBacked() is invoked. Because
it's harder for people to dig out the right comments in page-flags.h.
The appropriate named helper functions can replace that comments and be
more elegant.

Best Regards,
Huang, Ying

\
 
 \ /
  Last update: 2020-03-09 03:16    [W:0.051 / U:1.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site