Re: [v3 PATCH] mm: ksm: do not block on page lock when searching stable tree

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

 



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





[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