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  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]
Date:   Sat, 26 Dec 2020 09:57:13 -0800
From:   Linus Torvalds <>
To:     "Kirill A. Shutemov" <>
Cc:     Hugh Dickins <>,
        Matthew Wilcox <>,
        "Kirill A. Shutemov" <>,
        Will Deacon <>,
        Linux Kernel Mailing List <>,
        Linux-MM <>,
        Linux ARM <>,
        Catalin Marinas <>,
        Jan Kara <>, Minchan Kim <>,
        Andrew Morton <>,
        Vinayak Menon <>,
        Android Kernel Team <>
Subject: Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting

On Fri, Dec 25, 2020 at 3:31 AM Kirill A. Shutemov <> wrote:
> The new helper next_page() returns a stablized page, so filemap_map_pmd()
> can clearly decide if we should set up a page table or a huge page.

I really like that next_page() abstraction, my only comment is that I
think it should be renamed as "next_stable_page()" or something, and
then this part:

+       if (!page)
+               page = xas_find(xas, end_pgoff);
+       else
+               page = xas_next_entry(xas, end_pgoff);

should be in the caller.

Then just have two helper functions like 'first_map_page()' and
'next_map_page()' which just do

        next_stable_page(xas_find(xas, end_pgoff))


        next_stable_page(xas_next_entry(xas, end_pgoff))


Because not only does that get rid of the "if (page)" test, I think it
would make things a bit clearer. When I read the patch first, the
initial "next_page()" call confused me.

But maybe I'm just grasping at straws. Even in this format, I think
it's a nice cleanup and makes for more understandable code.


Powered by blists - more mailing lists