From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Hugh Dickins <hughd@google.com>, Rik van Riel <riel@redhat.com>,
Hillf Danton <dhillf@gmail.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Naoya Horiguchi <nao.horiguchi@gmail.com>
Subject: Re: [PATCH -mm] mm: refactor page index/offset getters
Date: Wed, 23 Jul 2014 17:45:54 -0400 [thread overview]
Message-ID: <20140723214554.GA2263@nhori.bos.redhat.com> (raw)
In-Reply-To: <20140723143918.8334558ccac8c29047c0058b@linux-foundation.org>
On Wed, Jul 23, 2014 at 02:39:18PM -0700, Andrew Morton wrote:
> On Tue, 15 Jul 2014 12:41:12 -0400 Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> wrote:
>
> > There is a complaint about duplication around the fundamental routines
> > of page index/offset getters.
> >
> > page_(index|offset) and page_file_(index|offset) provide the same
> > functionality, so we can merge them as page_(index|offset), respectively.
> >
> > And this patch gives the clear meaning to the getters:
> > - page_index(): get page cache index (offset in relevant page size)
> > - page_pgoff(): get 4kB page offset
> > - page_offset(): get byte offset
> > All these functions are aware of regular pages, swapcaches, and hugepages.
> >
> > The definition of PageHuge is relocated to include/linux/mm.h, because
> > some users of page_pgoff() doesn't include include/linux/hugetlb.h.
> >
> > __page_file_index() is not well named, because it's only for swap cache.
> > So let's rename it with __page_swap_index().
>
> Thanks, I guess that's better. Could others please have a look-n-think?
>
> I did this:
>
> --- a/include/linux/pagemap.h~mm-refactor-page-index-offset-getters-fix
> +++ a/include/linux/pagemap.h
> @@ -412,7 +412,7 @@ static inline pgoff_t page_pgoff(struct
> }
>
> /*
> - * Return the byte offset of the given page.
> + * Return the file offset of the given pagecache page, in bytes.
Thanks, it's clearer.
> static inline loff_t page_offset(struct page *page)
> {
>
>
>
> You had a random xfs_aops.c whitespace fix which I'll pretend I didn't
> notice ;)
I just couldn't resist fixing it ;)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-07-23 22:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-01 14:46 [PATCH] rmap: fix pgoff calculation to handle hugepage correctly Naoya Horiguchi
2014-07-01 17:42 ` Rik van Riel
2014-07-01 18:07 ` Kirill A. Shutemov
2014-07-01 18:50 ` Naoya Horiguchi
2014-07-01 20:15 ` Kirill A. Shutemov
2014-07-02 4:30 ` Naoya Horiguchi
2014-07-03 11:41 ` Kirill A. Shutemov
2014-07-07 19:39 ` Andrew Morton
2014-07-15 16:41 ` [PATCH -mm] mm: refactor page index/offset getters Naoya Horiguchi
2014-07-23 21:39 ` Andrew Morton
2014-07-23 21:45 ` Naoya Horiguchi [this message]
2014-07-28 20:29 ` Johannes Weiner
2014-07-29 0:42 ` Naoya Horiguchi
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=20140723214554.GA2263@nhori.bos.redhat.com \
--to=n-horiguchi@ah.jp.nec.com \
--cc=akpm@linux-foundation.org \
--cc=dhillf@gmail.com \
--cc=hughd@google.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nao.horiguchi@gmail.com \
--cc=riel@redhat.com \
/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