From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3A2771A0034 for ; Tue, 2 Dec 2014 18:31:58 +1100 (AEDT) Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 2 Dec 2014 17:31:56 +1000 Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 9A7323578056 for ; Tue, 2 Dec 2014 18:31:53 +1100 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sB27Vrtg37093478 for ; Tue, 2 Dec 2014 18:31:53 +1100 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sB27VqLg020262 for ; Tue, 2 Dec 2014 18:31:53 +1100 From: "Aneesh Kumar K.V" To: Benjamin Herrenschmidt , Mel Gorman Subject: Re: [PATCH 03/10] mm: Convert p[te|md]_numa users to p[te|md]_protnone_numa In-Reply-To: <1417473849.7182.9.camel@kernel.crashing.org> References: <1416578268-19597-1-git-send-email-mgorman@suse.de> <1416578268-19597-4-git-send-email-mgorman@suse.de> <1417473849.7182.9.camel@kernel.crashing.org> Date: Tue, 02 Dec 2014 13:01:29 +0530 Message-ID: <87h9xeh5im.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Cc: Rik van Riel , Linus Torvalds , Hugh Dickins , Linux Kernel , Linux-MM , Ingo Molnar , Paul Mackerras , 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: , Benjamin Herrenschmidt writes: > On Fri, 2014-11-21 at 13:57 +0000, Mel Gorman wrote: >> void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, >> pte_t pte) >> { >> -#ifdef CONFIG_DEBUG_VM >> - WARN_ON(pte_val(*ptep) & _PAGE_PRESENT); >> -#endif >> + /* >> + * When handling numa faults, we already have the pte marked >> + * _PAGE_PRESENT, but we can be sure that it is not in hpte. >> + * Hence we can use set_pte_at for them. >> + */ >> + VM_WARN_ON((pte_val(*ptep) & (_PAGE_PRESENT | _PAGE_USER)) == >> + (_PAGE_PRESENT | _PAGE_USER)); >> + > > His is that going to fare with set_pte_at() called for kernel pages ? > Yes, we won't capture those errors now. But is there any other debug check i could use to capture the wrong usage of set_pte_at ? -aneesh From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by kanga.kvack.org (Postfix) with ESMTP id B97846B0069 for ; Tue, 2 Dec 2014 02:32:04 -0500 (EST) Received: by mail-pa0-f46.google.com with SMTP id lj1so12820956pab.19 for ; Mon, 01 Dec 2014 23:32:04 -0800 (PST) Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com. [202.81.31.141]) by mx.google.com with ESMTPS id hq2si32515717pac.2.2014.12.01.23.32.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 23:32:03 -0800 (PST) Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 2 Dec 2014 17:31:57 +1000 Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 24FE42CE802D for ; Tue, 2 Dec 2014 18:31:53 +1100 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sB27VqE333226962 for ; Tue, 2 Dec 2014 18:31:53 +1100 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sB27VqLa020262 for ; Tue, 2 Dec 2014 18:31:52 +1100 From: "Aneesh Kumar K.V" Subject: Re: [PATCH 03/10] mm: Convert p[te|md]_numa users to p[te|md]_protnone_numa In-Reply-To: <1417473849.7182.9.camel@kernel.crashing.org> References: <1416578268-19597-1-git-send-email-mgorman@suse.de> <1416578268-19597-4-git-send-email-mgorman@suse.de> <1417473849.7182.9.camel@kernel.crashing.org> Date: Tue, 02 Dec 2014 13:01:29 +0530 Message-ID: <87h9xeh5im.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: Benjamin Herrenschmidt , Mel Gorman Cc: Linux Kernel , Linux-MM , LinuxPPC-dev , Hugh Dickins , Dave Jones , Rik van Riel , Ingo Molnar , Kirill Shutemov , Sasha Levin , Paul Mackerras , Linus Torvalds Benjamin Herrenschmidt writes: > On Fri, 2014-11-21 at 13:57 +0000, Mel Gorman wrote: >> void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, >> pte_t pte) >> { >> -#ifdef CONFIG_DEBUG_VM >> - WARN_ON(pte_val(*ptep) & _PAGE_PRESENT); >> -#endif >> + /* >> + * When handling numa faults, we already have the pte marked >> + * _PAGE_PRESENT, but we can be sure that it is not in hpte. >> + * Hence we can use set_pte_at for them. >> + */ >> + VM_WARN_ON((pte_val(*ptep) & (_PAGE_PRESENT | _PAGE_USER)) == >> + (_PAGE_PRESENT | _PAGE_USER)); >> + > > His is that going to fare with set_pte_at() called for kernel pages ? > Yes, we won't capture those errors now. But is there any other debug check i could use to capture the wrong usage of set_pte_at ? -aneesh -- 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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754441AbaLBHcB (ORCPT ); Tue, 2 Dec 2014 02:32:01 -0500 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:38786 "EHLO e23smtp09.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751110AbaLBHb7 (ORCPT ); Tue, 2 Dec 2014 02:31:59 -0500 From: "Aneesh Kumar K.V" To: Benjamin Herrenschmidt , Mel Gorman Cc: Linux Kernel , Linux-MM , LinuxPPC-dev , Hugh Dickins , Dave Jones , Rik van Riel , Ingo Molnar , Kirill Shutemov , Sasha Levin , Paul Mackerras , Linus Torvalds Subject: Re: [PATCH 03/10] mm: Convert p[te|md]_numa users to p[te|md]_protnone_numa In-Reply-To: <1417473849.7182.9.camel@kernel.crashing.org> References: <1416578268-19597-1-git-send-email-mgorman@suse.de> <1416578268-19597-4-git-send-email-mgorman@suse.de> <1417473849.7182.9.camel@kernel.crashing.org> User-Agent: Notmuch/0.19+2~g32855b9 (http://notmuchmail.org) Emacs/25.0.50.1 (x86_64-pc-linux-gnu) Date: Tue, 02 Dec 2014 13:01:29 +0530 Message-ID: <87h9xeh5im.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14120207-0033-0000-0000-000000A5C987 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Benjamin Herrenschmidt writes: > On Fri, 2014-11-21 at 13:57 +0000, Mel Gorman wrote: >> void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, >> pte_t pte) >> { >> -#ifdef CONFIG_DEBUG_VM >> - WARN_ON(pte_val(*ptep) & _PAGE_PRESENT); >> -#endif >> + /* >> + * When handling numa faults, we already have the pte marked >> + * _PAGE_PRESENT, but we can be sure that it is not in hpte. >> + * Hence we can use set_pte_at for them. >> + */ >> + VM_WARN_ON((pte_val(*ptep) & (_PAGE_PRESENT | _PAGE_USER)) == >> + (_PAGE_PRESENT | _PAGE_USER)); >> + > > His is that going to fare with set_pte_at() called for kernel pages ? > Yes, we won't capture those errors now. But is there any other debug check i could use to capture the wrong usage of set_pte_at ? -aneesh