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]
Message-Id: <7B762A95-B8A6-4281-94F1-5DA6B62EDCF9@oracle.com>
Date:   Sat, 11 May 2019 16:33:01 -0600
From:   William Kucharski <william.kucharski@...cle.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     "Huang, Ying" <ying.huang@...el.com>,
        Yang Shi <yang.shi@...ux.alibaba.com>, hannes@...xchg.org,
        mhocko@...e.com, mgorman@...hsingularity.net,
        kirill.shutemov@...ux.intel.com, hughd@...gle.com,
        akpm@...ux-foundation.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: vmscan: correct nr_reclaimed for THP



> On May 10, 2019, at 10:36 AM, Matthew Wilcox <willy@...radead.org> wrote:
> 
> Please don't.  That embeds the knowledge that we can only swap out either 
> normal pages or THP sized pages.  I'm trying to make the VM capable of 
> supporting arbitrary-order pages, and this would be just one more place
> to fix.
> 
> I'm sympathetic to the "self documenting" argument.  My current tree has
> a patch in it:
> 
>    mm: Introduce compound_nr
> 
>    Replace 1 << compound_order(page) with compound_nr(page).  Minor
>    improvements in readability.
> 
> It goes along with this patch:
> 
>    mm: Introduce page_size()
> 
>    It's unnecessarily hard to find out the size of a potentially huge page.
>    Replace 'PAGE_SIZE << compound_order(page)' with page_size(page).
> 
> Better suggestions on naming gratefully received.  I'm more happy with 
> page_size() than I am with compound_nr().  page_nr() gives the wrong
> impression; page_count() isn't great either.

I like page_size() as well. At least to me, page_nr() or page_count() would
imply a basis of PAGESIZE, or that you would need to do something like:

    page_size = page_nr() << PAGE_SHIFT;

to get the size in bytes; page_size() is more straightforward in that respect.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ