From patchwork Thu Nov 14 15:25:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13875224 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 501B6D68B31 for ; Thu, 14 Nov 2024 15:28:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C72B16B00A7; Thu, 14 Nov 2024 10:28:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BF9CF6B00A8; Thu, 14 Nov 2024 10:28:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE8796B00A9; Thu, 14 Nov 2024 10:28:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 8D0D86B00A7 for ; Thu, 14 Nov 2024 10:28:26 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 47ECF1611E2 for ; Thu, 14 Nov 2024 15:28:26 +0000 (UTC) X-FDA: 82785080910.22.D1C4835 Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) by imf08.hostedemail.com (Postfix) with ESMTP id 05E53160006 for ; Thu, 14 Nov 2024 15:27:54 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=pFFE1afw; spf=pass (imf08.hostedemail.com: domain of axboe@kernel.dk designates 209.85.161.45 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731597909; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LL88Qd2tMlsmBvcuEyGfQPoq7EBSjG4mmD1oB3CTmL4=; b=1FWporYNvAYxielTeukCiRB/LN6O4fKMIbsPY5c9Uq+djhDMKpj6aCUOSY1adEvsbzDoHI M3US3i7FGrRNBkbzPMRa9as8blGz8nTtTLXFORppa7L5up4WcStvQFxg1nmPe3mkam4PP4 VkZENicvRxyUk8L80SNCxnDS9uxb2Fc= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=pFFE1afw; spf=pass (imf08.hostedemail.com: domain of axboe@kernel.dk designates 209.85.161.45 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731597909; a=rsa-sha256; cv=none; b=wO8+e8bgdU2wHFyKymBDuMZW1LhqIl9zYKyb2b4ThTIaUt87WbP+AKBjRMiRYqlGYlPD9p G6ewI2jaZaxwkWkQ7PWydkWQSPIsd3Nu9S7GJzMLbkEgJ0gjTXmFY2uKGyX6DQzbmL+eyB n0HYztixvdV5n9R9Tqn0Xg/9Ff2XD10= Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-5ee3c2e79aaso340646eaf.3 for ; Thu, 14 Nov 2024 07:28:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1731598103; x=1732202903; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LL88Qd2tMlsmBvcuEyGfQPoq7EBSjG4mmD1oB3CTmL4=; b=pFFE1afwk4DJM1A0hIM05D4GFTYdCkjvJXT5Bjbf8EZhrbBgN5h0XlJeE1RG17NwJm RHINmuJuIuIWlpXG1rL6590WF56bygGU/A70eZeExARIKpjzZOPs0zrnU8p5/6DJcqHn 3ynl9MFgU/QcsZ+EVtC0n+CMBAhxFc1YohZBNK0x5/JXjJwI248yDmouDa4H0hr4t5Ih 9oVv9R1aeDc0u9gDMuYH/FYve0uOxv+sKGZcGUTVqrzwpwuVwXoKrsX0kvuIgMoVxMAl D8GbS75ZDgYcRVUSgQqbY/hndqqg6luT4mccsf0bOe5fACuE/S6c1uHnySWmsd2TFzm+ sqeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731598103; x=1732202903; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LL88Qd2tMlsmBvcuEyGfQPoq7EBSjG4mmD1oB3CTmL4=; b=LbxeGC7BSm1kjxSEh9GMNuZyD7gpCaUxiVo/hjcn2gSR7Wy8ShBqQ162nZ/oveWdmN ZRACAnS9HVv5T4aVia+5a9bb+4Tum/6cqW+HWdmd+mXLKK9sEbzLvDANOSMsSS0xO64B +b9P+YWBv3P6E7EhRSIfbcJLKK/1psqtBcaTwhmPDPSMH1FDpXI2M2izfXWbxx7tqTLk u2oA2dBbhTw26T8kb3rdjlrkvts1Inl93bjoY5aQAwVQV8Tr+iJgjxWZxEyoINUOmRim ja45vMborg6DxcScWg6dRT4CGF2BPKE2wwKekU9mbzRP+MGEWyk7DT1Ms0q3nG0RnNvb P/4Q== X-Gm-Message-State: AOJu0Yz5KpBZ5CKLJplmlXc6xQBEveKpeZc1AfHGUdpitEDQ1hPl8mt1 2K/XCz/84A1iffyTMeHIJ1u5wPRroy2yQyRZPgUxUnyPWkZ4ILw5F1MS+UYNkKor2EP6R7T8Vyo THUc= X-Google-Smtp-Source: AGHT+IGxBOidvnNn2woru7d3dY6RKyVHYMtr7QGUJGpSzdzZfL3L6KYNggyKAJszR8sQZicyWvWugQ== X-Received: by 2002:a4a:e90e:0:b0:5eb:88a5:20e8 with SMTP id 006d021491bc7-5ee9ecc2c38mr2597677eaf.1.1731598103136; Thu, 14 Nov 2024 07:28:23 -0800 (PST) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5eea026eb41sm368250eaf.39.2024.11.14.07.28.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 07:28:22 -0800 (PST) From: Jens Axboe To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: hannes@cmpxchg.org, clm@meta.com, linux-kernel@vger.kernel.org, willy@infradead.org, kirill@shutemov.name, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, bfoster@redhat.com, Jens Axboe Subject: [PATCH 15/17] xfs: punt uncached write completions to the completion wq Date: Thu, 14 Nov 2024 08:25:19 -0700 Message-ID: <20241114152743.2381672-17-axboe@kernel.dk> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114152743.2381672-2-axboe@kernel.dk> References: <20241114152743.2381672-2-axboe@kernel.dk> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 05E53160006 X-Stat-Signature: 4kd7aftqnizfr91rhmn7q5j71aezua3p X-Rspam-User: X-HE-Tag: 1731598074-118871 X-HE-Meta: U2FsdGVkX1+lxW6os1JAIVDT6g4n60HNiXu58zijtix+wTa2Ke4jHPAQU+4nyGD317cIIKoRSmoua9DPJp//3ajOOTvn1EJuh3kHykHJ3Qr3jXTiUHWIiEYQmGhSBCRPYikmCxiBgzyo/jccbhFUSHPak7tItC1BEt7wiCYuj3mZAv7cFOtRzT+ZCk+kWcC2DDIHpQTTisQaTq2vXmRfr6HcYDIblp2bK9rMoSR0pRAxwMeq6dH1PIYer1N3nYifvTPF3q3jaHtZrtB46e17pU+cZVxphdaGtX1N7voAv6cBiQCS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HoVGcSwRduq41fOF5OQQQItwa+mjXD3p6Dm+f26z3CuYDmaJSquN3Zfp2ZWx X-Bogosity: Ham, tests=bogofilter, spamicity=0.015269, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: They need non-irq context guaranteed, to be able to prune ranges from the page cache. Treat them like unwritten extents and punt them to the completion workqueue. Signed-off-by: Jens Axboe --- fs/xfs/xfs_aops.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 559a3a577097..c86fc2b8f344 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -416,9 +416,12 @@ xfs_prepare_ioend( memalloc_nofs_restore(nofs_flag); - /* send ioends that might require a transaction to the completion wq */ + /* + * Send ioends that might require a transaction or need blocking + * context to the completion wq + */ if (xfs_ioend_is_append(ioend) || ioend->io_type == IOMAP_UNWRITTEN || - (ioend->io_flags & IOMAP_F_SHARED)) + (ioend->io_flags & (IOMAP_F_SHARED|IOMAP_F_UNCACHED))) ioend->io_bio.bi_end_io = xfs_end_bio; return status; }