All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@suse.de>
To: Hillf Danton <dhillf@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] balancenuma: fix page locking in migrating thp
Date: Sat, 24 Nov 2012 13:13:16 +0000	[thread overview]
Message-ID: <20121124131316.GC8218@suse.de> (raw)
In-Reply-To: <CAJd=RBCOCnzM0SbUPeCOe=cLfuJ5doFKWnCk5uSZhkJXbSArHA@mail.gmail.com>

On Sat, Nov 24, 2012 at 12:27:39PM +0800, Hillf Danton wrote:
> If fail to migrate thp(due to unsuccessful isolation), and if the original
> pmd entry is changed after reaquiring page table lock, it is unsafe to
> release the page lock as page maybe unstable.
> 
> It is fixed by raising extra page count before trying migration.
> 

Less sure of this one but the locking here is a mess. A reference count
is already taken. Isolating the page takes another reference count so the
first one can be dropped without the page being freed underneath us. The
migration function takes care of unlocking the page on a successful
migration. On unsuccessful migration, the PMD is rechecked under the
lock before clearing the pmd_numa. I'm not sure where you are seeing
the instability but I haven't fired up my brain either (it's the weekend
:)). I'll take a fresh look at this Monday.

Thanks!

-- 
Mel Gorman
SUSE Labs

      reply	other threads:[~2012-11-24 13:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-24  4:27 [PATCH 3/3] balancenuma: fix page locking in migrating thp Hillf Danton
2012-11-24 13:13 ` Mel Gorman [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=20121124131316.GC8218@suse.de \
    --to=mgorman@suse.de \
    --cc=dhillf@gmail.com \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.