Message ID | 20241108174505.1214230-10-axboe@kernel.dk (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 DFE9AD64075 for <linux-mm@archiver.kernel.org>; Fri, 8 Nov 2024 17:45:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A27A26B00E3; Fri, 8 Nov 2024 12:45:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9DBDD6B00E5; Fri, 8 Nov 2024 12:45:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84F136B00E6; Fri, 8 Nov 2024 12:45:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 5E5186B00E3 for <linux-mm@kvack.org>; Fri, 8 Nov 2024 12:45:29 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1AA071C3BA5 for <linux-mm@kvack.org>; Fri, 8 Nov 2024 17:45:29 +0000 (UTC) X-FDA: 82763652888.07.566874C Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) by imf01.hostedemail.com (Postfix) with ESMTP id 5F0B740002 for <linux-mm@kvack.org>; Fri, 8 Nov 2024 17:44:58 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=0pGqEBHl; dmarc=none; spf=pass (imf01.hostedemail.com: domain of axboe@kernel.dk designates 209.85.167.181 as permitted sender) smtp.mailfrom=axboe@kernel.dk ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731087867; a=rsa-sha256; cv=none; b=pulVld9bgbEj+7sTfE6/0zzqIbE51uRmhxsmw+sECGfBFdupabmQ1phvpkUMqMw/XcPR2z 1BCc80Ugd3F2IalfEXdJ4mF5RMDqUvLa4N251g+AXh4yj/YAP3ZcFHZBwMsdeW7qs/EbDp HymesXpZCvp/seElWW8qKP9b68ZkWuA= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=0pGqEBHl; dmarc=none; spf=pass (imf01.hostedemail.com: domain of axboe@kernel.dk designates 209.85.167.181 as permitted sender) smtp.mailfrom=axboe@kernel.dk ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731087866; 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=8Os07YYPQ7kZ+kUIdYmg3svY/CQbT8cCz0FxxTNIj/Y=; b=Ujt11bCnppcbs6PPFijgn1cKnT35hvi5LBtpbvN6EbA8b1Zc/vUjhukNwpi6TB37VGKGV4 D18HpsaviCwsxlRlLD3PPWy9RLu4TMQeEfiWobuIPv6/S8+d54FcfK2D6E/3sMmuarJUcV Qa1C13Ngqo07rkVcfRW44ISycw5uinw= Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-3e5f9712991so1354975b6e.2 for <linux-mm@kvack.org>; Fri, 08 Nov 2024 09:45:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1731087926; x=1731692726; 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=8Os07YYPQ7kZ+kUIdYmg3svY/CQbT8cCz0FxxTNIj/Y=; b=0pGqEBHlj6HmTXxFltByEXY2LvAK8bqJh96kaRYyTlIrpNguZ6iucuT1ZvoVeoWFyO BnIckhAjIiTOamohc8niO2HqwPzoRsfbtG691yXMvlRsry7ynNUeDpaOzMb7pX5GNIT0 p/zUYyaB/xFzRySoTLokteXn/Z3G2Jl2pIJZQZo3gqruV2Te+9sGlJuqI+zgVMLY1rcU FFyujmFfoDU8gJ4zEwEG2eo3PRHbCQf1ZKvax7nkloMR9C3j4h72Tj5UXQmbTk0mJDM+ 0056G9COt7ZSt5XuMr3TuzCqNE9cqRD6pTfeOI8HL6p9SvKj0mowhTCa7EHTxbi3wsOx QQJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731087926; x=1731692726; 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=8Os07YYPQ7kZ+kUIdYmg3svY/CQbT8cCz0FxxTNIj/Y=; b=aP1ZkoQEcJjJ+VW1EWx9RZgMfmP7zt5ue3NCaCi5hZlWFuNLQT0qmXrkXbsRc/hRjx r50zXe9nnUWeLaNYgaERoAdlGKdfHtO0clt9ixEOpPriOsVrcyqNDgl33oUuTyjGUvZl 7PioR+0TR+F36DI57oiX5ksQI5eQuF+fT62F43hdnwussHLdx8Fl1CBBc2cGqG6/ByeM Wbq8MoemBqJ2pJfxAlF8P5sMbiGIIfxXXBi3jruBL3FxeJy7E0+ZcuEsSsQk54xkLkXD GYc7GDgD1EWHrBvR1QTQxMommFX8G4RDePvpV6KF9fMtZQ/X5i8lkStDTcfq9aVuQwHT 48yQ== X-Gm-Message-State: AOJu0YzCnjnydzX6nWpmb2mQUwpkN8XdIbyddp8vcCbQ22U5QhRejKoA AIKMIyugQdh54eiigDuPnaZtQBDkLR+WGhJWAQJJIo1ZCGatXyW2nU3B4ST7V5EHTyqpaK8uMBQ H7vE= X-Google-Smtp-Source: AGHT+IEK3I8pTmLVAcP1tiUKABdaXPcTEUhdzcwYlEN/XSWu4cE0qIXfxmg72hsMc3+DTSEsR4vUEg== X-Received: by 2002:a05:6808:120e:b0:3e0:4db9:8c44 with SMTP id 5614622812f47-3e79470a35bmr4931161b6e.27.1731087926068; Fri, 08 Nov 2024 09:45:26 -0800 (PST) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3e78cd28f80sm780969b6e.39.2024.11.08.09.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 09:45:25 -0800 (PST) From: Jens Axboe <axboe@kernel.dk> To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: hannes@cmpxchg.org, clm@meta.com, linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk> Subject: [PATCH 09/13] mm: drop uncached pages when writeback completes Date: Fri, 8 Nov 2024 10:43:32 -0700 Message-ID: <20241108174505.1214230-10-axboe@kernel.dk> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241108174505.1214230-1-axboe@kernel.dk> References: <20241108174505.1214230-1-axboe@kernel.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 5F0B740002 X-Rspamd-Server: rspam11 X-Stat-Signature: metxok9ksrbpxq9hydrw3nhbdaw6f5ud X-HE-Tag: 1731087898-15758 X-HE-Meta: U2FsdGVkX1/LrOGr4wT40G9EscYRpROsguzI+aF8vgq4pIOkYQc3DtURTF2BK0vnm70ubP4m+4fFTuN7muaBNgEoX83ZjPDVwHFeLbEAuGm9nzno/NhP1QoGcTNWFK1YDzb0IQ4X9e3VZYOLzvgET6ND9SPfm4CqmFMLxeYdUXNndifssFvKAdBJy3GQh5shV26XkRY+dPha+rQ5PlPoQjlPursc0UI0sj6pc+bV91FvgXDO2mIW4dknwhktUo7uyP7zq5savFfwfAceTynJeWsGleF7SNw3wW1SxK5a/CVBNj2nH/FrK6kS0PYKMmfzdIs9RJsk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bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
[01/13] mm/filemap: change filemap_create_folio() to take a struct kiocb
|
expand
|
diff --git a/mm/filemap.c b/mm/filemap.c index 6f65025782bb..1e455ca872b5 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1634,6 +1634,18 @@ void folio_end_writeback(struct folio *folio) if (__folio_end_writeback(folio)) folio_wake_bit(folio, PG_writeback); acct_reclaim_writeback(folio); + + /* + * If folio is marked as uncached, then pages should be dropped when + * writeback completes. Do that now. + */ + if (folio_test_uncached(folio)) { + folio_lock(folio); + if (invalidate_complete_folio2(folio->mapping, folio, 0)) + folio_clear_uncached(folio); + folio_unlock(folio); + + } folio_put(folio); } EXPORT_SYMBOL(folio_end_writeback);
If the folio is marked as uncached, drop pages when writeback completes. Intended to be used with RWF_UNCACHED, to avoid needing sync writes for uncached IO. Signed-off-by: Jens Axboe <axboe@kernel.dk> --- mm/filemap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)