From patchwork Thu Nov 14 15:25:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13875212 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 B4CA7D68B30 for ; Thu, 14 Nov 2024 15:28:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B2926B0093; Thu, 14 Nov 2024 10:28:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 963B46B0095; Thu, 14 Nov 2024 10:28:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F1856B0096; Thu, 14 Nov 2024 10:28:09 -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 480136B0093 for ; Thu, 14 Nov 2024 10:28:09 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id F214641238 for ; Thu, 14 Nov 2024 15:28:08 +0000 (UTC) X-FDA: 82785080196.22.4C6962B Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) by imf04.hostedemail.com (Postfix) with ESMTP id 0679740007 for ; Thu, 14 Nov 2024 15:27:10 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=MLhkA0Wn; dmarc=none; spf=pass (imf04.hostedemail.com: domain of axboe@kernel.dk designates 209.85.161.45 as permitted sender) smtp.mailfrom=axboe@kernel.dk ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731598023; a=rsa-sha256; cv=none; b=iNNc8kldDQZ2mO53WDQg6nu+Pypk5yhBTUx5vSzqrVkN+qJYFuTVCiiQJR/piJqgTOEwyv 1JUT/zmcmlo3v6BF3RRTJqPA5HnrRXDGszDm7xWE5MRDEqbDbbjPPzH0dO/s1UW9A+QAVw KKY7armOGZftgjcncq6PGzGOeMM4saA= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=MLhkA0Wn; dmarc=none; spf=pass (imf04.hostedemail.com: domain of axboe@kernel.dk designates 209.85.161.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=1731598023; 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=Xdzh+zMRYt6AQgcMB0NmsKmS0R3Ox/sXkmSkBSL/4iGuS1AA+w6njcFPlDtkLrhBGVgBhM GDitgMxuHnZa05hcXCu342N40SO+rFYoiZndMcGG6vPC7irffAzjGFNUA6FlUhhPpr8cQc zpAJURlGuTmT5MrW7pPd72dInNmey0A= Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-5ee35ef95daso321520eaf.0 for ; Thu, 14 Nov 2024 07:28:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1731598086; x=1732202886; 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=MLhkA0WnyH0Eaat9fmG0KsoJmzo28cNWc3rXkjVuS8pkLcRWjGL8PywyEWjfREESxC 1Q0uK6pQ+HHUBdBoSEl5dAIIZq30XlRQ4ZDvP/y62DCcU8L0GFvpAaPkYZbe9bx7uhoX hE85loSPKI+7p5swhSbzaVzm8ZxMBu5nuZMzskqmSKMeL0zKJs58GeMYRzCnM7hn4rzg 6xEL+7iAaGp2XmYTDXaLRGwR+LUscDxBGopG/5LMJLBZhtABmuhf9suLvqWjzZ3TTN9s 7bc109YLn4gjy1eakHitrF+ofTtb/WKef7N3k7KDkeb5jwHwvcXskpktx2qJf+CW/LhW mrwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731598086; x=1732202886; 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=rZax5+p6jtu7tJ06jy0vcmpKm0Dyf64vMHHGWlH67kI8tArj181dcboansoP2Cw39M VSMIatiS2GEy+COKARADWyheaAKq5g3G2E16RBVdzaUk55rHFtdatPLrFMfj6DxcThKD t7JrBOAmZCrE2M/j8NHRMPvKQcckm5DU8ylN9OaJsFer7TNtRq6v69EoGQDM4mvXMFHr afBBpQbw/PIabXM3ZnvPdpr4NeUpXOxx3p3Ar9+agBbOkMNkgIGdbR2DTcbHXQrG19QW xvHriLsisJiQSEH9dKUCpEAaN4S/MrNAC06Q3+562k0NcGFcGp424z/o12RtVjmz8zL9 h8QA== X-Gm-Message-State: AOJu0YyyyCpV8eGGfjJRGkqqdga6IFwruyijfpWKtj72Qza28vdGy7j6 oI6jIfGE0fsxcM2rb2BlsQfYHuv7ErpvRgpbHLIijwNiIDydv3YyjfKDSwbrhNZrsBZxCdE8+Xx RkSM= X-Google-Smtp-Source: AGHT+IHYfzNU9jsYZVqq6BubIUmPINzkrBJpOzUKZ5nbA/vQYGCWpQqOD4e90GxHDczr5rmeIPTulQ== X-Received: by 2002:a05:6820:3088:b0:5e5:7086:ebe8 with SMTP id 006d021491bc7-5ee91feb02cmr6995384eaf.0.1731598085665; Thu, 14 Nov 2024 07:28:05 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 07:28:05 -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 03/17] mm: add PG_uncached page flag Date: Thu, 14 Nov 2024 08:25:07 -0700 Message-ID: <20241114152743.2381672-5-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-Rspam-User: X-Rspamd-Queue-Id: 0679740007 X-Rspamd-Server: rspam11 X-Stat-Signature: ya6mwko4xmpzzg98ekb78i34s1zyu54y X-HE-Tag: 1731598030-739630 X-HE-Meta: U2FsdGVkX19qKG/c5+MukvV2Pli0q24p4ncG6lPIVVsATtAO2ilq25UZQiI0vWwyP8S7ltckFQ+T+T+9x1adS1woSpT50iadP8xitbx5Bo3MPFw3aPaM+t43spPNCVyf8ARbsQZPHCgfsxUTQreDVefcW5IphCWy9D4aRcOHWa0fSyq/syoYS/1n3JwJUOCVdG6ST2AVsBKDQD08dD1aogiH9lVom9bK189QVx3+XBMwwGiItPd6507oWb2WHCNE5IiwyWzdBqYIO8b2cebdQTarva/QerG0Ey3TQM0YOB4Qy4+nG34lqxluz2xoSTm9xyDF4ltpistIkdqokAZ6j8pM3FyuEe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ter, 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) \