From patchwork Mon Nov 11 23:37:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13871486 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 25CACD3ABFA for ; Mon, 11 Nov 2024 23:48:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A94DC6B00D8; Mon, 11 Nov 2024 18:48:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A3F666B00D9; Mon, 11 Nov 2024 18:48:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8942E6B00DA; Mon, 11 Nov 2024 18:48:55 -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 523E66B00D8 for ; Mon, 11 Nov 2024 18:48:55 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1388DADA84 for ; Mon, 11 Nov 2024 23:48:55 +0000 (UTC) X-FDA: 82775455728.10.B332522 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by imf18.hostedemail.com (Postfix) with ESMTP id 170F61C0022 for ; Mon, 11 Nov 2024 23:48:34 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=eP5y1qmR; dmarc=none; spf=pass (imf18.hostedemail.com: domain of axboe@kernel.dk designates 209.85.210.178 as permitted sender) smtp.mailfrom=axboe@kernel.dk ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731368871; a=rsa-sha256; cv=none; b=GVClNtgyHVqbxuCp022cI1LEcyuIOsrYuxC9yiduwyHh8pwifb37zWFQumeBdL3gbS0BQu 39i6dR/jZTNSxxqDXChOb4bq5Ym4aq4v92gaIWI85ERVuBSJCrXyZ1woHJai6eOC+qYMhn ZeiYTKiHHZykMyhfKNV9Rn/X3PnJcyY= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=eP5y1qmR; dmarc=none; spf=pass (imf18.hostedemail.com: domain of axboe@kernel.dk designates 209.85.210.178 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=1731368871; 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=9QDQ8u+XOjRX6rdX1KxWEpFxXqQ9HPCp5iTXnKjwIis=; b=2S5dzN+CHZy92Gak4wZiSFku562bpHqoYP1rU9jQdNP17215THwGr6QQDeoWh33b2AbL7D DDWMWCgWklJYZUf2tiwJQXAueQQWzD09U83vP3jinnLTLC3kU8L1qRIl9+7URSNtJ8oONV S1OJppK7IjmMUuT1RNUyVRRNZkngLEo= Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-723f37dd76cso5168963b3a.0 for ; Mon, 11 Nov 2024 15:48:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1731368932; x=1731973732; 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=9QDQ8u+XOjRX6rdX1KxWEpFxXqQ9HPCp5iTXnKjwIis=; b=eP5y1qmRuKv6evfWg17wzEOhk0Zc2269oT/R9mhViVmI6iOnfUV6dvcFI4mvqxJUl/ wPKZtqCP8tC3iKBudzYOpRH2EInMhKiF4aYBGazgomfmfZj2tsTZkebCmHeGXNWtuLTF ESL2msQT3VwoAcjbFRnxAUYaICLarRNqtO7wXjnkuJTbDI/gw5taBnra76bDnYOyIkrS 0tdxVqqBCt4W9Im/aJvd0AmzullVb1VdBMHAx9SkXlV27uucmde0Ovm5o6IeNAWgE0lS 3w5bnKvZ7OGyfs9RpfPkeVjEFcJ9DV1CcaFDU8MSaIL6ndFeYnuCX0Y+dp1zDqSMXPhu JDRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731368932; x=1731973732; 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=9QDQ8u+XOjRX6rdX1KxWEpFxXqQ9HPCp5iTXnKjwIis=; b=tvEaoF6XWH+DDXpVfiiyn5bG/Kk2DKR99nJb2NYJDMGNQyBGrtkxNzTCO3EhE0770/ K/IJuZBqcVHMTG1/IST41XSzDgf4GaNQmytCzaUuNN80t6Po+npFnlnVvnoezlRxriIY D+W4Qqb79gMV27iO1AhOfmnGk5giPbggXlkv13sNZTpObDMTf46YC4JYN/o2sY98aCnu j2FTdJ7slhxk2V9lZtsbgzpWevsYs4KnlC5mcvOW1Nw0B5wyRyeiOPKc6wX/gy5O7iea ALVxVP2L+sGiXfMuxTSYoBS2727CNHUPU2lX6ndbKj1veBX3thCV+HxA7lr/oUyDS3R6 ZNCA== X-Gm-Message-State: AOJu0YyjUioeE3qq1litv1Mnij2J+5UGc3EOXT9kPDJmsQXTxR29KGK1 0gfSsGp3HlXAKFnfIkRrxbjU8LS0OpF4+pVyNrkbZZrN/1lZx7vygKAqRq3DEGDIJOTlBT43JSW +Mh4= X-Google-Smtp-Source: AGHT+IH9/1Olbxn3KTdIUuB7+y6iPc85Xc8pyUcg5cMVAU1yzHvt71d7cxX7HqTkOKWntgPA3yDsaw== X-Received: by 2002:a05:6a00:2e99:b0:71e:4ee1:6d79 with SMTP id d2e1a72fcca58-724132749f9mr20118106b3a.2.1731368931568; Mon, 11 Nov 2024 15:48:51 -0800 (PST) Received: from localhost.localdomain ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724078a7ee9sm10046057b3a.64.2024.11.11.15.48.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 15:48:50 -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, Jens Axboe Subject: [PATCH 03/16] mm: add PG_uncached page flag Date: Mon, 11 Nov 2024 16:37:30 -0700 Message-ID: <20241111234842.2024180-4-axboe@kernel.dk> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241111234842.2024180-1-axboe@kernel.dk> References: <20241111234842.2024180-1-axboe@kernel.dk> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 170F61C0022 X-Rspamd-Server: rspam11 X-Stat-Signature: aj9dwpdj4j3x9aouwwrzo3iz5n6kpppc X-HE-Tag: 1731368914-774953 X-HE-Meta: U2FsdGVkX1/e4RHOlyeHhlszPdeMhKKywYyGwJ87BpWvx6OtWSG2VkwjKKKa/m98yZxb+JjoL5w868aw3FDzENSwNN14CKcvDiP7i4vZfJ0SBf7zCDOSST+g3GaPWjyoU/r7GOsAfzufixPplkiSDEEfVV0+K5NWpo+K1bZLnhUREQlI2GeYt3lXojcC2DlZYUp8bZjBt1cAok4zQlvEOfVveNC0i5Foq4xRrMt+KWfVHn7CBK9LX9ilN24/27T2wlEgEvnz33652irmnQ2IoS6N50T84M08DUzyLSJpkJRlcLzMFYYWChX81RKspzqcKmScHiaq6GbkMZxI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xOpyNaLUpBasVE4m2VKA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Add a page flag that file IO can use to indicate that the IO being done is uncached, as in it should not persist in the page cache after the IO has been completed. Signed-off-by: Jens Axboe --- include/linux/page-flags.h | 5 +++++ include/trace/events/mmflags.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index cc839e4365c1..3c4003495929 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -110,6 +110,7 @@ enum pageflags { PG_reclaim, /* To be reclaimed asap */ PG_swapbacked, /* Page is backed by RAM/swap */ PG_unevictable, /* Page is "unevictable" */ + PG_uncached, /* uncached read/write IO */ #ifdef CONFIG_MMU PG_mlocked, /* Page is vma mlocked */ #endif @@ -562,6 +563,10 @@ PAGEFLAG(Reclaim, reclaim, PF_NO_TAIL) FOLIO_FLAG(readahead, FOLIO_HEAD_PAGE) FOLIO_TEST_CLEAR_FLAG(readahead, FOLIO_HEAD_PAGE) +FOLIO_FLAG(uncached, FOLIO_HEAD_PAGE) + FOLIO_TEST_CLEAR_FLAG(uncached, FOLIO_HEAD_PAGE) + __FOLIO_SET_FLAG(uncached, FOLIO_HEAD_PAGE) + #ifdef CONFIG_HIGHMEM /* * Must use a macro here due to header dependency issues. page_zone() is not diff --git a/include/trace/events/mmflags.h b/include/trace/events/mmflags.h index bb8a59c6caa2..b60057284102 100644 --- a/include/trace/events/mmflags.h +++ b/include/trace/events/mmflags.h @@ -116,7 +116,8 @@ DEF_PAGEFLAG_NAME(head), \ DEF_PAGEFLAG_NAME(reclaim), \ DEF_PAGEFLAG_NAME(swapbacked), \ - DEF_PAGEFLAG_NAME(unevictable) \ + DEF_PAGEFLAG_NAME(unevictable), \ + DEF_PAGEFLAG_NAME(uncached) \ IF_HAVE_PG_MLOCK(mlocked) \ IF_HAVE_PG_HWPOISON(hwpoison) \ IF_HAVE_PG_IDLE(idle) \