mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: kenneth.w.chen@intel.com, linux-kernel@vger.kernel.org,
	linuxppc64-dev@lists.linuxppc.org
Subject: Re: Fix bogus get_page() calls in hugepage code
Date: Thu, 15 Apr 2004 21:49:09 -0700	[thread overview]
Message-ID: <20040415214909.4eeb9ea9.akpm@osdl.org> (raw)
In-Reply-To: <20040416043726.GA26707@zax>

David Gibson <david@gibson.dropbear.id.au> wrote:
>
> On Thu, Apr 15, 2004 at 09:30:11PM -0700, Andrew Morton wrote:
> > David Gibson <david@gibson.dropbear.id.au> wrote:
> > >
> > > On some archs the functions used to implement follow_page() for
> > >  hugepages do a get_page().  This is unlike the normal-page path for
> > >  follow_page(), so presumably a bug.  This patch fixes it.
> > 
> > get_user_pages() is supposed to pin the pages which it placed into the
> > callers pages[] array.
> > 
> > And the caller of get_user_pages() is supposed to unpin those pages when
> > they are finished with.
> > 
> > So follow_hugetlb_page() is currently doing the right thing.  The asymmetry
> > with follow_page() is awkward, but the overall intent was to minimise the
> > amount of impact which the hugepage code has on core MM.
> 
> Yes, but I'm not talking about follow_hugetlb_page() (my patch doesn't
> touch it).  I'm talking about follow_huge_addr() and
> follow_huge_pmd().  These are called to implement follow_page().  In
> get_user_pages(), follow_pages() is bypassed bu the call to
> follow_hugetlb_page(), but these extra get_pages() are presumably a
> bug if follow_page() is called on a hugepage from somewhere other than
> get_user_pages().

Oh, OK.  IIRC that stuff was added to support futexes-in-large-pages.  The
caller holds ->page_table_lock, as does zap_hugepage_range(), so that seems
fine.

> So I think my patch is correct.

yup, thanks.

      reply	other threads:[~2004-04-16  4:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-16  4:12 David Gibson
2004-04-16  4:30 ` Andrew Morton
2004-04-16  4:37   ` David Gibson
2004-04-16  4:49     ` Andrew Morton [this message]

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=20040415214909.4eeb9ea9.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=kenneth.w.chen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@lists.linuxppc.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

all inboxes | Powered by JetHome®