From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F27F33F593 for ; Mon, 13 Apr 2026 22:06:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776117980; cv=none; b=Mtd612whBfuBPcjDdhFG5opke+2dLGd9Bcona1lpG4QRECEo4ch2fTZlyh+FF3wQ/uUTDsJUfSCofJ+ZeFJuVzN7JebMhLQcbAsmT8XFLa0G59bsHESzgGWDPSYGmvmrSyAuf5FMm0QbuwHFyzajejHfyUOsGqJ7RtBodSg5aC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776117980; c=relaxed/simple; bh=DdgDRShweXjgZSgIzGzYFtkdi33XsXHHMEEIHYPBuRY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pIEyiNCf/aPf4DFjvlNQdwfNBvjY6/L7MASL5K/3d6V6sPpkYdyoW6542hV6JeYxS7fZ+cnZBafa0m/LchgmD/ZfF5ws3ILs9gMmnqkMjyaYFPCNHvi1xsQrU9P9ifes+WEUR6nSUp35cV0+t891TkpLsjxdyj2B/7GvWpHI/Lg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=G2P2lLxd; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=tXstrOXx; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="G2P2lLxd"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="tXstrOXx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776117977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RfJQhARp+lP8r+vkCYvvsXWeLcc1Y6WmdUdr9tFdDHw=; b=G2P2lLxd9UK309SRVOocrZSAomeBUgWmahf7bGKKXDzbjN+SiBd800boMU0wXgyY2RyVvr u/487mrWA/zewhzs+RiSz813KdKpblacw3TWVZpEMCTTE2ruFwenyfyQeZquCcbCJqdO3s uqQAToxQiyX/5THG4za3TMhzY1Wb6Vs= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-658-4PqZnjmdOh2_RJ8m9lqRkw-1; Mon, 13 Apr 2026 18:06:16 -0400 X-MC-Unique: 4PqZnjmdOh2_RJ8m9lqRkw-1 X-Mimecast-MFC-AGG-ID: 4PqZnjmdOh2_RJ8m9lqRkw_1776117975 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-43d7e5b98ebso383655f8f.0 for ; Mon, 13 Apr 2026 15:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1776117975; x=1776722775; 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=RfJQhARp+lP8r+vkCYvvsXWeLcc1Y6WmdUdr9tFdDHw=; b=tXstrOXx0Yk1StHv2DYxJCrZcbi8RrD1Fn97+OZbgb4QIWiUm7Ikgk2JmArvErpKBp iG+kWF8JO5azQTmiWVyxnwM1/UD7rYGxNqmy4WcwgFEPUzmVEixOzkP+LI4CwMwevQhJ wX0EztwQSWFPNnTtDpxdqYw62uitptfV0xjmvZOc/qyVDOcKcu22bbG1E8IySoT+nAUc pjFRD90ao1YxIC4Hh3wiHP2YhRS6kPHQjWxJu6SyFEmk8L3LNOZH+fuvNij/lerMxa1l UYD0oIMtbElnYjvQv8QEqvGfLI6edgUnIBcWuGPj5WSCLt4Hh2wi76kwxJ4WGRwwuBIa 3jnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776117975; x=1776722775; 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=RfJQhARp+lP8r+vkCYvvsXWeLcc1Y6WmdUdr9tFdDHw=; b=WfLOByZlh8btKE/O5uCQ4lh8y2Cd5dew8ujaXJ6hgQYO6mC5SOytyVR2YojKJz+7b4 e95dt+c5KaUp9MtdAW+DRJruvxBN8EbW5Eri6Ub0S38Wb53w98pTDIqryPRHSfv/mQbp ljKsDbZMYb01iqa16LOWF0kLCIED6X9yJt5niCwMhdgZludcCtZnq4cR1PHsYVFdC3qt 1NoSF2tV77ZEzb/qCy67EBqJKNj0SeSaKsswcuX9fpH+il21xhVcxA+i1VdOE1+w4j6N SEv1ltV5ew1hn5Se8HbmFtOx2WnTse+YhsSjBU3iXZuyWcJ11BQSQ9MVW9mbAbsqNQ8K XWGA== X-Gm-Message-State: AOJu0YyHsk0HL+yNuq/FPmGaLvjuLwuAqSSF/PgtPghKx97SW20e7FK3 Yv1PQv7Z2uhnzGAt571xks2cqMMLsu0An/3tuhtENYWrkVklCOcy99ifie5qunN4F0tRJm8oMrt i3bZUPZ1m8XK/kkZ6bSFkIxv/Z//0OPCUZJ39Blpty/gxSNsgDXYDyO3N2CAKtUVWfA== X-Gm-Gg: AeBDiev4DL+i6ks/RxUTT1AUsUt4CxRZPKv7t8CzyCDVP21ttrEHNpCCjQiKWrww2vZ PQoEPvk37Z2qk6gdB/2NS9LoquoBILtM5VAaSgRXSVDXmA0cv+hTbzaoXwECxEsIsiKFU5ltRFO Uhhehme6WiW6TlPqVJcxsFPc7ZrghHgTpKm8Ux6Qix7a5AvwnrxhXHe0px3mFraHJehEAgCwUE/ xoOwBlWlrLDPPwYEYYrRD4+EV/QZu+OWgJjzjVxYXX7cQbsCLG1Z+GZ767BJt5902OD9E7QWrfi K25R/F+r+7/aIP0gIL++UWcKBeon+OjSQmjaqWECsQLFx+WZXZq0GClM6hMK+Zp2dhAaancbU9c sb372AuEkOf791YaYrs4DmbOC4ODyoGyh1jv4DhEH7u4= X-Received: by 2002:a05:6000:26c8:b0:43d:77a8:3baa with SMTP id ffacd0b85a97d-43d77a83d14mr8700618f8f.3.1776117975075; Mon, 13 Apr 2026 15:06:15 -0700 (PDT) X-Received: by 2002:a05:6000:26c8:b0:43d:77a8:3baa with SMTP id ffacd0b85a97d-43d77a83d14mr8700591f8f.3.1776117974630; Mon, 13 Apr 2026 15:06:14 -0700 (PDT) Received: from redhat.com (IGLD-80-230-25-21.inter.net.il. [80.230.25.21]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d6a1203b8sm31868585f8f.16.2026.04.13.15.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2026 15:06:14 -0700 (PDT) Date: Mon, 13 Apr 2026 18:06:10 -0400 From: "Michael S. Tsirkin" To: "David Hildenbrand (Arm)" Cc: linux-kernel@vger.kernel.org, Andrew Morton , Vlastimil Babka , Brendan Jackman , Michal Hocko , Suren Baghdasaryan , Jason Wang , Andrea Arcangeli , linux-mm@kvack.org, virtualization@lists.linux.dev, Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport , Johannes Weiner , Zi Yan Subject: Re: [PATCH RFC 3/9] mm: add __GFP_PREZEROED flag and folio_test_clear_prezeroed() Message-ID: <20260413180303-mutt-send-email-mst@kernel.org> References: 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: On Mon, Apr 13, 2026 at 11:05:40AM +0200, David Hildenbrand (Arm) wrote: ... > (2) Use a dedicated allocation interface for user pages in the buddy. > > I hate the whole user_alloc_needs_zeroing()+folio_zero_user() handling. > > It shouldn't exist. We should just be passing GFP_ZERO and let the buddy handle > all that. > > > For example, vma_alloc_folio() already gets passed the address in. > > Pass the address from vma_alloc_folio_noprof()->folio_alloc_noprof(), and let > folio_alloc_noprof() use a buddy interface that can handle it. > > Imagine if we had a alloc_user_pages_noprof() that consumes an address. It could just > do what folio_zero_user() does, and only if really required. > > The whole user_alloc_needs_zeroing() could go away and you could just handle the > pre-zeroed optimization internally. I looked at this a bit, and I think the issue is that the buddy allocator doesn't do the arch-specific cache handling. So allocating it is a fundamentally different thing from GFP_ZERO which is "zero a kernel address range". So I don't get how you want to do it. > > -- > Cheers, > > David