lkml.org 
[lkml]   [2019]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [v3 PATCH] mm: ksm: do not block on page lock when searching stable tree
From
Date
On 1/30/19 9:47 AM, Yang Shi wrote:
[...]
>>> @@ -1673,7 +1688,12 @@ static struct page *stable_tree_search(struct page *page)
>>>                * It would be more elegant to return stable_node
>>>                * than kpage, but that involves more changes.
>>>                */
>>> -            tree_page = get_ksm_page(stable_node_dup, true);
>>> +            tree_page = get_ksm_page(stable_node_dup,
>>> +                         GET_KSM_PAGE_TRYLOCK);
>>> +
>>> +            if (PTR_ERR(tree_page) == -EBUSY)
>>> +                return ERR_PTR(-EBUSY);
>>
>> or just:
>>
>>     if (PTR_ERR(tree_page) == -EBUSY)
>>         return tree_page;
>>
>> right?
>
> Either looks fine to me. Returning errno may look more explicit? Anyway I really don't have preference.

Yes, either one is fine. I like to see less code on the screen, all else being equal,
but it's an extremely minor point, and sometimes being explicit instead is better anyway.



thanks,
--
John Hubbard
NVIDIA

\
 
 \ /
  Last update: 2019-01-30 19:15    [W:0.046 / U:5.584 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site