Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2370217ybi; Thu, 4 Jul 2019 09:42:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwbXR+apaXOIncPF1YYbq3Yu9HCPkX0AzhBE5vCyfPgi7A7Lrj6khffnWKh4fD7EMM0kWu X-Received: by 2002:a17:902:846:: with SMTP id 64mr50421478plk.265.1562258575973; Thu, 04 Jul 2019 09:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562258575; cv=none; d=google.com; s=arc-20160816; b=PDcOur6+i0nMsse/bJuJ22ntUYCu7RHQgEng7pRb3+AbTwFqycNczXLrbvKltMB+4Q kG5vOVH1yK85J/4M1VpZjP9o8KQiF1EzASFssZrDOvNUBM+o5fZ33a1VlSNLP5iuZdUU bvMNOeqh/YzKUVfLnlqlZoMLWEGzK413ZWJx1fhGpNnEnFnLxnbpn6BnmWjIYOeuT5Xq 3u+3YpEtlgwkcS2fR4ZPlNFSn25p/8u7cYnlX/AYO9y0fjTSb6o5AQN28MEl/3ftguwe p4ZRoPVfwg0aRMx3dskUH+lLaQOKlz3IJfsCQ0hp7nBN+hRevfPsFMZsciDNRdV08RgS IhWA== 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; bh=prVCBlwNxqqzRLibf5FOMZPSB4pO7DWGHfbJJZSDfQY=; b=IotXgWz/Q26EYvhdX98XtOZBBaOKgPbo5qqTl2V6GV4kzI81KyOdF0bWjMzvRaEBOy 5k6ZVDHfBaXY4V8B1PXrt24U05Ci5fUNVayZQZg7ulXRykHtTV80QP0xHMBqNDLqESVo 8J4V9M7fSGrihdOF01+L5GHJ3oV/g9RdZH7bU68CRgftvzIfEpt0hq3+cqPyBAV0pGWI T9Cn3W982M6jFEXDugmMTytSyjwsyLm9EkfUpN4INRULgB9Zft9S7feLfO4XuzlEHP/u ySZQar2wqWtsUc0sgazJJFj10vLP5T8LXL8n7fwUNOYI8K4+hNZJhxfC2cOeYqLeehMP 6dUg== ARC-Authentication-Results: i=1; mx.google.com; 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 n18si5576945plp.215.2019.07.04.09.42.40; Thu, 04 Jul 2019 09:42:55 -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; 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 S1727304AbfGDQki (ORCPT + 99 others); Thu, 4 Jul 2019 12:40:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:40190 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726880AbfGDQki (ORCPT ); Thu, 4 Jul 2019 12:40:38 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F0586AEF5; Thu, 4 Jul 2019 16:40:36 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 936671E3F56; Thu, 4 Jul 2019 18:40:36 +0200 (CEST) Date: Thu, 4 Jul 2019 18:40:36 +0200 From: Jan Kara To: Matthew Wilcox Cc: Jan Kara , 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: <20190704164036.GG31037@quack2.suse.cz> References: <20190627195948.GB4286@bombadil.infradead.org> <20190629160336.GB1180@bombadil.infradead.org> <20190630152324.GA15900@bombadil.infradead.org> <20190701121119.GE31621@quack2.suse.cz> <20190703154700.GI1729@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190703154700.GI1729@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 03-07-19 08:47:00, Matthew Wilcox wrote: > 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); > - } Mostly yes. > 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. Ah, I have misinterpretted what xas_find_conflict() does. I'm sorry for the noise. I find it somewhat unfortunate that xas_find_conflict() will not return in any way the index where it has found the conflicting entry. We could then use it for the wait logic as well and won't have to resort to some masking tricks... Honza -- Jan Kara SUSE Labs, CR