From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753628AbdEQReE (ORCPT ); Wed, 17 May 2017 13:34:04 -0400 Received: from mga01.intel.com ([192.55.52.88]:5141 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752632AbdEQReD (ORCPT ); Wed, 17 May 2017 13:34:03 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,355,1491289200"; d="scan'208";a="857927517" Subject: Re: [PATCH 1/2] mm: avoid spurious 'bad pmd' warning messages To: Ross Zwisler , Andrew Morton , linux-kernel@vger.kernel.org References: <20170517171639.14501-1-ross.zwisler@linux.intel.com> Cc: "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 From: Dave Hansen Message-ID: <9c45c769-2f5e-9327-c39e-1df7744fa633@intel.com> Date: Wed, 17 May 2017 10:33:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170517171639.14501-1-ross.zwisler@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?