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.129.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 A118F37AA82 for ; Thu, 16 Apr 2026 08:45:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776329115; cv=none; b=n8pfVt4FDNh2uQlkkpDIHyPuTOx4DfWeXoLku75cO+0U8nM1BpOdtU2vL8tVZT0KpqtvFYZoxaAIh/bRhFLtM2apgmIixDrFagtg+Ge0bs8R0zexG2qv/JyGtfIAhULBMM99G0GGn64idrbXrfTYqNIfmPXqrwQdHhCSQtwZYkw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776329115; c=relaxed/simple; bh=wbMWrulmEaXtn0IpH9RUnB3WRZ9O9lpS2QKVeNr8y7s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D3CjiJzhVOhfKBi5QvoXiOSlO3pssyM7fzBamm4KPAUYwlLB0xSCc0CWf19gtoDfCVPPELoDCTkNrV8Fa6+AwREJ6YSAPCzqxWyHONzz2XozERFyD8YnRmbnWs2Qlbn0YVa40owJJhm0LM+16t0glmdwTklIA+k1vvKN2vOVc+Y= 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=E9dCTz1C; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=SrAocdxX; arc=none smtp.client-ip=170.10.129.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="E9dCTz1C"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="SrAocdxX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776329113; 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=Z/k5i8b178evugSrRqD2BM3wAHP5mDLkDXVGvrRPlfc=; b=E9dCTz1CeDxwmgHb/VCycrJTLFeaCmJbI+urd27c4c3ee5/D7Y/qApvBrXNukepugUL7pA arl4vFYXA/RILAP0NqeSMEiow7XgoU6uwxVSkD9hgwrHm+Y3xB7weyQcNkVjpwoLvRAdix pBYdmuymMJgHWhNgnqs85YzcHx7jizE= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-687-mUOwO5GPPjyxFJ-lm4FTeg-1; Thu, 16 Apr 2026 04:45:12 -0400 X-MC-Unique: mUOwO5GPPjyxFJ-lm4FTeg-1 X-Mimecast-MFC-AGG-ID: mUOwO5GPPjyxFJ-lm4FTeg_1776329111 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-43ea8161c3aso2685411f8f.1 for ; Thu, 16 Apr 2026 01:45:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1776329111; x=1776933911; 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=Z/k5i8b178evugSrRqD2BM3wAHP5mDLkDXVGvrRPlfc=; b=SrAocdxXzFWgTenJxHjWINL4CWdcwr+vgrq5ib66jxApotfogoH5pCxuLIZGj/ny/L CsaP4FvkRhK4kl83YylojQxzet1CdmS5s77ooOWj9ogYYCEF9porcx/2t++LqkgmTD0t P4FlA2q7uJLnpdcjNzznJZmSbCqPeKvNU8xA2TWfTfrKy/EgfQo9LToOpHr46gTfvd9a e2GEedHbpaBYcFjN8bJCfBrfCgGIpKeJEC8AvmKWtqo3kSLAkwfLlru0UhIvJZEFJwZo z5BjpW4/Oat5WbxuwalVPs08pcm48i2e9N5agTo/Oy+8rm8BlK2m3E3RXG5m2nXMfwLf Md/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776329111; x=1776933911; 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=Z/k5i8b178evugSrRqD2BM3wAHP5mDLkDXVGvrRPlfc=; b=pCygar7sUHsrJhTbci0F62M+Msf2ED64Pw+i4LAaPCMgOP8ibh85cH/qmIL352sBgX 6g3vbUZCOncyKStHrKTMToeCGFjodWGdM8r1Bfe95MIXb7KDax1ax5/CmSdTY5bWGcle h79ONkHCIlHKVxFRjTO2Rrfgw+D4qhkPdgXTETZN3t6FY2cYaIA66tmt1yI52shG5vz7 jo4L8wLZXPV8flSTGZBl5wHzudT3N2JsD5LTz8S0okFegRkdcJAAaBVVe94FxJL9hMPJ yJ3Ez7R+86HDaAbLxz/lowlddY/kbUgJ+ttJK/PTWYm2760dPgCQxHp/zX7d0JsT3C7c 3oVw== X-Gm-Message-State: AOJu0Yw5E2e01dPykJi8UyoRqTKQs6o8zYco5SVYuHq1/KlTgOiNJZOg eU1296smOR8NobLgI3H2GAhCYVZGF/HqE3QS94vYmPib2CUue4YGJUyxJ1IJ01YA3Vw1hRbI45D xR4x7Ue+w0UReMrZ+pL8ySCc07ih1DPFoJR++b6IVeoPaMTitUJir7NuqIKS03ebQ8g== X-Gm-Gg: AeBDieub7OfLhtyOm8CNr9k9/TJJg4LMAu/OsJFnhXIQOFgJV+e/swconYl6ILXAJXC 8zMs2+YxTbFNcjUrl7DTSjnMn3APWvY0NZRjqn3Bq6PZZzi9jhi6ZYqw4ZiNzYhnRrYZ0bhF7z9 Hsm3z8EflkjWeozTefRjj+nwhCb9vjT10OmoVkJGHQysDL5gG4epn1WuJg3oxthNYSBKIwu/QXN ysA9MTAPLfghsYXlUiMbWsAGCVK6dywYD6gfXRibo86rpGoJQiMJlPYv9c4AXojCKc0SFfPTIed PHy/jtxbOjDN+NnxYCQa3e2+phNwAuf/BPj+yXlPWOiABkB0lxPAQ2uupNnSuMKohluLWrZUyLH svPumdScNyBOST+HQBQIzR6S/8MtI/QVsVxu+mVRh1to= X-Received: by 2002:a5d:5f53:0:b0:43d:242:b9bb with SMTP id ffacd0b85a97d-43d642711ffmr37714711f8f.18.1776329110881; Thu, 16 Apr 2026 01:45:10 -0700 (PDT) X-Received: by 2002:a5d:5f53:0:b0:43d:242:b9bb with SMTP id ffacd0b85a97d-43d642711ffmr37714647f8f.18.1776329110312; Thu, 16 Apr 2026 01:45:10 -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-43ead33d65asm11893147f8f.4.2026.04.16.01.45.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2026 01:45:09 -0700 (PDT) Date: Thu, 16 Apr 2026 04:45:06 -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: <20260416022758-mutt-send-email-mst@kernel.org> References: <20260413163644-mutt-send-email-mst@kernel.org> <20260414062524-mutt-send-email-mst@kernel.org> <6fc307da-72b4-4d07-9e34-5e6c0563124c@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: <6fc307da-72b4-4d07-9e34-5e6c0563124c@kernel.org> On Tue, Apr 14, 2026 at 05:46:58PM +0200, David Hildenbrand (Arm) wrote: > On 4/14/26 12:29, Michael S. Tsirkin wrote: > > On Tue, Apr 14, 2026 at 11:04:04AM +0200, David Hildenbrand (Arm) wrote: > >> On 4/13/26 22:37, Michael S. Tsirkin wrote: > >>> > >>> I admit I only vaguely understand the core mm refactoring you are suggesting. > >>> > >> > >> Oh, I was hoping claude would figure that out for you. > > > > We figured it out together) > > :) > > [...] > > > > > > > Pretty much what I did, except I felt it is better to change the > > existing APIs. A bit more churn, but in return there's less of a chance > > we forget to pass the user address. > > > > Because, if we do, the result works fine on x86 but corrupts memory > > on other arches. > > Converting everything is probably cleaner long term, But there are many > instances where we just don't really have an address, or the address is > irrelevant, because we wouldn't care about the difference when zeroing. > > vma_alloc_folio() is the API to use when we have a VMA + address. > > But yeah, something that is harder to mess up would be nice. Well ... I am making progress on this but it is very intrusive. Are we sure we do not want simply this, just maybe renaming the flags? For example: __GFP_PREZERO -> __GFP_ZERO_HINT - request a hint that the allocated page is zero And an API hiding the fact that the hint is in page->private. Hmm? > -- > Cheers, > > David