[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9bf60825-286f-d46c-b6d5-ee8bfffaaa48@nvidia.com>
Date: Wed, 30 Jan 2019 10:14:28 -0800
From: John Hubbard <jhubbard@...dia.com>
To: Yang Shi <yang.shi@...ux.alibaba.com>, <ktkhai@...tuozzo.com>,
<hughd@...gle.com>, <aarcange@...hat.com>,
<akpm@...ux-foundation.org>
CC: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [v3 PATCH] mm: ksm: do not block on page lock when searching
stable tree
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
Powered by blists - more mailing lists