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] [thread-next>] [day] [month] [year] [list]
Message-ID: <fffca253-87ba-6318-7039-2c0e88e2ffb1@huawei.com>
Date:   Wed, 24 Mar 2021 10:37:13 +0800
From:   Miaohe Lin <linmiaohe@...wei.com>
To:     Yang Shi <shy828301@...il.com>
CC:     Andrew Morton <akpm@...ux-foundation.org>,
        Jerome Glisse <jglisse@...hat.com>,
        Rafael Aquini <aquini@...hat.com>,
        David Hildenbrand <david@...hat.com>,
        Alistair Popple <apopple@...dia.com>,
        "Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
        Linux MM <linux-mm@...ck.org>
Subject: Re: [PATCH v2 1/5] mm/migrate.c: remove unnecessary VM_BUG_ON_PAGE on
 putback_movable_page()

On 2021/3/24 1:58, Yang Shi wrote:
> On Tue, Mar 23, 2021 at 6:54 AM Miaohe Lin <linmiaohe@...wei.com> wrote:
>>
>> The !PageLocked() check is implicitly done in PageMovable(). Remove this
>> explicit one.
> 
> TBH, I'm a little bit reluctant to have this kind change. If "locked"
> check is necessary we'd better make it explicit otherwise just remove
> it.
> 
> And why not just remove all the 3 VM_BUG_ON_PAGE since
> putback_movable_page() is just called by putback_movable_pages() and
> we know the page is locked and both PageMovable and PageIsolated is
> checked right before calling putback_movable_page().
> 
> And you also could make putback_movable_page() static.
> 

Sounds good! Many thanks for your advice!

>> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
>> ---
>>  mm/migrate.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/mm/migrate.c b/mm/migrate.c
>> index 47df0df8f21a..facec65c7374 100644
>> --- a/mm/migrate.c
>> +++ b/mm/migrate.c
>> @@ -145,7 +145,6 @@ void putback_movable_page(struct page *page)
>>  {
>>         struct address_space *mapping;
>>
>> -       VM_BUG_ON_PAGE(!PageLocked(page), page);
>>         VM_BUG_ON_PAGE(!PageMovable(page), page);
>>         VM_BUG_ON_PAGE(!PageIsolated(page), page);
>>
>> --
>> 2.19.1
>>
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ