lkml.org 
[lkml]   [2018]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 2/7] mm/swapfile.c: Replace some #ifdef with IS_ENABLED()
Date
Dave Hansen <dave.hansen@linux.intel.com> writes:

> On 07/17/2018 08:25 PM, Huang, Ying wrote:
>>> Seriously, though, does it hurt us to add a comment or two to say
>>> something like:
>>>
>>> /*
>>> * Should not even be attempting cluster allocations when
>>> * huge page swap is disabled. Warn and fail the allocation.
>>> */
>>> if (!IS_ENABLED(CONFIG_THP_SWAP)) {
>>> VM_WARN_ON_ONCE(1);
>>> return 0;
>>> }
>> I totally agree with you that we should add more comments for THP swap
>> to improve the code readability. As for this specific case,
>> VM_WARN_ON_ONCE() here is just to capture some programming error during
>> development. Do we really need comments here?
>
> If it's code in mainline, we need to know what it is doing.
>
> If it's not useful to have in mainline, then let's remove it.

OK. Will add the comments.

Best Regards,
Huang, Ying

\
 
 \ /
  Last update: 2018-07-19 06:43    [W:0.077 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site