Messages in this thread | | | Date | Sat, 24 Nov 2012 13:13:16 +0000 | From | Mel Gorman <> | Subject | Re: [PATCH 3/3] balancenuma: fix page locking in migrating thp |
| |
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
| |