lkml.org 
[lkml]   [2018]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -mm -v4 03/21] mm, THP, swap: Support PMD swap mapping in swap_duplicate()
From
Date
> Yes.  Boolean parameter isn't good at most times.  Matthew Wilcox
> suggested to use
>
> swap_duplicate(&entry, HPAGE_PMD_NR);
>
> vs.
>
> swap_duplicate(&entry, 1);
>
> He thinks this makes the interface more flexible to support other swap
> entry size in the future. What do you think about that?

That looks great to me too.

>>> if (likely(!non_swap_entry(entry))) {
>>> - if (swap_duplicate(entry) < 0)
>>> + if (swap_duplicate(&entry, false) < 0)
>>> return entry.val;
>>>
>>> /* make sure dst_mm is on swapoff's mmlist. */
>>
>> I'll also point out that in a multi-hundred-line patch, adding arguments
>> to a existing function would not be something I'd try to include in the
>> patch. I'd break it out separately unless absolutely necessary.
>
> You mean add another patch, which only adds arguments to the function,
> but not change the body of the function?

Yes. Or, just add the non-THP-swap version first.

\
 
 \ /
  Last update: 2018-07-10 15:52    [W:0.111 / U:2.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site