Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1057507ybi; Wed, 3 Jul 2019 08:48:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYy/Cdmpstq9m1B1l9bljVtR11htCkk2+iGgRWAdo8I6wEiWpqJz/MrGuqSYmpfF4c+9b1 X-Received: by 2002:a65:4808:: with SMTP id h8mr15078436pgs.22.1562168897701; Wed, 03 Jul 2019 08:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562168897; cv=none; d=google.com; s=arc-20160816; b=d25maZD+U5jekieXaADPRLzOEC40aAcNACDnHn7awW4Cv4u3zhFjkCXvXAuHoBGP8J KXLjgC1VjfJBmq8GNnMx9m00dT/9eSkM2YaoQm4ooqkIe1ruejntufrGZrnnKCJC2RD4 rzX4NDP4ioW2Vw8mlY+uh0u66BIF1DNJ/Sn2kxgX4+QCm9meDP7isJCPW2TGR/oyGeGW M7EKth9ksS1MzJyoWux5TeHYCuwEV+waDjsIyoXLupquYWzajsWyU6EwiMaLGNX60OYf HE0my0jIGQB/uNPuGca6PRLveiOO/6VvRYO0a5tFjPIvw3BxK4TlrjVfRpHFsWgVxheL Rexw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=c5kOloQ+WKclVgeWbSMLX2CoWuvmPxmxrcEhF8nzqns=; b=xI5hJoqj9K85CAtJaVDI08MqlqHccpSkIEKmCrW43foiwRfJDg5BGBFGFQjGtVMCqA z5c/bUAg+vmRgwawUsdhqoNxcdkEMLW8jWcATNMfOPxLaSwQEJAx/2gKlgmhSSS93FR3 dOPvOKbu/RMqVmVhfzoBiTWpBwqXuQDCIw2hEhK0nD8C2NJgsyViyt8qHKUttA+PcyFo LsLsSpxODOVbPivRg5kRmZMui8wFg7MDjLSdkFyTxxxcS3SDpCoeY4GqBo97AlZWjsdF EYwgMlIiwcW5exr0+zeqj0lOumxK2tZyHkRlmy63Ds9q54A6n5UTnuLS5eCV6p0DLf/8 vz4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HV+JnjgF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m15si2747828pff.267.2019.07.03.08.48.02; Wed, 03 Jul 2019 08:48:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HV+JnjgF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726986AbfGCPrE (ORCPT + 99 others); Wed, 3 Jul 2019 11:47:04 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46780 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbfGCPrD (ORCPT ); Wed, 3 Jul 2019 11:47:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=c5kOloQ+WKclVgeWbSMLX2CoWuvmPxmxrcEhF8nzqns=; b=HV+JnjgFvWKjV4CCm3LWNei+D dUQKdFpMgH9c7rrzBjIXKkcJmHfgvDLB/WAqpvJ85YhAxls3FjsnA0ioLob9VZbnQQJbtcq2/fkgL oswHKQkgdurqbO1Lecz3uaI0H1QfUF93Gmia3dxrNobIbd+5s5Hmt2PyB2S+Uo3EgYdV9UMC6BR5h uWqfZOlarNzVMFxAFe9LAZVBzLVAMWnzYhg5OI7sbYmYdFyV2+nCogciXfogxQNahbsmIayIytAyg w2cjhCNkefcxaW6b9xkLQoMDP/TBLkKdwn0YSfYiXuaLYFvPrq9QgRlCaBW11Tr3+Q4EBFRoQbyw3 qcfPIWf3A==; Received: from willy by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hihTJ-0000Vu-0v; Wed, 03 Jul 2019 15:47:01 +0000 Date: Wed, 3 Jul 2019 08:47:00 -0700 From: Matthew Wilcox To: Jan Kara Cc: Dan Williams , Seema Pandit , linux-nvdimm , Linux Kernel Mailing List , stable , Robert Barror , linux-fsdevel Subject: Re: [PATCH] filesystem-dax: Disable PMD support Message-ID: <20190703154700.GI1729@bombadil.infradead.org> References: <20190627195948.GB4286@bombadil.infradead.org> <20190629160336.GB1180@bombadil.infradead.org> <20190630152324.GA15900@bombadil.infradead.org> <20190701121119.GE31621@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190701121119.GE31621@quack2.suse.cz> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 01, 2019 at 02:11:19PM +0200, Jan Kara wrote: > BTW, looking into the xarray code, I think I found another difference > between the old radix tree code and the new xarray code that could cause > issues. In the old radix tree code if we tried to insert PMD entry but > there was some PTE entry in the covered range, we'd get EEXIST error back > and the DAX fault code relies on this. I don't see how similar behavior is > achieved by xas_store()... Are you referring to this? - entry = dax_make_locked(0, size_flag | DAX_EMPTY); - - err = __radix_tree_insert(&mapping->i_pages, index, - dax_entry_order(entry), entry); - radix_tree_preload_end(); - if (err) { - xa_unlock_irq(&mapping->i_pages); - /* - * Our insertion of a DAX entry failed, most likely - * because we were inserting a PMD entry and it - * collided with a PTE sized entry at a different - * index in the PMD range. We haven't inserted - * anything into the radix tree and have no waiters to - * wake. - */ - return ERR_PTR(err); - } If so, that can't happen any more because we no longer drop the i_pages lock while the entry is NULL, so the entry is always locked while the i_pages lock is dropped.