Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2787488ybg; Mon, 28 Oct 2019 02:21:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjoJW2V49Cv/DjcyZJpVGOapSXpj6+OouiuJ0xq54jVcUjLzKVBswQsBtTJO/ZKuevCgja X-Received: by 2002:a50:959a:: with SMTP id w26mr18272819eda.214.1572254505848; Mon, 28 Oct 2019 02:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572254505; cv=none; d=google.com; s=arc-20160816; b=oxogtAPpG4FtYyKtMHssewTgVmK8JBEIjExeOO0KuWYAyE0oHiDKCy39nvdySGPCHb fdAZ99RDcdQjCsX6ewFYqR4BJiooHw76QPXCFjm6hbMI8VXovfHh3DuMbGxkSSxyyMLF ro7KtPPv7hE23OlKPin7LvFjF26ER2JAOmS+/2jwL/e69FTFvdyFT7uPjiQYJ+ZaZYOx XgDTwn1XlYHStwWjLM+T6x67FEkA0vWIhIiAdG/SHpqpoDlM5girGXnI5qoaxEXIpYK7 Mz228epvcq4NANgk3cLu+KtO4PzXkOtWjzBKwSy4C7tUHirnWtc2GS0o49Zkaj82m4SV d1bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=73RwHMf9CQqAfAv2xG2i5xXHlzugD04cKdflPWVTtaA=; b=VbMwdWU+weEufNaVU6KdJz+p8sbBoHgnnj+OTyUXsfzBe9U9nqqEftlBEvU6ROtFjl e1Qk2HjiCNpmlKtS2sk0yhfNA7+GOoLJuH7y1P+xacCqSJDHu7IwX34eef178FzcfSAF ALBjuNdatmoM6KLpMEAslgYt2a/cSKFqi0CHgV835v5VjFprWBV7RMnaF38N9beHeEaK kZK47Mh4l7omXdX99rsuXwKYAAL0QDqOolq2EfmFl0UjOszHqpHHFFbooZ3KXeW+4jWs Ed/cPK7jc5PYo986qvkd+NnfuszP/+DCYcffgCGGTgDL/UfmT+55PHv1+bZ2dMq0IYBw u8vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=x6j89u02; 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 y15si4129683ejw.155.2019.10.28.02.21.22; Mon, 28 Oct 2019 02:21:45 -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=pass header.i=@kernel.org header.s=default header.b=x6j89u02; 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 S1732658AbfJ0VZG (ORCPT + 99 others); Sun, 27 Oct 2019 17:25:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:46774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731619AbfJ0VZE (ORCPT ); Sun, 27 Oct 2019 17:25:04 -0400 Received: from localhost (100.50.158.77.rev.sfr.net [77.158.50.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B1B7321D7F; Sun, 27 Oct 2019 21:25:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572211503; bh=RZe3x2QMnBMoUTrxlqdl+QyaKmXRYQA/663XzT4czy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x6j89u02drSPV0ayy2LyGIJ28Qw5yi9txB8YKSeLJFpsGpHL9gli61q+z67omVThK f7SjqoahDHBlpc4JPIEdJFqyjf463/P+9k28Cfemgr/oIlWjnEOytMEcHuzXQ17RPF JmNoY08+uH/+wpVtQ1GAo/YhqRlqjv84NpLJZnXU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeff Smits , Doug Nelson , Jan Kara , Jeff Moyer , "Matthew Wilcox (Oracle)" , Johannes Thumshirn , Dan Williams Subject: [PATCH 5.3 172/197] fs/dax: Fix pmd vs pte conflict detection Date: Sun, 27 Oct 2019 22:01:30 +0100 Message-Id: <20191027203404.171724171@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191027203351.684916567@linuxfoundation.org> References: <20191027203351.684916567@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Williams commit 6370740e5f8ef12de7f9a9bf48a0393d202cd827 upstream. Users reported a v5.3 performance regression and inability to establish huge page mappings. A revised version of the ndctl "dax.sh" huge page unit test identifies commit 23c84eb78375 "dax: Fix missed wakeup with PMD faults" as the source. Update get_unlocked_entry() to check for NULL entries before checking the entry order, otherwise NULL is misinterpreted as a present pte conflict. The 'order' check needs to happen before the locked check as an unlocked entry at the wrong order must fallback to lookup the correct order. Reported-by: Jeff Smits Reported-by: Doug Nelson Cc: Fixes: 23c84eb78375 ("dax: Fix missed wakeup with PMD faults") Reviewed-by: Jan Kara Cc: Jeff Moyer Cc: Matthew Wilcox (Oracle) Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/157167532455.3945484.11971474077040503994.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- fs/dax.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/fs/dax.c +++ b/fs/dax.c @@ -220,10 +220,11 @@ static void *get_unlocked_entry(struct x for (;;) { entry = xas_find_conflict(xas); + if (!entry || WARN_ON_ONCE(!xa_is_value(entry))) + return entry; if (dax_entry_order(entry) < order) return XA_RETRY_ENTRY; - if (!entry || WARN_ON_ONCE(!xa_is_value(entry)) || - !dax_is_locked(entry)) + if (!dax_is_locked(entry)) return entry; wq = dax_entry_waitqueue(xas, entry, &ewait.key);