lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ