From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (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 9807E33B961 for ; Mon, 8 Jun 2026 16:09:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780934966; cv=none; b=my078gzsk6x/UkIFr7tZ7ZKqycj8C6PFOMdzRlWdMNynQqhvcM9nmzf/tpmhf7ucoE8gfY/6NRf8Op6YkB+3OntJlvgwrfsSy6M4ZyFwMgUBxKFGZmubXgBh0Gw0XVyel68JwgPz9S+6TzibAWCt6A0fPa2szs4pP0DGYoqo+wQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780934966; c=relaxed/simple; bh=m5k9zKS5+KCFPJznp4odxkhVbFd0WBMso32hHlPgqKU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=d589SYRK55J94wlyy/szoaBThqpndhkiBQU3o0LFFRtAVoY3vspNxJNzMku6Q3ne3rZuDkFma6fW6GuaFr6wiT6UOkgfAKT57BANDbxHJ4A4lknURqVB1LeIxLXsIPILNoN5JWsKj5bnOcM/BO4bCZBUHasmTd3ZrTg9tmI+f9Q= 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=r6cjjFxa; arc=none smtp.client-ip=209.85.219.52 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="r6cjjFxa" Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-8ce9e56f68cso37905276d6.2 for ; Mon, 08 Jun 2026 09:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1780934962; x=1781539762; 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=Vod/HHC1D5DZqL91Z7CA35Tz9UyVxNBY16ghjiAxtAU=; b=r6cjjFxaIjMYvQSQjYI7OhKc1N1kfYi+ka/Pqitnp4oyFn8tmpOD+g/XU5EzDSFN4c lRYePw3aJxO97zrD72r+REn4wXGpaP3+c/33dbAyPY4uxcJvn552f38yKoB2SYuAUFFp 2NdNd9QwkL0UuLJ3LbMCJy0Kpsc0R2mD4jZgdRqWaR+UymCpojSyoheOHk+jbOoxDPVm TwQlXoyZHXuntt2GPkg8uuUoXMzeSoM2ri9v/xs0JkcNTO/j8BJkxUO4fHxAmuux9tyC k7uNkIjskeuKZVb624OU8u03Bk67l4fa0dk9VjQho4fh2zFSF9TyygGLT/TB8T024PRo yd4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780934962; x=1781539762; 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=Vod/HHC1D5DZqL91Z7CA35Tz9UyVxNBY16ghjiAxtAU=; b=Zlinz2HbknNPMb2lQcGA4eMhoKOKHBBM+0Y7sd+QRfZLu3NTi5tQv3xtGiYcC6zHSc L79YDuzQu+SZ2n0rUZt5pgusOf5U8ZqccA0sASylfDN+5GoL8UOhruCjsDhzjq5xa2tQ Sd5y+UZv2HTQmnYl8MvTzkfs9NThW9YXD/9lJRna9vP717SaKFXZwN5uP+nVMC3Ncexd w1YppyZtr+L+2KJ7EanHWJ9pP1pXI4ZnOvAG6xvtoBKsjvtmMHRJHfGKarLfD83NuL4o xkr9oHo8+J7fUxzlhzUKM/SJWSbw8I4h+jGcMK/icZZ/l3IWC0Jps9n/F9ALpyKvUuAW KTbw== X-Forwarded-Encrypted: i=1; AFNElJ8s8y0ekxofC1UnK6rLu6Lu4O/9+DlrAEXoyaxwqdphHllwyLPd4RTi4U2BNwwhtN0lXMHyRi6g8gqm6BE=@vger.kernel.org X-Gm-Message-State: AOJu0Yyx3MNdeNkpmlK5Egk/7TlLUeWe6DNxQS3TVPT/PZDyhm/S4t45 Z0HS4ssbCsAtDig83x5+PVDQOCWVhRw9WXu4kXJ58Ar85iibnXMGsH0bc+AhqN0TGZ4= X-Gm-Gg: Acq92OEGy3bzJZrM1EQMKnH9hc6Ukffqn0MMoXf7h9orp7SgQ13VpKKNckeANThNAzx rfb8oYceW+63xQ3nwfAUm1RPbw6dXkFaOnjBorYpOXUc8dgXYF/XbYQGjgtyCY/zNXe7Dav2Qdg piez03p+VxDCckTjTXknvbUePYnzIJ5IMHJ5HHby4Rgod7/Ts2p3SOU2lG/gTvQ/G3Nno8yhgjN JPiVIlrZHi1eGmVUzOzTZYbqfCeg5SeALSBtU9B7R0ZDQvy6ojgojseS+br2qFmRvZaKRJTiXKT AhQa+oc4Vv8Wgjdx6ovnzI52jSOZgv1Fw2oEeTfBHdy06fFHd8uQc3yf0weq3zQHhZlBDv+1f4N uthvM6vnMg2IUuVuqXmH/7aB9j4CmaNwrxF5s71eB9KxdOnrhf8uFsvmcnyb/NN8gM1eWQiEOOy TwEd7yUsAcJ6EujpDdS5hg1u6E3pUfrTMBS4n2doW+tNtWO65BQseQIzWORAzOgk2ZR6VkhUfYx UFQ0Xafa/2JvBX4SA== X-Received: by 2002:a05:620a:2a05:b0:915:8f08:5fa7 with SMTP id af79cd13be357-915a9db4f9amr2567293085a.52.1780934962358; Mon, 08 Jun 2026 09:09:22 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9158a22dbbesm1751766885a.13.2026.06.08.09.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 09:09:21 -0700 (PDT) Date: Mon, 8 Jun 2026 12:09:19 -0400 From: Gregory Price To: Lorenzo Stoakes Cc: "Michael S. Tsirkin" , 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 , "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 v10 17/37] mm: page_reporting: skip redundant zeroing of host-zeroed reported pages Message-ID: References: <6a2f93e4447e55ada6ccf0f4d5c64e8d41a848d4.1780906288.git.mst@redhat.com> 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, Jun 08, 2026 at 01:00:17PM +0100, Lorenzo Stoakes wrote: > On Mon, Jun 08, 2026 at 04:37:48AM -0400, Michael S. Tsirkin wrote: > > > > void post_alloc_hook(struct page *page, unsigned int order, gfp_t gfp_flags, > > - unsigned long user_addr); > > + bool zeroed, unsigned long user_addr); > > host_zeroed or something would be more appropriate no? > > But in general do we need to propagate this around, can't we derive it from > the page zeroed flag? > > It's really confusing as to _which_ zeroing this refers to, it seems the > only one relevant here is the VM host zeroing but that's completely > non-obvious and now everybody using these functions with the extra param > will simply have to happen to know this. > > If we could find a way to avoid this propagation that'd be ideal. > > Failing that, making it clear this is _only_ for vm host zeroing would be > better, but then maybe we need to think about how we could encode this in > some other way, e.g. passing alloc_context perhaps? > This is unaddressed feedback from 3 version ago: https://lore.kernel.org/linux-mm/agXYbcuQYooG74pb@gourry-fedora-PF4VCD3F/ We can infer all of this from snapshotted page flags and propogate those around. This is infinitely more useful than just a single flag being pulled out into a boolean, and more extensible. void post_alloc_hook(struct page *page, usigned int order, gfp_t gfp_flags, uint64_t pg_alloc_flags, unsigned long user_addr); ^^^ page_alloc.c internal falgs only Once the allocator gets a page it wants to return, it can take a snapshot of the flags at that point, and then doodle all over the flags as it goes through the page setup prior to return (include the post hook). Haven't seen a reason why this shouldn't be done this way. ~Gregory