From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (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 76D38351C21 for ; Thu, 23 Apr 2026 04:31:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776918681; cv=none; b=Jwd4xhsw+8Y1tg70qoFCYjSNguo1azimdzJ9jDq5JqYkcfm4RSVD0TtAxTsolbMFghiP8mjABcVlLyoR8dQsZV1K9fWD801YYo2Ke+mxtN90CugJjU0rkI2r42Xl8OHC4buGRrHykNMKsjt3+ZIiAY8IlX4hlEFnG+35/nnObcI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776918681; c=relaxed/simple; bh=WjqD8BmJJCSwnwwzfZ25UIQEN6U/q+AVmj3pu35cNZc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kZ8p1PfbusBpfhtQqxD171Nnhy1UJLa3tCR0YB2YZ65rrvMe2azG/hE3eWlmpdC4dXU9qdKx8/Pg04qGUfc/MknpnQD3iOCKacFNmND+BCfVrgxJLrCrVxCxOKOKa8nMgxekA72P0dHCFySgjOcJwDkd+4VXCm8dqhWk4kRo4TM= 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=lfHVfuV/; arc=none smtp.client-ip=209.85.160.177 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="lfHVfuV/" Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-506aa68065eso46300991cf.1 for ; Wed, 22 Apr 2026 21:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1776918679; x=1777523479; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=KzBI8Vs9g1xHTdi85g03Pkd08y9g2RbvUpIAv03SBC0=; b=lfHVfuV/2xUlszx/Y3hVu0UHezfkaDNRKqqTnR5+ZiPhdjW5JGjjxw0xLcgRi3PstX G86nhEoj105Xz1q2YzTD5tLbbGjAEpE2ephQ2Gw6dbYzAF0KjF+HUqU+t+99r8Ov4xwR IMdfW7d2Lr6SjWAqWEE7cugOKphDyjsn3EpZ09qZWQKRX+ugmlQVnvMgeA+n+UOMRTCn HlB5pnGDJqUHzwEAEnqpRhT0n3fFulDW5RfyTPL6mY1TWb11VzpJ7sNX15JxS/zdkKW/ yBHAzNjwfadNdr7a7et1WofdY9KOj84Zr/bj4YtGpIorLq5ISqtcq6yUmCdM0KDMYp3g QlQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776918679; x=1777523479; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KzBI8Vs9g1xHTdi85g03Pkd08y9g2RbvUpIAv03SBC0=; b=dyJjZvBpKEz9fTLcPTV3xbguz1KsxeQzSin9C/EtwUF9G0KTbF04E/BNoL+xRvCDpo LOBeY7Nh/rLWZ8tdPI/jKrflhN0VvIxScshi8Hs8nJMUBTLYb4STmgo1fnj2i/Q3q/I0 gz9nIgCInWtoLKtSAB27j0PTlTz1OfPrDYhapXHCvi3yBOVsMAL7MrduSj/lV6kCGi5t 9z3pddzKrtcAA4HwzihQA0E3agZRlGGjJ3smK+Mv2MTsbNvY8alcgCYq4qjRHnCa/FJg wodkBnzKnFJw/4fAkUfUXuP8wqzgLHOp5E1UuEXRETth9WIkaqzqYet/+5EqqUjBakBn 5q2w== X-Gm-Message-State: AOJu0Yw6lldu2tKOQgoD+DL+X1hZgddl09PrrmDH4kz6qOr7i4ukw7JB F/NW54j6UAycg5iTOQOK+x+Nvun8N4GygKd3oRmELMRDKHTzPjNM3J6SRFaaWwiZh8U= X-Gm-Gg: AeBDies+gb1Eh09L/u3NHc3ZtCeDUdH/SbkxEAWXM2xjozv3fJCRo42lfTEZuWheUcU kYiuRnj99R9DHT8Q6fCEseZxUnIgQgb+X0/hUs9NMCccGi4dlDj5SM/zzVz9aIPylBBXYjKtoGv Ft5C0TS6HBmzEqZaIsARI1ARKLt5lRqp5NBRZBNAbDsNv9GWHn5Yr37+TNz5bHnQjn7BJCmcp2I Dddyw8fNHMrkrOgXrn0YMpkV2l7JgmZghBpIHOTuU24UNS0onZh3Z60KcsnK9KoQUSJkYGNbiMk jhQyY1vMm1tL8H1LyEUQ4r6VfyILOrMGqUYrF9nuYxyC7Y5/zt5rahgoy4sppatb8U0aD2QJNBS mT06FkKDzVixdhZyt4pzsPJi4116dwelWH77bSys3bj41Sz3VpuiqTxoPxBVlVIMMDFq51CVdd8 gf2R111oEh5IXcodZ4MqYY3qOjb4jBGvIH5MLMGokwPCRfrvqgPixApQX3L5XjfBGtVA4DVcyK4 7LzpxfQTNnWIIuqO10C X-Received: by 2002:a05:622a:409:b0:50e:89e6:669c with SMTP id d75a77b69052e-50e89e6697dmr204320091cf.37.1776918679403; Wed, 22 Apr 2026 21:31:19 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-71-246-228-50.washdc.fios.verizon.net. [71.246.228.50]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8b02aec3a3bsm147982736d6.49.2026.04.22.21.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2026 21:31:18 -0700 (PDT) Date: Thu, 23 Apr 2026 00:31:16 -0400 From: Gregory Price To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, Andrew Morton , David Hildenbrand , Vlastimil Babka , Brendan Jackman , Michal Hocko , Suren Baghdasaryan , Jason Wang , Andrea Arcangeli , linux-mm@kvack.org, virtualization@lists.linux.dev, Johannes Weiner , Zi Yan , Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport , "Matthew Wilcox (Oracle)" , Muchun Song , Oscar Salvador , Baolin Wang , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Ying Huang , Alistair Popple , Hugh Dickins , Christoph Lameter , David Rientjes , Roman Gushchin , Harry Yoo , Chris Li , Kairui Song , Kemeng Shi , Nhat Pham , Baoquan He , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH RFC v3 01/19] mm: thread user_addr through page allocator for cache-friendly zeroing Message-ID: References: <9dd9deabd42801f3c344326991d1431c3d8db39d.1776808210.git.mst@redhat.com> <20260422171315-mutt-send-email-mst@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260422171315-mutt-send-email-mst@kernel.org> On Wed, Apr 22, 2026 at 05:20:27PM -0400, Michael S. Tsirkin wrote: > On Wed, Apr 22, 2026 at 03:47:07PM -0400, Gregory Price wrote: > > > > __alloc_user_pages(..., gfp_t gfp, user_addr) > > With a wrapper approach, looks like we'd need something like > __GFP_SKIP_ZERO so post_alloc_hook doesn't zero sequentially, then the > wrapper re-zeros with folio_zero_user(). But then the wrapper needs to > know whether the page was pre-zeroed (PG_zeroed), which is cleared by > post_alloc_hook before return. So the information doesn't survive to > the wrapper. > I was thinking more that internally you already have that information you need to know to skip the zeroing - and so the wrapper can just pass __GFP_ZERO and post_alloc_hook() would do the right thing regardless Then on the way out, the new wrapper would take care of cacheline piece. However, i explored this a bit - and while it saves some churn on the interface, it adds two paths into the buddy - and that increase in surface might not be worth it. So I see the tradeoff here. The churn is probably worth it. ~Gregory