[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130107151430.GL3885@suse.de>
Date: Mon, 7 Jan 2013 15:14:30 +0000
From: Mel Gorman <mgorman@...e.de>
To: Simon Jeons <simon.jeons@...il.com>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Andrea Arcangeli <aarcange@...hat.com>,
Ingo Molnar <mingo@...nel.org>, Rik van Riel <riel@...hat.com>,
Johannes Weiner <hannes@...xchg.org>,
Hugh Dickins <hughd@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Paul Turner <pjt@...gle.com>, Hillf Danton <dhillf@...il.com>,
David Rientjes <rientjes@...gle.com>,
Lee Schermerhorn <Lee.Schermerhorn@...com>,
Alex Shi <lkml.alex@...il.com>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
Aneesh Kumar <aneesh.kumar@...ux.vnet.ibm.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux-MM <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 22/49] mm: mempolicy: Add MPOL_MF_LAZY
On Fri, Jan 04, 2013 at 11:18:17PM -0600, Simon Jeons wrote:
> > +static int
> > +change_prot_numa_range(struct mm_struct *mm, struct vm_area_struct *vma,
> > + unsigned long address)
> > +{
> > + pgd_t *pgd;
> > + pud_t *pud;
> > + pmd_t *pmd;
> > + pte_t *pte, *_pte;
> > + struct page *page;
> > + unsigned long _address, end;
> > + spinlock_t *ptl;
> > + int ret = 0;
> > +
> > + VM_BUG_ON(address & ~PAGE_MASK);
> > +
> > + pgd = pgd_offset(mm, address);
> > + if (!pgd_present(*pgd))
> > + goto out;
> > +
> > + pud = pud_offset(pgd, address);
> > + if (!pud_present(*pud))
> > + goto out;
> > +
> > + pmd = pmd_offset(pud, address);
> > + if (pmd_none(*pmd))
> > + goto out;
> > +
> > + if (pmd_trans_huge_lock(pmd, vma) == 1) {
> > + int page_nid;
> > + ret = HPAGE_PMD_NR;
> > +
> > + VM_BUG_ON(address & ~HPAGE_PMD_MASK);
> > +
> > + if (pmd_numa(*pmd)) {
> > + spin_unlock(&mm->page_table_lock);
> > + goto out;
> > + }
> > +
> > + page = pmd_page(*pmd);
> > +
> > + /* only check non-shared pages */
> > + if (page_mapcount(page) != 1) {
> > + spin_unlock(&mm->page_table_lock);
> > + goto out;
> > + }
> > +
> > + page_nid = page_to_nid(page);
> > +
> > + if (pmd_numa(*pmd)) {
> > + spin_unlock(&mm->page_table_lock);
> > + goto out;
> > + }
> > +
>
> Hi Gorman,
>
> Since pmd_trans_huge_lock has already held &mm->page_table_lock, then
> why check pmd_numa(*pmd) again?
>
It looks like oversight. I've added a TODO item to clean it up when I
revisit NUMA balancing some time soon.
Thanks.
--
Mel Gorman
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists