From patchwork Tue Dec 3 15:31:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13892620 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 3A3ABE69EAF for ; Tue, 3 Dec 2024 15:32:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8FF7F6B0089; Tue, 3 Dec 2024 10:32:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B19B6B008C; Tue, 3 Dec 2024 10:32:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7509D6B0092; Tue, 3 Dec 2024 10:32:53 -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 52DA96B0089 for ; Tue, 3 Dec 2024 10:32:53 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 08090140AA7 for ; Tue, 3 Dec 2024 15:32:53 +0000 (UTC) X-FDA: 82854040332.04.74919BB Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) by imf05.hostedemail.com (Postfix) with ESMTP id C9F8510000B for ; Tue, 3 Dec 2024 15:32:25 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=VaZvsrj7; spf=pass (imf05.hostedemail.com: domain of axboe@kernel.dk designates 209.85.167.177 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733239958; a=rsa-sha256; cv=none; b=WqvxA5DBEd5MjZmYbknL8AjoS2Qj+zVJFcFesFJJsjxJG60dBgScpw1l4wqPLJDsN+yZqY Lj8DyKAqOPCMJYxakOdJAu6IsiA01vl/+jP5qKrl7emwigAFEJ2WMghkHb45qoTWIG+496 JKqzVzUCvPlRuUDDvhNFU9dQgc8qKqg= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=VaZvsrj7; spf=pass (imf05.hostedemail.com: domain of axboe@kernel.dk designates 209.85.167.177 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=1733239958; 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=dSQf4jIfLBAkAFBsDD5CVUxWLID5QVKIZqR96ciKoMc=; b=xOT2QBYtCW5a5ybr369S/UCiZWxTZZ+l/xqSt3dHlFdkWiJUQLZKDfrNSZGTyMPr0LCVrj eZQDnqnACWMTtkrwV5hjP5+xVq4f3NhcRbhn+mGaiPWvdB7kZEF/bGLq2l2nFwPE83JeHC CeR1yYcxM7WmdHu4D74Y+OjX2v63Wo0= Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-3ea55e95d0fso2782724b6e.2 for ; Tue, 03 Dec 2024 07:32:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1733239970; x=1733844770; 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=dSQf4jIfLBAkAFBsDD5CVUxWLID5QVKIZqR96ciKoMc=; b=VaZvsrj7JQ1edIoZQHj9jOxy6WehrD48e5e5R392z4G6GdO59t5mjZl4VrnZpITase mv8/cbDleOokcf6GxZWxQB9u6BSZA4ZwagEZKnt8YON2u+ev7hGfajlXCrxzNxQtzHWm p63UvwnV4w/twYYYs7E5q5dUpgHFvRfNG7cA417wA9Hv/pVfvGynDLmH9apVTRsTsSJZ nvBa5I8cg/lMADkdAcXFF39lQMC3kRXEbmni352T5y3/A7OV7g4bPnU40gYug5fKBWzH sgoplhXniX3J2iLh/9ppma20285N48bOoFz5lw7GsqYAR7X6CKPuZmsvaXIzki8UWzmV HRXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733239970; x=1733844770; 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=dSQf4jIfLBAkAFBsDD5CVUxWLID5QVKIZqR96ciKoMc=; b=kqeRWZF/PQh97sQmLddVJjhIUNAgxUl31Qbb8S25K3RmMGVoG9t/4h86MDYw95S1Qj AxWQfImRSdjjqGJe6rOtXmcG7RlaL5bR+aatLujvUFMfJskc8dWBrN9ZGgzQp+Zv58zj l4BLr3YLA/8maQ0qNf8/S87E9/4J1wkyOFHuu0H6M9vWTq0tNht81Xp00ja2yGr4vzrQ QHTpcoNgKzyDfMxUukKWrCDrayClTXihlJFX2Hp0kEEUP9mFk7xEbyuBOxiGUX+dsju8 Y4WnZXYWxukf6GEvqEg6oqM9MP3mfsVtK005s0K6+maiggW+NJ5c+DQq3yLegX2Q1NGw pLAQ== X-Gm-Message-State: AOJu0YwIPfpNlHE0RT22IO7KY0rrzYTPXkGtxtUYHJbdXikexZePNEet SgeAbQORuPwYtrvBxLE7SDgkb65WAV5gktFH0DbaX9rxLB4aR+/AASTnRrk9FIbLESSR9AELonV U X-Gm-Gg: ASbGnctHGXAXhbCvCWD62zVpEh+7Y8XJSp56QG2KkgtWaKvDdo0Ng6jE+/j+9dDP+Lt dK5974CPfS8il7oaqvS4U3yaPBGJtr/0oOmpZ8C5M1XBmOJgJZ3M23y4um/V82pZ/gjbsLcZou8 p0IxZOmlmhSfd8l+jRxn29DxP8mmle2F7j4wUM8KUj60m+LZ+oAx1viQr9OyiuxStqoUDdGiM2R /a85iHGwI7fJuulkYH6e2Iool4sBgsamwxDdr0GGpU3ynwdE8W+nXHorao= X-Google-Smtp-Source: AGHT+IF59+hbl1oxKnagTF4XdkSvu7+brogdJGlmHp3dV6C6q4drpkxZSCaanT7IxLge7RXlKXRl5g== X-Received: by 2002:a05:6808:1795:b0:3e7:9e07:432b with SMTP id 5614622812f47-3eae505e041mr2729493b6e.29.1733239969773; Tue, 03 Dec 2024 07:32:49 -0800 (PST) Received: from localhost.localdomain ([130.250.255.163]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3ea86036cbbsm2891878b6e.8.2024.12.03.07.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 07:32:49 -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, bfoster@redhat.com, Jens Axboe Subject: [PATCH 03/12] mm: add PG_uncached page flag Date: Tue, 3 Dec 2024 08:31:39 -0700 Message-ID: <20241203153232.92224-5-axboe@kernel.dk> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241203153232.92224-2-axboe@kernel.dk> References: <20241203153232.92224-2-axboe@kernel.dk> MIME-Version: 1.0 X-Rspamd-Queue-Id: C9F8510000B X-Stat-Signature: bi3xhmd8te1u5czu67449kmroc3ab14f X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1733239945-845931 X-HE-Meta: U2FsdGVkX18K3l8eNBLrha3XEfHd0/2flTU6GJeaCBcbrBbY5RDo8tvT1bPvypeCrrZB6ZBRY+q4Zg1VxK+2rG/xJIlMG5nH1RS36ip//IdwmED2oXAYt7xhBj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P4KUbMvQfwaqOJxJKMF1yulVdQ3zYb42BzP5x2M8QnH3RTR29TEhn6+Ugz8riWe2foa6ShBtAaXQLLYZiIrzJFNRMzlahBbICy5D6acMoy6kUYNN6JAT+OX 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 2220bfec278e..14346fa2470f 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) \