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 37CB73D0C17 for ; Tue, 12 May 2026 16:35:19 +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=1778603722; cv=none; b=s0RVVw8PwuEauPyfjsAHo/5KNR85L+dO4mlHrPP0oMhXEvgBf1ogzIOOK9WmPlLmIj+GyfFmnzOj08WBC1cRFrZt8XfSb05JiJ1jZ+V+7QlpGIet64GRjvShrPI/u5KL+BtpMWXUyECPxxtbO+yxwWTfGViyCCoFlbpkvCXisoo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778603722; c=relaxed/simple; bh=toIc/eGnHpz4oNmG4SoUoA8H0T58hi7Ie/JgIxH78hQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=heay/UBZrAPfd1jIYYq+VgErWBLXSEMenV4qUr0URHHvMKjcgXOn5KOyGc8J4qtCd43BKGvO7pN0TzihP/9xrukA+0FH822Hp19U5GLtJU3N5o4POHM08nw6VNhcPhiaPKB8qAEiMUUN8SPMCWcOKkigU0TxzLULvLxGwdCu51s= 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=aaIIB+oX; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=ZjWcCUyC; 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="aaIIB+oX"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZjWcCUyC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778603718; 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=fcCfUoqbPzi0QdWN4h/jl5Vlg/FOqMT66yAiEmc3y1Y=; b=aaIIB+oXoZMVHU63jqa0mEOz9OHAW8jhiki0jhDJ5pEEbf/60+DkCBbsVxVtEHjGcK6t/a cUftqstIhX9RQyIfnCDJ6cNurOhWF4wh6Cn81ylklkTyvNKIwvG2sVTgLvu9qXjAnpa8xh ZukITx8xDz0cmPd2aZdgVRMPSwvamr8= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-664-MJa-KGz2Nf68IC9kGg5zQw-1; Tue, 12 May 2026 12:35:16 -0400 X-MC-Unique: MJa-KGz2Nf68IC9kGg5zQw-1 X-Mimecast-MFC-AGG-ID: MJa-KGz2Nf68IC9kGg5zQw_1778603716 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-90f5248b209so34631285a.2 for ; Tue, 12 May 2026 09:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1778603716; x=1779208516; 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=fcCfUoqbPzi0QdWN4h/jl5Vlg/FOqMT66yAiEmc3y1Y=; b=ZjWcCUyCpk+vPEowUsA9PCp2iL0053Wj4nwwH4SFoCfJbDszHyoaapEKuCK5Y8Xw1Q 6M4Rr6B5eC2kqaOfha9iczFMKiIJ35xO6zKtENoMVNwZ65P1dNuica7IIhiG92d6kZ2V +EczS3nEfmZ7oQfh+BfIQnBqUqowNyJa/U0HEZSDYCU8zDA5V5/rAN4EHhiSVcEKT+QD egBRnZ5IpPcE3NOvHes4+UXxu6aJN9JdB3EUODIGnIW61Rd8s0lLtgumG9LV8GH/TKd5 voSaX7J9ktylQuJjoXU9LhUD+gj6HztQBEZpgax9suytKtJT5speMPSlgcj7eJD4WXCj mAmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778603716; x=1779208516; 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=fcCfUoqbPzi0QdWN4h/jl5Vlg/FOqMT66yAiEmc3y1Y=; b=Z4gtf33cx4lPZ0K6yQarE0+9HtRzBmEKocf4ly4zjmcYFnUEJlh7Srz6jAxRqYruIF PsmkmKLtHgQUOF1l+xWvrR6jXrPJWswVl8ft7jCt41GO+z+Cpa9HhUXk7G5UZf7S3y6w /yMb1h5Ycr+SUfmgUWAeDqi6UmYL2+Zp6vlfExYKu9zjJt5RwdavS9wqaQEWHSHtolhw M+MlbZrhUpquCpakD/X4XmgOekh05Vt+JEGu9Ye+VhyoVpn/pv0QtV43l4C7gKihWAXY nOYpl4OF3ujD9tpXzQj9LZWxW0Cf9YWh81N14nnbtnLavIkHXTb1kRcxVj8RyDZ73Ksp gcug== X-Gm-Message-State: AOJu0YxVSf/BqmHV8qemS5tMVxHaaT1inR+YzAlZbhb2XZwGwVuUpbkO Zau0KQQGhTpsc4En4x8UgqiHLw0iWX9if/DkoqCSUSNZletFSmwochiRds6J7qBpUWjY7A5pVAF les0yyiFSXAqZfJWh4zewnJwhC8+t1kpG1Za8yqyKYIrcAaysS+8UKJaXd/EmkbVnag== X-Gm-Gg: Acq92OGtYNA0bQzZT2CwiqCcqdiDlAOlMntuE/1a9h5s3TChhoyGW4bFsMRfiV3dHhX MTIQoN0NL7fAM6qp7MERyaru2GqHiOXVwp9NLfPbanDdsrHJDtXZamvTfRmdWNt1V0pCxzuzaam XtWxhxnYFl5SWCa9NX4tmSkl5HCVxAT2x/2nyQz2/LznXuLNIzfbmPLUgnpizwlsERQmPUnIkeK gQH/Hv00UMraPYKvNqJYPF9zcz18suBMjzoGbmEg0FOmer10XamSNuoIttLQ38LQKPVj6HSucSM iHiY2VCuFzqZovlXqYv1kGJ/K6Icd4aZCz5gtvNgMmU+Ew3TB/caESljgd7h2sSs5Feq9RJlnAa H1pXlwSbO8Tj4KLnRozxG4o1H5x+iXMYIEaLPNyfa X-Received: by 2002:a05:620a:bc8:b0:8f4:3895:25da with SMTP id af79cd13be357-90cfd3510fbmr518772385a.25.1778603715435; Tue, 12 May 2026 09:35:15 -0700 (PDT) X-Received: by 2002:a05:620a:bc8:b0:8f4:3895:25da with SMTP id af79cd13be357-90cfd3510fbmr518761985a.25.1778603714550; Tue, 12 May 2026 09:35:14 -0700 (PDT) Received: from redhat.com (IGLD-80-230-48-7.inter.net.il. [80.230.48.7]) by smtp.gmail.com with ESMTPSA id af79cd13be357-907b8e9b24asm1430902685a.18.2026.05.12.09.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2026 09:35:13 -0700 (PDT) Date: Tue, 12 May 2026 12:35:04 -0400 From: "Michael S. Tsirkin" To: Gregory Price 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: <20260512123246-mutt-send-email-mst@kernel.org> 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: On Mon, May 11, 2026 at 10:49:06PM -0400, Gregory Price wrote: > 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 BTW it does mean we need to use vmf->real_address there as user_addr as opposed to vmf->address which is HP aligned. I guess I'll switch everyone to use real_address then, for consistency. -- MST