From patchwork Sun Nov 10 15:27:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13869947 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 4E0D0D12D44 for ; Sun, 10 Nov 2024 15:29:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ECD7F6B00AD; Sun, 10 Nov 2024 10:29:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E55376B00AF; Sun, 10 Nov 2024 10:29:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D201A6B00B1; Sun, 10 Nov 2024 10:29:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id ABDE66B00AD for ; Sun, 10 Nov 2024 10:29:21 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3E548120E1C for ; Sun, 10 Nov 2024 15:29:21 +0000 (UTC) X-FDA: 82770568524.16.BE1375F Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf19.hostedemail.com (Postfix) with ESMTP id 18F4E1A0009 for ; Sun, 10 Nov 2024 15:28:29 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b="M//905Wp"; dmarc=none; spf=pass (imf19.hostedemail.com: domain of axboe@kernel.dk designates 209.85.216.45 as permitted sender) smtp.mailfrom=axboe@kernel.dk ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731252432; a=rsa-sha256; cv=none; b=Mr5IFTIR7i9U1OEJeclnED6BsDFTzP5rNZnXQLRFzyKYj0HZawFDwCjhn/+y8rZbkNZ1Og yNBooBeADC2LlfUr8cgzg23jdmwzWqYEtxhbzfe3rVS3ihWpTaT9vhFT7w7+Yej7IIG+0A hDuXppyJMfW/h4SXVWlylPcAKZBHPgE= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b="M//905Wp"; dmarc=none; spf=pass (imf19.hostedemail.com: domain of axboe@kernel.dk designates 209.85.216.45 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=1731252432; 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=mdTZl0ylC1l3+vHodDfgeKcu3te+R1dYbdHIXpEo8b7V/hbQvbpp6WGTj7u00vVH7/yP59 9W1OMztg+9iyRVZmwWvUOYGbTgR8YIbpAp03yj8P7365D/CkeGfspag/6WlnrCrccFq45U sD1BjdTu+5IRHQCd/hRX5lQ1QTC7E6E= Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2e2ad9825a7so2840089a91.0 for ; Sun, 10 Nov 2024 07:29:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1731252558; x=1731857358; 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=M//905WpMXS9pXY71xZpvYJVnn4dIHuxdp7gYZCmuQqTP1DpxfowHLl7pgXd0orQoI PMFVIdZxxOygVw4XIyygouoHWXTb3gAImv+aF2ehykwJYoHwynFB668Z/HGSYOJJEAZc deCcxWBYLPTSo1n3ovSQjGDlO4+nBcwtEqEj53VEyEdiRAwFL0cQAzdxbRNkdt22B6+V 4Tx3v1mVMPZGXdWva8S3YprD+RAI3FHYOKFxNN2mmCjVYfrVpMpX9KTeYUI8EK/dvgUJ 4mtZoS0rSJy3eTzWIBvMwCz+gdLs+TBn9qu6A9UdJrrMQFei/2hf6sidXYAPdlazua1G GEWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731252558; x=1731857358; 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=apbK9Tn1TloGoJ1a1USpgfId9h+A8K969izpJ/l8Lf4p6g6J0WTdBq0zjd5VMIgPN2 k2ewZmOB90qgVLoP7uV3ulgNfEz99pStfmUF6/6jMAOxJq2DIFTpmREg+GLMsWEyEwi5 FAxPlEtJ9L69maQMxkhdj28Ulru6D3HXoRx1En3QODEfqNBGGcSFuLAdZC8vSrPBigQ8 RdRZZmbOl/v7XdmvDBdjgZlK0og+3LlktnlIUIQBQtEzg3/+rljLi5u3p/AqWuWDFYNx xhjaOxAUOfcmYtEIVZDcolmRP89LBid47X4BBPf69HuzYU0KHp5RhdrUc8yQYnZnoIli LNhw== X-Gm-Message-State: AOJu0YyR9soMlpB9MzzKt+d2oTyRM8FeZ3VwhIVN1gyERE8iVhBsYL+g 65F8VEYW4oXxk3UyaTk4Vhjs6IMeoGiYPZ1AXGIP++Uphy4c/rPb1CjL2IGzsQGK+oN5fI/3+vp LX8M= X-Google-Smtp-Source: AGHT+IEK+RdpBHKlpp5v8yHzxXuRsIFP9YbjrZgEGVdARDnq+2H6kYv6T3B7kfQSRNLPJFM3Uvu8sw== X-Received: by 2002:a17:90b:35cf:b0:2e9:48d0:3b59 with SMTP id 98e67ed59e1d1-2e9b16eb007mr12818842a91.8.1731252557781; Sun, 10 Nov 2024 07:29:17 -0800 (PST) Received: from localhost.localdomain ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f935dsm9940973a91.35.2024.11.10.07.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Nov 2024 07:29:16 -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, Jens Axboe Subject: [PATCH 03/15] mm: add PG_uncached page flag Date: Sun, 10 Nov 2024 08:27:55 -0700 Message-ID: <20241110152906.1747545-4-axboe@kernel.dk> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241110152906.1747545-1-axboe@kernel.dk> References: <20241110152906.1747545-1-axboe@kernel.dk> MIME-Version: 1.0 X-Rspamd-Queue-Id: 18F4E1A0009 X-Stat-Signature: 9pq4e5froa85s9gtoxey6uqsj8heztns X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1731252509-165674 X-HE-Meta: U2FsdGVkX18zLuE4PeeGVMmscyIjM3c0tIjS2iS8tA4/Y4Kk8FcGh1ayxt4XC4OF7emjElDodvZgKloI3o7cNhbIotMIPUcI1cIj0m/6JnkudvocQXyBQCDDQqIWp6sS8oNGTavYAIlZpapp8OoM35ZYy0HRlHmgagCNZNlTAyIOMSmaziv4svSX+EfL9U7PXqaV0t2gr20pZZc8B342yFN4X9jQdayKTK1q8D7pR9vNV2MEcMF3ywgJ9BpSRsBc8djKjqR1MY1+3rhSBU3QLcuor4CmhpIgnhAMIykHgQz51m85f0ci4xaQeo0iAremgIU3KotHHc+KAbap9Vg9qkJ8WXqqAw5sDFahRwVaoupx+Ca5zO0LHK9oedwmXKDzEK3GGSOKxYfZqjldd6W0gL0LoQkhH5oXoM4IxeR/rmhdbxeBBHdOoc64rwFleTl5+3V8jjDxGrguESulRuIYubZPU7T5Xq0hej/2TC1vZl07jQfY6mammnezb7JxnNQNrvuX5uxB4/6EF1X3/E8UIwfGjXIWTyBV9ZrkyI5EUj0tUJU7QroFBx3C7k0/2w+Fa9NwRkxbGgS6Y00pGihCr3jai3GHz9RBQpHRFXHTs62B9UUX0w0IQPvOGXYCfUBanfk+DxQ0GskZSNjSUggufGavBxWmYyvWwGRfFhgJ9MXsxIcCoS/XTn2qeSINaiuQRRzuK7yUOBPV8HwB7DW/xzsX8lHIiZ9GjlZm8Ug24vczftNJqw2MT18rOryrLT36Qs8hH0Q+b7svr4KNnGvhDvn6SHSrByzDhImQD/d/n/bA+3lJMFUQXIRMbzjtpVMU7ppeCZLVVdFqaWxF7lShUL34jUTODNPZgRs0qi0uFWsK3etTvMtRIwgnPI35SjcPO5L6e1z5AcBSD8rw1j/G3SDMfdKbaXrQNEbvJb9CNYpjCCIUiN1QvWojqsBJxtU94a8gfnTey4TIs+m4IkU 9Q6aut3/ S4p3iJxvOvy8prFZVowuapWw6oUMyyKzcGp90K/hk9QIKEm7D37Hf1B7XRzWOWSwX1C8FfLRS95q34iuuNn0iLIFHfjLr9JtOtt5BIDInDVSTOeyh6Hmza6V8MtZB4Xa4QJ3z3KzY/xmWrIg9ST9M+HDtRtDJ7VAbfksCs0sfUsoQY6mm98+MvOihcTm0MjNjXT1Wwd2GoT8/lCyqxlKdMOMq9dbm7T0Sra/0UJS9QX7vOOxpO7o+IxnTWxVJYAUKxv2hrZazaZNlEWry1QHax2BYO74w9YRwfBWhWq09scaA0yMEFvAdWVtne36vpKL15c1D7YdUMvuK0vzTrWmAm8iwJBbvl1qHqWBY 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) \