From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA5CE3BE155 for ; Wed, 1 Jul 2026 22:21:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782944498; cv=none; b=S4vFQr92xfVQXLNtadGuHxwXRM6XIpN0KKrfsgUOhdX/zAoy9y+JYH+E6/F2elUZRx+QdBm185/wwBWxV/kaFwUZWJZTQncZuhR1qBEMqTSmfX0r0OakZpEfbEmwpTzxLUhTl5O8Sybcus1mOpCuF8vAkQpKx3bi5Ft18EVKyB4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782944498; c=relaxed/simple; bh=alSKPTQT6qyupCa9Wb3tH77OaCuCEs2eZNAD/mw8pDE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M1sk9FeZIm4haTtbeNaJ4pKYa6CZEbZvstOn5UpD99Bme0exx3ohBQtT0rmo0ea1LBQm6LVS3beqoaGDMUxGvLLDLXVV90TeO/tguaOMPJ0Qfmq67brKcxGIB/zyYdLinRGf/ylLX4NbxseEDTmjWnDQ4L2gb8MbnAmxooAZ+gI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=YN3OK31P; arc=none smtp.client-ip=209.85.219.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="YN3OK31P" Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-8efec2c28f8so8140536d6.2 for ; Wed, 01 Jul 2026 15:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1782944497; x=1783549297; darn=vger.kernel.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=0bjo3T7/TDMFL6Bk9RMp5aO8WfjOwcDSqkt8gjpOfos=; b=YN3OK31PkMANkY+aDMjAgSDCJL7LIiY1inUzNTmLI9irMx4ofgIY6D/MoeS2updoPT XE8b8IISkdFGy02dOftkRVB7So/Tw3bmoLff+0dumvnY8lKKau1YKQL/sRsx7MO1lTHB GbCtowY9wzzLq8g1qbyUB0Vg0XndpnAQSvPtbfnxLlnC+4bERVIgGmZJtrTvD/TfMxc/ 28yDUYWy6/LAlR9p+ITAvNF0h7ZsmsMAscHe33ELqMlqva2C7Ia+9TnEDObjMqZjpFsi GjLJUHOw0rW1s5AIs8POncfpxH2CdqBM2LYhKHJ7PCtP3c9X6hYsFY2zpGw13ec9gyNU EdqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782944497; x=1783549297; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0bjo3T7/TDMFL6Bk9RMp5aO8WfjOwcDSqkt8gjpOfos=; b=IqI3MkZSCO+Z93cZNUKJCOVhVoZarAiXgJ5u1zTHr4wjEw1QulSnBB7kcaL1BuFIhx y6ojnb/hfPjCdDKM8QsUNvabtKWY6PAEtBWNLazm0budCu82KhiLxSI5/lsziFOqpdU9 4m2rL2vMkBEZUkP7QB5YIk1BAySMhxHwGKOrrRGy3cxPjw1txDHEMSBkfqGQMXHUVaZF eiHh84E1BO3MJX1FMPypGkhQKn9cJtr7UldJnXFAW2Xd2khvvvQ0K3fUE810f4dQ0+3D eR8pWaenPQRzfn17f/6ErKHAq4J8W4nNcc3udukPdB0F5EZf6PqsBtAv6aZ0DtGZ2d8l JjAA== X-Gm-Message-State: AOJu0YxjBUbZ0WB0z6qOw9jKlI6E57/dDOMleKpa3aKcNsFBIrE0wPms 5BgmKgOVizIxXJIVNO3Ch++GwISmRiJUD97gDsxQD1clgEpuK71HbBlwn3A83CpT0U4= X-Gm-Gg: AfdE7cnJhPEGMImgUATybX3/11/vV4uY5vc9Zag2eWvgBswZ8DfCXrLIDNwxs/jzQfq 1/60yWUo+F32unpypulcqbBQ6AOt/7rfMKCdpIhNk1+2vpv8s9oMLrf/wqxqv/OWPSweTbIpndy KnnwHPSnbkAeqzFZ3lcMihoQ3i4magWsQ0ZjHztm6MkEz27cO4MN+Y9qoerd4n5VPQA9PGYVm22 fCwu2kgRc8fc7f+PRFvV0Rkk47yPSYJMT54S3DN64BWYdasCcvIDw4gMqOUPt7eb18nJTszahqM fJ4L29/fTzRjc5w/W9REQiddCi3Ld2gn9L0DXdE0vgfZQ25TGhDgtidj0S2fkTiR3y1bIp7QxfT uF8I1EqAVAeHjJuiJI1BdixbP7jfaq7qjdzdmcT334C5mP/gV+dAgGkKg/mLywalCphwVVroczP MBU35dk+ehTO52nzscs9nOb6dXRva9bSQKWz+h37vxXRHX2oC7w23Yv2sv9MnOkeEQcUDCLXltH Q== X-Received: by 2002:a05:6214:29c9:b0:8f0:275e:8b3a with SMTP id 6a1803df08f44-8f42557f540mr40756456d6.48.1782944496729; Wed, 01 Jul 2026 15:21:36 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F.lan (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8f46e27d137sm9709076d6.9.2026.07.01.15.21.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2026 15:21:36 -0700 (PDT) From: Gregory Price To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-team@meta.com, willy@infradead.org, jack@suse.cz, akpm@linux-foundation.org, david@kernel.org, ziy@nvidia.com, matthew.brost@intel.com, joshua.hahnjy@gmail.com, rakie.kim@sk.com, byungchul@sk.com, gourry@gourry.net, ying.huang@linux.alibaba.com, apopple@nvidia.com Subject: [PATCH 1/2] mm/filemap: place page-cache folios via an explicit mempolicy Date: Wed, 1 Jul 2026 18:21:11 -0400 Message-ID: <20260701222112.2820098-2-gourry@gourry.net> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260701222112.2820098-1-gourry@gourry.net> References: <20260701222112.2820098-1-gourry@gourry.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Page-cache allocations have no mempolicy of their own and implicitly follow first-touch task mempolicy via the page allocator. Codify this preference explicitly in filemap.c, rather than taking an implicit behavior from the page allocator. No functional change; it keeps pagecache placement stable across the following change. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Gregory Price --- mm/filemap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/filemap.c b/mm/filemap.c index 5af62e6abca5..d419d09a58c1 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1010,7 +1011,9 @@ struct folio *filemap_alloc_folio_noprof(gfp_t gfp, unsigned int order, return folio; } - return folio_alloc_noprof(gfp, order); + /* page cache defaults to first-accessor task mempolicy for placement */ + return folio_alloc_mpol_noprof(gfp, order, get_task_policy(current), + NO_INTERLEAVE_INDEX, numa_node_id()); } EXPORT_SYMBOL(filemap_alloc_folio_noprof); #endif -- 2.53.0-Meta