From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 7C53B3630A4 for ; Tue, 12 May 2026 02:49:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778554151; cv=none; b=SgWasTCTNOgGWyj094NByBcBIwpPT6UfnbfyjDod1cFaCnC7TXblEolGm6XYfD2MCPtzhe6JlPJuOUJv103L+c7JBvLcC8cl4oDm1r/qjKBFvF8IrV36untT4UoJPLNxzYnKJAWekosLyW+B0iMmbaxgFfjMBsUWENPZPNN0WFo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778554151; c=relaxed/simple; bh=fuQT2rqsnTCIwFqCU9ySXXBL7BsZDUXRJOhM5fhGb+0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XHfrx5xY61rC5QCaL5+lV2+6SMc1vZiahf4DNd9hd2IQ3iIoiY0cYTkh69qwGZlI68/plGedQMh33RqaT4QvpXlsoLtytFGGxG9eO8wojxbW2cqKnuzO7Y9RPWO49FcxlKEIODhfDC9/vJ7i4SXciPolOaTOMgWPDB9m3BR40RI= 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=Ku91bTTq; arc=none smtp.client-ip=209.85.222.171 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="Ku91bTTq" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-8ec37d52c0dso719149485a.0 for ; Mon, 11 May 2026 19:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1778554149; x=1779158949; 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=S2BCFtdY8BstYcwPGt1OMwetfWeUvCIyaDq4u2dkV4Y=; b=Ku91bTTqj0xhcCqIy0dojDlCw1rfi8yQ70H+BbwTs9W7u50zdPQSVF0JGM6Ygz03vG r7I2YpePyzkXia+WPL3qAiAdPmUaE0YwvjLSXHKgEBQQukpO271ni4cb+YcdxDyhFKPU 6bSxZpFqP2v2V5JBEHXeM/blb75j+0E7z9Jj3ghWJKgx5dDmj8nIyPN4OVSiZv6UrHUb pw3HSuhxeVt6KiplVMPp8TgbbHVjsuaDasDOYnDudgL1NTBTEGME7OGIOvSayZVd6adM 2A5YLU3KIcC1xWB9QsD4DKLUHXvarh5QvKMuVMpMEwi1rHPhzPiQQPKkfnIDKi6f7OWv 46/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778554149; x=1779158949; 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=S2BCFtdY8BstYcwPGt1OMwetfWeUvCIyaDq4u2dkV4Y=; b=b1Uqd8S/sWzLXq29DNdxh+nOXtZkvjJH9IvK7sPc+HXC2t0OLBjqQrKY8CLzbGmLtD cvqTR2ySYuLeU6jdyToRatfL4tfDTU0nudiQR1TpDMRQkol8KJn8nX/k9vyKkdBcGO2E WnlLxs3vpKp4U0vX9TP89PzVuXMwN0i7wl4vrHUgbl0W6zwQV3QFZq8kXLGhpRtt5VoM V8xWbSmwFFLskAKRbgzMvfsYYF1WmnrX3xyQZB+D/psm8BEsIqSNbkeXdZbGpWZuwP4H qx+rsAd/OpYXo8iZB1pDzjXsgO8ZU0Ie5GIJGHyHy1LjzMrbV/XzgN6f3/PdpA9+kGpw Q8Ow== X-Gm-Message-State: AOJu0YyQm3aS2L8S/zd0lHR9SNt934jbTNrbLrP8gdIU/U0VfYfCp94R Y3tVoukdIYPTzpAWYsmk0Ic7+Nwjjp118qHmHNkRc0DLFxJwQgvHr97xCRdVTev6IRSj9LdIsEz ppVrp X-Gm-Gg: Acq92OFmBNnUCnHt45cHRkm0zYetuGo9vFzduqTukkP8EXyhdI+NkMpU32l81d0km9F glmpXG0ZCxALMSpF2r2j0UaMS9lIByuS83gYIYfob8mZuOqtPHFw8Cp03WJlPzG96tQoz8578At /PiR7lz92+lQXmAbKEU+pW9Rhf74qgoCTlACQ8SZw5EizuzU3yBcFzsfLE+drSnArDERyD8baS2 dj6mKbutRwDcdJjQik4zza4TBcY5Cd/K1/brTlKWe6McqgvLAm4HBllZ40zXmgXDcxmXuTEOT7x BKh1s0Ob1qhUvAnmXfyH6z5MIc0v1AAruDAL/qhOEsUQub/MPxnTugB9k+fELLWBOOkuXuqLBGK GYgKwg7KHlDhDS9rKdBzcuLf8yqlb8DVUtJ4qyD4YLKuxlyoQ7XXk4/II89JE4qLUpDJsTye67d cKSdcMOVCbshuX0EgOhB6lVUX3dX3p9v1fijm7M7bCHvMu3NU8SquzB/g8e0rQn13LADYNFA1NY 3uet1SYYK56 X-Received: by 2002:a05:620a:710c:b0:908:a758:baa7 with SMTP id af79cd13be357-90cfd34a203mr155310885a.35.1778554149388; Mon, 11 May 2026 19:49:09 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-100-36-248-188.washdc.fios.verizon.net. [100.36.248.188]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8fc2cd04c68sm3293903085a.46.2026.05.11.19.49.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 19:49:08 -0700 (PDT) Date: Mon, 11 May 2026 22:49:06 -0400 From: Gregory Price To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, "David Hildenbrand (Arm)" , Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , Muchun Song , Oscar Salvador , Andrew Morton , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , Baolin Wang , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Hugh Dickins , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Ying Huang , Alistair Popple , Christoph Lameter , David Rientjes , Roman Gushchin , Harry Yoo , Axel Rasmussen , Yuanchu Xie , Wei Xu , Chris Li , Kairui Song , Kemeng Shi , Nhat Pham , Baoquan He , virtualization@lists.linux.dev, linux-mm@kvack.org, Andrea Arcangeli Subject: Re: [PATCH resend v6 14/30] mm: hugetlb: use __GFP_ZERO and skip zeroing for zeroed pages Message-ID: References: <20260511174337-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: <20260511174337-mutt-send-email-mst@kernel.org> On Mon, May 11, 2026 at 05:47:48PM -0400, Michael S. Tsirkin wrote: > On Mon, May 11, 2026 at 12:36:59PM -0400, Gregory Price wrote: > > > > This feels like a very odd pattern: > > > > 1) ask for __GFP_ZERO > > 2) Have to check whether it was actually zeroed > > > > Seems like the zeroing piece should just be sunk in if you're going to > > ask for __GFP_ZERO anyway. And in that case, maybe just `bool zero` as > > an argument, rather than GFP (to avoid future overloading of flags). > > > > ~Gregory > > Heh. The reason is that it either allocates from buddy - using gfp flags > or from the pool, in which case it zeroes. > > We could even avoid the bool - just test __GFP_ZERO inside > alloc_hugetlb_folio. Would that be better? > Hard to know until we see the full shape of things, but it seems reasonable if we can eliminate one or both new arguments that this would be a good thing and the logic should just be sunk into hugetlb. ~Gregory