From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752780AbbCGUNa (ORCPT ); Sat, 7 Mar 2015 15:13:30 -0500 Received: from mail-ie0-f171.google.com ([209.85.223.171]:34588 "EHLO mail-ie0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752592AbbCGUN1 (ORCPT ); Sat, 7 Mar 2015 15:13:27 -0500 MIME-Version: 1.0 In-Reply-To: <1425741651-29152-2-git-send-email-mgorman@suse.de> References: <1425741651-29152-1-git-send-email-mgorman@suse.de> <1425741651-29152-2-git-send-email-mgorman@suse.de> Date: Sat, 7 Mar 2015 12:13:27 -0800 X-Google-Sender-Auth: UxM394jCDzp0IGnwrumZnD6349Y Message-ID: Subject: Re: [PATCH 1/4] mm: thp: Return the correct value for change_huge_pmd From: Linus Torvalds To: Mel Gorman Cc: Dave Chinner , Andrew Morton , Ingo Molnar , Aneesh Kumar , Linux Kernel Mailing List , Linux-MM , xfs@oss.sgi.com, ppc-dev Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Looks obviously correct. The old code was just very wrong. Acked-by: Linus Torvalds Linus On Sat, Mar 7, 2015 at 7:20 AM, Mel Gorman wrote: > The wrong value is being returned by change_huge_pmd since commit > 10c1045f28e8 ("mm: numa: avoid unnecessary TLB flushes when setting > NUMA hinting entries") which allows a fallthrough that tries to adjust > non-existent PTEs. This patch corrects it. > > Signed-off-by: Mel Gorman > --- > mm/huge_memory.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index fc00c8cb5a82..194c0f019774 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -1482,6 +1482,7 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, > > if (__pmd_trans_huge_lock(pmd, vma, &ptl) == 1) { > pmd_t entry; > + ret = 1; > > /* > * Avoid trapping faults against the zero page. The read-only > @@ -1490,11 +1491,10 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, > */ > if (prot_numa && is_huge_zero_pmd(*pmd)) { > spin_unlock(ptl); > - return 0; > + return ret; > } > > if (!prot_numa || !pmd_protnone(*pmd)) { > - ret = 1; > entry = pmdp_get_and_clear_notify(mm, addr, pmd); > entry = pmd_modify(entry, newprot); > ret = HPAGE_PMD_NR; > -- > 2.1.2 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id AA6C47F5D for ; Sat, 7 Mar 2015 14:13:32 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 1AF59AC003 for ; Sat, 7 Mar 2015 12:13:28 -0800 (PST) Received: from mail-ie0-f179.google.com (mail-ie0-f179.google.com [209.85.223.179]) by cuda.sgi.com with ESMTP id IGHpMc3h6I1DPNSQ (version=TLSv1 cipher=RC4-SHA bits=128 verify=NO) for ; Sat, 07 Mar 2015 12:13:27 -0800 (PST) Received: by iery20 with SMTP id y20so678651ier.0 for ; Sat, 07 Mar 2015 12:13:27 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1425741651-29152-2-git-send-email-mgorman@suse.de> References: <1425741651-29152-1-git-send-email-mgorman@suse.de> <1425741651-29152-2-git-send-email-mgorman@suse.de> Date: Sat, 7 Mar 2015 12:13:27 -0800 Message-ID: Subject: Re: [PATCH 1/4] mm: thp: Return the correct value for change_huge_pmd From: Linus Torvalds List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Mel Gorman Cc: Linux Kernel Mailing List , xfs@oss.sgi.com, Linux-MM , Aneesh Kumar , Andrew Morton , ppc-dev , Ingo Molnar Looks obviously correct. The old code was just very wrong. Acked-by: Linus Torvalds Linus On Sat, Mar 7, 2015 at 7:20 AM, Mel Gorman wrote: > The wrong value is being returned by change_huge_pmd since commit > 10c1045f28e8 ("mm: numa: avoid unnecessary TLB flushes when setting > NUMA hinting entries") which allows a fallthrough that tries to adjust > non-existent PTEs. This patch corrects it. > > Signed-off-by: Mel Gorman > --- > mm/huge_memory.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index fc00c8cb5a82..194c0f019774 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -1482,6 +1482,7 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, > > if (__pmd_trans_huge_lock(pmd, vma, &ptl) == 1) { > pmd_t entry; > + ret = 1; > > /* > * Avoid trapping faults against the zero page. The read-only > @@ -1490,11 +1491,10 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, > */ > if (prot_numa && is_huge_zero_pmd(*pmd)) { > spin_unlock(ptl); > - return 0; > + return ret; > } > > if (!prot_numa || !pmd_protnone(*pmd)) { > - ret = 1; > entry = pmdp_get_and_clear_notify(mm, addr, pmd); > entry = pmd_modify(entry, newprot); > ret = HPAGE_PMD_NR; > -- > 2.1.2 > _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f169.google.com (mail-ig0-f169.google.com [209.85.213.169]) by kanga.kvack.org (Postfix) with ESMTP id 113AA6B0038 for ; Sat, 7 Mar 2015 15:13:28 -0500 (EST) Received: by igbhl2 with SMTP id hl2so12048763igb.5 for ; Sat, 07 Mar 2015 12:13:27 -0800 (PST) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com. [2607:f8b0:4001:c03::231]) by mx.google.com with ESMTPS id z12si5132271igu.0.2015.03.07.12.13.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Mar 2015 12:13:27 -0800 (PST) Received: by iecat20 with SMTP id at20so40480933iec.6 for ; Sat, 07 Mar 2015 12:13:27 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1425741651-29152-2-git-send-email-mgorman@suse.de> References: <1425741651-29152-1-git-send-email-mgorman@suse.de> <1425741651-29152-2-git-send-email-mgorman@suse.de> Date: Sat, 7 Mar 2015 12:13:27 -0800 Message-ID: Subject: Re: [PATCH 1/4] mm: thp: Return the correct value for change_huge_pmd From: Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman Cc: Dave Chinner , Andrew Morton , Ingo Molnar , Aneesh Kumar , Linux Kernel Mailing List , Linux-MM , xfs@oss.sgi.com, ppc-dev Looks obviously correct. The old code was just very wrong. Acked-by: Linus Torvalds Linus On Sat, Mar 7, 2015 at 7:20 AM, Mel Gorman wrote: > The wrong value is being returned by change_huge_pmd since commit > 10c1045f28e8 ("mm: numa: avoid unnecessary TLB flushes when setting > NUMA hinting entries") which allows a fallthrough that tries to adjust > non-existent PTEs. This patch corrects it. > > Signed-off-by: Mel Gorman > --- > mm/huge_memory.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index fc00c8cb5a82..194c0f019774 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -1482,6 +1482,7 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, > > if (__pmd_trans_huge_lock(pmd, vma, &ptl) == 1) { > pmd_t entry; > + ret = 1; > > /* > * Avoid trapping faults against the zero page. The read-only > @@ -1490,11 +1491,10 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, > */ > if (prot_numa && is_huge_zero_pmd(*pmd)) { > spin_unlock(ptl); > - return 0; > + return ret; > } > > if (!prot_numa || !pmd_protnone(*pmd)) { > - ret = 1; > entry = pmdp_get_and_clear_notify(mm, addr, pmd); > entry = pmd_modify(entry, newprot); > ret = HPAGE_PMD_NR; > -- > 2.1.2 > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 9451E1A0292 for ; Sun, 8 Mar 2015 07:13:29 +1100 (AEDT) Received: by igdh15 with SMTP id h15so11872001igd.4 for ; Sat, 07 Mar 2015 12:13:27 -0800 (PST) MIME-Version: 1.0 Sender: linus971@gmail.com In-Reply-To: <1425741651-29152-2-git-send-email-mgorman@suse.de> References: <1425741651-29152-1-git-send-email-mgorman@suse.de> <1425741651-29152-2-git-send-email-mgorman@suse.de> Date: Sat, 7 Mar 2015 12:13:27 -0800 Message-ID: Subject: Re: [PATCH 1/4] mm: thp: Return the correct value for change_huge_pmd From: Linus Torvalds To: Mel Gorman Content-Type: text/plain; charset=UTF-8 Cc: Dave Chinner , Linux Kernel Mailing List , xfs@oss.sgi.com, Linux-MM , Aneesh Kumar , Andrew Morton , ppc-dev , Ingo Molnar List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Looks obviously correct. The old code was just very wrong. Acked-by: Linus Torvalds Linus On Sat, Mar 7, 2015 at 7:20 AM, Mel Gorman wrote: > The wrong value is being returned by change_huge_pmd since commit > 10c1045f28e8 ("mm: numa: avoid unnecessary TLB flushes when setting > NUMA hinting entries") which allows a fallthrough that tries to adjust > non-existent PTEs. This patch corrects it. > > Signed-off-by: Mel Gorman > --- > mm/huge_memory.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index fc00c8cb5a82..194c0f019774 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -1482,6 +1482,7 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, > > if (__pmd_trans_huge_lock(pmd, vma, &ptl) == 1) { > pmd_t entry; > + ret = 1; > > /* > * Avoid trapping faults against the zero page. The read-only > @@ -1490,11 +1491,10 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, > */ > if (prot_numa && is_huge_zero_pmd(*pmd)) { > spin_unlock(ptl); > - return 0; > + return ret; > } > > if (!prot_numa || !pmd_protnone(*pmd)) { > - ret = 1; > entry = pmdp_get_and_clear_notify(mm, addr, pmd); > entry = pmd_modify(entry, newprot); > ret = HPAGE_PMD_NR; > -- > 2.1.2 >