linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Zi Yan" <zi.yan@cs.rutgers.edu>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm: Introduce page_size()
Date: Tue, 01 Jan 2019 15:11:04 -0500	[thread overview]
Message-ID: <512B2F1D-73EE-46A8-89CC-DBF03CAA0F27@cs.rutgers.edu> (raw)
In-Reply-To: <20190101063922.GE6310@bombadil.infradead.org>

[-- Attachment #1: Type: text/plain, Size: 982 bytes --]

On 1 Jan 2019, at 1:39, Matthew Wilcox wrote:

> On Tue, Jan 01, 2019 at 02:02:22AM +0300, Kirill A. Shutemov wrote:
>> On Mon, Dec 31, 2018 at 05:42:23AM -0800, Matthew Wilcox wrote:
>>> It's unnecessarily hard to find out the size of a potentially huge page.
>>> Replace 'PAGE_SIZE << compound_order(page)' with page_size(page).
>>
>> Good idea.
>>
>> Should we add page_mask() and page_shift() too?
>
> I'm not opposed to that at all.  I also have a patch to add compound_nr():
>
> +/* Returns the number of pages in this potentially compound page. */
> +static inline unsigned long compound_nr(struct page *page)
> +{
> +       return 1UL << compound_order(page);
> +}
>
> I just haven't sent it yet ;-)  It should, perhaps, be called page_count()
> or nr_pages() or something.  That covers most of the remaining users of
> compound_order() which look awkward.

We already have hpage_nr_pages() to show the number of pages. Why do we need
another one?


--
Best Regards,
Yan Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 516 bytes --]

  reply	other threads:[~2019-01-01 20:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-31 13:42 Matthew Wilcox
2018-12-31 23:02 ` Kirill A. Shutemov
2019-01-01  6:39   ` Matthew Wilcox
2019-01-01 20:11     ` Zi Yan [this message]
2019-01-02  0:58       ` Matthew Wilcox
2019-01-02  1:16         ` Zi Yan
2019-01-01  3:27 ` Aneesh Kumar K.V
2019-01-01  3:27   ` Aneesh Kumar K.V
2019-01-01  6:30   ` Matthew Wilcox
2019-01-01 10:11     ` Aneesh Kumar K.V
2019-01-02  3:14       ` Matthew Wilcox
2019-01-02 11:46         ` William Kucharski
2019-01-02 13:09           ` Matthew Wilcox
2019-01-03 10:47             ` William Kucharski
2019-01-01 10:15     ` Aneesh Kumar K.V
2019-05-10 18:12 Matthew Wilcox
2019-05-13 10:56 ` Michal Hocko
2019-05-13 12:43 ` Kirill Tkhai
2019-05-14 11:53   ` William Kucharski
2019-05-22 20:03   ` Andrew Morton
2019-05-23  1:55     ` Matthew Wilcox
2019-05-23 21:33       ` Andrew Morton
2019-05-23 21:44         ` Matthew Wilcox
2019-05-24  6:34           ` Christoph Hellwig

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=512B2F1D-73EE-46A8-89CC-DBF03CAA0F27@cs.rutgers.edu \
    --to=zi.yan@cs.rutgers.edu \
    --cc=akpm@linux-foundation.org \
    --cc=kirill@shutemov.name \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /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