From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 073711A06C0 for ; Tue, 2 Dec 2014 21:12:20 +1100 (AEDT) Date: Tue, 2 Dec 2014 10:12:10 +0000 From: Mel Gorman To: Benjamin Herrenschmidt Subject: Re: [PATCH 02/10] mm: Add p[te|md] protnone helpers for use by NUMA balancing Message-ID: <20141202101210.GA6043@suse.de> References: <1416578268-19597-1-git-send-email-mgorman@suse.de> <1416578268-19597-3-git-send-email-mgorman@suse.de> <1417473519.7182.6.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 In-Reply-To: <1417473519.7182.6.camel@kernel.crashing.org> Cc: Rik van Riel , Linus Torvalds , Hugh Dickins , Linux Kernel , Linux-MM , Ingo Molnar , Paul Mackerras , Aneesh Kumar , Sasha Levin , Dave Jones , LinuxPPC-dev , Kirill Shutemov List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, Dec 02, 2014 at 09:38:39AM +1100, Benjamin Herrenschmidt wrote: > On Fri, 2014-11-21 at 13:57 +0000, Mel Gorman wrote: > > > #ifdef CONFIG_NUMA_BALANCING > > +/* > > + * These work without NUMA balancing but the kernel does not care. See the > > + * comment in include/asm-generic/pgtable.h > > + */ > > +static inline int pte_protnone(pte_t pte) > > +{ > > + return (pte_val(pte) & > > + (_PAGE_PRESENT | _PAGE_USER)) == _PAGE_PRESENT; > > +} > > I would add a comment clarifying that this only works for user pages, > ie, this accessor will always return "true" for a kernel page on ppc. > diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h index 490bd6d..7b889a3 100644 --- a/arch/powerpc/include/asm/pgtable.h +++ b/arch/powerpc/include/asm/pgtable.h @@ -41,7 +41,8 @@ static inline pgprot_t pte_pgprot(pte_t pte) { return __pgprot(pte_val(pte) & PA #ifdef CONFIG_NUMA_BALANCING /* * These work without NUMA balancing but the kernel does not care. See the - * comment in include/asm-generic/pgtable.h + * comment in include/asm-generic/pgtable.h . On powerpc, this will only + * work for user pages and always return true for kernel pages. */ static inline int pte_protnone(pte_t pte) { -- Mel Gorman SUSE Labs