From: Michal Hocko <mhocko@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Huang Shijie <b32955@freescale.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: introduce __linear_page_index()
Date: Fri, 15 Feb 2013 16:02:05 +0100 [thread overview]
Message-ID: <20130215150205.GC31037@dhcp22.suse.cz> (raw)
In-Reply-To: <20130205132741.1e1a4e04.akpm@linux-foundation.org>
On Tue 05-02-13 13:27:41, Andrew Morton wrote:
[...]
> > +static inline pgoff_t linear_page_index(struct vm_area_struct *vma,
> > + unsigned long address)
> > +{
> > if (unlikely(is_vm_hugetlb_page(vma)))
> > return linear_hugepage_index(vma, address);
> > - pgoff = (address - vma->vm_start) >> PAGE_SHIFT;
> > - pgoff += vma->vm_pgoff;
> > - return pgoff >> (PAGE_CACHE_SHIFT - PAGE_SHIFT);
> > + return __linear_page_index(vma, address) >>
> > + (PAGE_CACHE_SHIFT - PAGE_SHIFT);
> > }
>
> I don't think we need bother creating both linear_page_index() and
> __linear_page_index(). Realistically, we won't be supporting
> PAGE_SHIFT!=PAGE_CACHE_SHIFT. And most (or all?) of the sites which
> you changed should have been using PAGE_CACHE_SHIFT anyway!
Except for hugetlb (huge_pmd_share, unmap_ref_private) which uses
PAGE_SHIFT to get an index into mapping. History proves there was
some confusion about those in the past (36e4f20a fixing 0c176d52). So
__linear_page_index makes some sense here.
--
Michal Hocko
SUSE Labs
--
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:[~2013-02-15 15:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-05 7:03 [PATCH] mm: introduce __linear_page_index() Huang Shijie
2013-02-05 21:27 ` Andrew Morton
2013-02-15 15:02 ` Michal Hocko [this message]
2013-02-17 7:39 ` Huang Shijie
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=20130215150205.GC31037@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=b32955@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).