From: John Hubbard <jhubbard@nvidia.com>
To: Yang Shi <yang.shi@linux.alibaba.com>, <ktkhai@virtuozzo.com>,
<hughd@google.com>, <aarcange@redhat.com>,
<akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [v3 PATCH] mm: ksm: do not block on page lock when searching stable tree
Date: Wed, 30 Jan 2019 10:14:28 -0800 [thread overview]
Message-ID: <9bf60825-286f-d46c-b6d5-ee8bfffaaa48@nvidia.com> (raw)
In-Reply-To: <7cf16cfb-3190-dfbd-ce72-92a94d9277f5@linux.alibaba.com>
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
next prev parent reply other threads:[~2019-01-30 18:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-29 20:29 Yang Shi
2019-01-30 7:14 ` John Hubbard
2019-01-30 17:47 ` Yang Shi
2019-01-30 18:14 ` John Hubbard [this message]
2019-01-30 8:13 ` Kirill Tkhai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9bf60825-286f-d46c-b6d5-ee8bfffaaa48@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=yang.shi@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox