From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EB34821A16EED for ; Wed, 17 May 2017 11:23:10 -0700 (PDT) Date: Wed, 17 May 2017 12:23:09 -0600 From: Ross Zwisler Subject: Re: [PATCH 1/2] mm: avoid spurious 'bad pmd' warning messages Message-ID: <20170517182309.GA30704@linux.intel.com> References: <20170517171639.14501-1-ross.zwisler@linux.intel.com> <9c45c769-2f5e-9327-c39e-1df7744fa633@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9c45c769-2f5e-9327-c39e-1df7744fa633@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Dave Hansen Cc: Jan Kara , Andrew Morton , "Darrick J. Wong" , Matthew Wilcox , linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-mm@kvack.org, Alexander Viro , linux-fsdevel@vger.kernel.org, Eryu Guan , Christoph Hellwig , "Kirill A . Shutemov" , linux-nvdimm@lists.01.org List-ID: On Wed, May 17, 2017 at 10:33:58AM -0700, Dave Hansen wrote: > On 05/17/2017 10:16 AM, Ross Zwisler wrote: > > @@ -3061,7 +3061,7 @@ static int pte_alloc_one_map(struct vm_fault *vmf) > > * through an atomic read in C, which is what pmd_trans_unstable() > > * provides. > > */ > > - if (pmd_trans_unstable(vmf->pmd) || pmd_devmap(*vmf->pmd)) > > + if (pmd_devmap(*vmf->pmd) || pmd_trans_unstable(vmf->pmd)) > > return VM_FAULT_NOPAGE; > > I'm worried we are very unlikely to get this right in the future. It's > totally not obvious what the ordering requirement is here. > > Could we move pmd_devmap() and pmd_trans_unstable() into a helper that > gets the ordering right and also spells out the ordering requirement? Sure, I'll fix this for v2. Thanks for the review. _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754804AbdEQSXN (ORCPT ); Wed, 17 May 2017 14:23:13 -0400 Received: from mga04.intel.com ([192.55.52.120]:37470 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753244AbdEQSXL (ORCPT ); Wed, 17 May 2017 14:23:11 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,355,1491289200"; d="scan'208";a="1149051346" Date: Wed, 17 May 2017 12:23:09 -0600 From: Ross Zwisler To: Dave Hansen Cc: Ross Zwisler , Andrew Morton , linux-kernel@vger.kernel.org, "Darrick J. Wong" , Alexander Viro , Christoph Hellwig , Dan Williams , Jan Kara , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@ml01.01.org, "Kirill A . Shutemov" , Pawel Lebioda , Dave Jiang , Xiong Zhou , Eryu Guan , stable@vger.kernel.org Subject: Re: [PATCH 1/2] mm: avoid spurious 'bad pmd' warning messages Message-ID: <20170517182309.GA30704@linux.intel.com> Mail-Followup-To: Ross Zwisler , Dave Hansen , Andrew Morton , linux-kernel@vger.kernel.org, "Darrick J. Wong" , Alexander Viro , Christoph Hellwig , Dan Williams , Jan Kara , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, "Kirill A . Shutemov" , Pawel Lebioda , Dave Jiang , Xiong Zhou , Eryu Guan , stable@vger.kernel.org References: <20170517171639.14501-1-ross.zwisler@linux.intel.com> <9c45c769-2f5e-9327-c39e-1df7744fa633@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9c45c769-2f5e-9327-c39e-1df7744fa633@intel.com> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 17, 2017 at 10:33:58AM -0700, Dave Hansen wrote: > On 05/17/2017 10:16 AM, Ross Zwisler wrote: > > @@ -3061,7 +3061,7 @@ static int pte_alloc_one_map(struct vm_fault *vmf) > > * through an atomic read in C, which is what pmd_trans_unstable() > > * provides. > > */ > > - if (pmd_trans_unstable(vmf->pmd) || pmd_devmap(*vmf->pmd)) > > + if (pmd_devmap(*vmf->pmd) || pmd_trans_unstable(vmf->pmd)) > > return VM_FAULT_NOPAGE; > > I'm worried we are very unlikely to get this right in the future. It's > totally not obvious what the ordering requirement is here. > > Could we move pmd_devmap() and pmd_trans_unstable() into a helper that > gets the ordering right and also spells out the ordering requirement? Sure, I'll fix this for v2. Thanks for the review. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 17 May 2017 12:23:09 -0600 From: Ross Zwisler To: Dave Hansen Cc: Ross Zwisler , Andrew Morton , linux-kernel@vger.kernel.org, "Darrick J. Wong" , Alexander Viro , Christoph Hellwig , Dan Williams , Jan Kara , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, "Kirill A . Shutemov" , Pawel Lebioda , Dave Jiang , Xiong Zhou , Eryu Guan , stable@vger.kernel.org Subject: Re: [PATCH 1/2] mm: avoid spurious 'bad pmd' warning messages Message-ID: <20170517182309.GA30704@linux.intel.com> References: <20170517171639.14501-1-ross.zwisler@linux.intel.com> <9c45c769-2f5e-9327-c39e-1df7744fa633@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9c45c769-2f5e-9327-c39e-1df7744fa633@intel.com> Sender: owner-linux-mm@kvack.org List-ID: On Wed, May 17, 2017 at 10:33:58AM -0700, Dave Hansen wrote: > On 05/17/2017 10:16 AM, Ross Zwisler wrote: > > @@ -3061,7 +3061,7 @@ static int pte_alloc_one_map(struct vm_fault *vmf) > > * through an atomic read in C, which is what pmd_trans_unstable() > > * provides. > > */ > > - if (pmd_trans_unstable(vmf->pmd) || pmd_devmap(*vmf->pmd)) > > + if (pmd_devmap(*vmf->pmd) || pmd_trans_unstable(vmf->pmd)) > > return VM_FAULT_NOPAGE; > > I'm worried we are very unlikely to get this right in the future. It's > totally not obvious what the ordering requirement is here. > > Could we move pmd_devmap() and pmd_trans_unstable() into a helper that > gets the ordering right and also spells out the ordering requirement? Sure, I'll fix this for v2. Thanks for the review. -- 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