Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp93153pxj; Mon, 17 May 2021 21:55:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/Ni6pMbeqPD+oJdtLSs2m/bRcyuB1Rs7tCYt7eSYNEW9KUPBw6Ba5vy0fomIoZM0sxvzo X-Received: by 2002:a05:6602:2596:: with SMTP id p22mr2782101ioo.184.1621313752274; Mon, 17 May 2021 21:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621313752; cv=none; d=google.com; s=arc-20160816; b=e8cJ+s+1Q708vY8bExWWH7vieS17qKSFJFId/V6ykhUCU3MHsKODxA7az2jgz85CBX uuMVKlACU3xddVy3j3Dv5Fhtn2frskwRAe8I03EyydxMvW5tltFE3yptjC9ndDeUTN6k rErW9G6+ix32ml/AwapePZqVNjKaWJ2b9qQ0S8yy1VERQl/fDtDGRGl8IZi7+AtvNFfp WAw1wB+rce3CC4ENsSdyH6NbYYUeRYN9hmvrSAg9pktKBYujTxSpE9m8GH5WQ7PBExjL B6aGRJgtSWX1M+peK26wNu1dY9W85zrNKnI9KxCViIOHyIqe4bd8nV/CiWQCxAhPfePz Derw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2d/WrnD1UHBVieluyImYuoaudN5er5pcEaEom+XXblQ=; b=QNHt0YeErlBnoTKcClRyesvFRxmtEHrkIU7PUFGd2BzABg03DFDkMN4xMCa2fKrCdV vm2ozGKxE9F8uKX50ZMgzuzlJzwg9Z/ZoS9AccgmuozuigHA45XwUGTKlWqNjX5gGiGx zOVVuxzvrHIloJsmit8isNlMUYxAjNZ/ihP3IzlKfLROKBYrX+0EEwHLEsck89SKIiFb TJC7W6MXAf7k62jr/SAZHEeiDNK+QVuc2OxssFKTpj+PUFdvnU0Lr9wQKsPsU13sz7vW U+2zsqIzN8mYlKvyQassjT+Oi2NN10ilWAi9QC6mzXhPJt+Zm8FbWaHLn3nfFC0PtTIG Tq9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0NyejkzW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si21939996ilg.93.2021.05.17.21.55.39; Mon, 17 May 2021 21:55:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0NyejkzW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241431AbhEQOpB (ORCPT + 99 others); Mon, 17 May 2021 10:45:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:33944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240996AbhEQOhT (ORCPT ); Mon, 17 May 2021 10:37:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ABDB8613F1; Mon, 17 May 2021 14:17:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261056; bh=ElAI1XIwd537DNiT1qmQQpEfJEPAdz4B6MeTU+xLgvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0NyejkzW2wMU9tM/b5aGF/gTFpjmN7jtpC34XwCcbxGIQxAixGm1x0zVBbPNd1w5f QeFuDyxs7ghJPvdFtKlJ073a4k+JvHqZF/ICPm0So0myz4vbyKJJ+Nh+2TlluWGww/ JZVZs+tfJiq+Y/sypuJqyS2Am9Zf+Y/1XGBWN4vo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Greg Kurz , Jan Kara , Dan Williams , Vivek Goyal , Sasha Levin Subject: [PATCH 5.12 281/363] dax: Add a wakeup mode parameter to put_unlocked_entry() Date: Mon, 17 May 2021 16:02:27 +0200 Message-Id: <20210517140312.115071359@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vivek Goyal [ Upstream commit 4c3d043d271d4d629aa2328796cdfc96b37d3b3c ] As of now put_unlocked_entry() always wakes up next waiter. In next patches we want to wake up all waiters at one callsite. Hence, add a parameter to the function. This patch does not introduce any change of behavior. Reviewed-by: Greg Kurz Reviewed-by: Jan Kara Suggested-by: Dan Williams Signed-off-by: Vivek Goyal Link: https://lore.kernel.org/r/20210428190314.1865312-3-vgoyal@redhat.com Signed-off-by: Dan Williams Signed-off-by: Sasha Levin --- fs/dax.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 5ecee51c44ee..56eb1c759ca5 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -275,11 +275,11 @@ static void wait_entry_unlocked(struct xa_state *xas, void *entry) finish_wait(wq, &ewait.wait); } -static void put_unlocked_entry(struct xa_state *xas, void *entry) +static void put_unlocked_entry(struct xa_state *xas, void *entry, + enum dax_wake_mode mode) { - /* If we were the only waiter woken, wake the next one */ if (entry && !dax_is_conflict(entry)) - dax_wake_entry(xas, entry, WAKE_NEXT); + dax_wake_entry(xas, entry, mode); } /* @@ -633,7 +633,7 @@ struct page *dax_layout_busy_page_range(struct address_space *mapping, entry = get_unlocked_entry(&xas, 0); if (entry) page = dax_busy_page(entry); - put_unlocked_entry(&xas, entry); + put_unlocked_entry(&xas, entry, WAKE_NEXT); if (page) break; if (++scanned % XA_CHECK_SCHED) @@ -675,7 +675,7 @@ static int __dax_invalidate_entry(struct address_space *mapping, mapping->nrexceptional--; ret = 1; out: - put_unlocked_entry(&xas, entry); + put_unlocked_entry(&xas, entry, WAKE_NEXT); xas_unlock_irq(&xas); return ret; } @@ -954,7 +954,7 @@ static int dax_writeback_one(struct xa_state *xas, struct dax_device *dax_dev, return ret; put_unlocked: - put_unlocked_entry(xas, entry); + put_unlocked_entry(xas, entry, WAKE_NEXT); return ret; } @@ -1695,7 +1695,7 @@ dax_insert_pfn_mkwrite(struct vm_fault *vmf, pfn_t pfn, unsigned int order) /* Did we race with someone splitting entry or so? */ if (!entry || dax_is_conflict(entry) || (order == 0 && !dax_is_pte_entry(entry))) { - put_unlocked_entry(&xas, entry); + put_unlocked_entry(&xas, entry, WAKE_NEXT); xas_unlock_irq(&xas); trace_dax_insert_pfn_mkwrite_no_entry(mapping->host, vmf, VM_FAULT_NOPAGE); -- 2.30.2