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 468052BD58A for ; Tue, 21 Apr 2026 16:59:40 +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=1776790781; cv=none; b=FGgz3UrDU8bT6OI05bKRd3zlRKWE+lNx1/dEwuAm+mNc7lykAg304bYoMwBTcRYuwT3TjQt52lbsQb7tU7X4wQ4rmhLNb1S/Ki4INyRw3OFplMdVFXs7zxKT8Gkmhek5g5OkgSQTnWX90n1zTNqoCaVFYnVmeu+6/Epb6zkSw8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776790781; c=relaxed/simple; bh=wr52/3mYI2JPnWPtcPr63RV9bzNblLuMfeskzqToVu8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EzSFt8Cs8v3Oz2I2icDOiOYpPvJQPmZ5qF8ZsGg6ZLVo50+MHLrfnoR7Oadc+wBh7s3M3EDrg7Rx5U1xeZg5P+MUwhhduxkB8Xq68Yoi+ZSg4Mx+Vt0DTotguw9Gpb7A/1pq9fM1mL2vPI4EAoyAprG0WngQzturc5TiCqPuyPQ= 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=Bw8+xp0l; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=GVrRggJ2; 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="Bw8+xp0l"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="GVrRggJ2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776790779; 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=Dc7z9eFec98ao+dc2Vh1ZPzSBnM7NHud5P8tRM1qhHs=; b=Bw8+xp0lj27nAEK5T4WVibBt1AlYyy1vG1gRot7Abjn+PFnhqLvj4O+3Xrj1BNIjgYRmHi 8Dg6P1V3nC80CteypVBAjAFV5b8PqRbV2xVbYL3Tu3qFdVZqQlKQ9CNgRJXNCkL0JV+Z3l EYOU2RJXQG4ZUdoabjkT7AqybDtiP1w= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-30-JyhJ3ieaMJuwOswzHgyXeA-1; Tue, 21 Apr 2026 12:59:38 -0400 X-MC-Unique: JyhJ3ieaMJuwOswzHgyXeA-1 X-Mimecast-MFC-AGG-ID: JyhJ3ieaMJuwOswzHgyXeA_1776790777 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-48a55ecc32cso7365005e9.1 for ; Tue, 21 Apr 2026 09:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1776790777; x=1777395577; 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=Dc7z9eFec98ao+dc2Vh1ZPzSBnM7NHud5P8tRM1qhHs=; b=GVrRggJ29czK0jhirrwq+06QWj7uySca5HRnZ3xLbDenXchor8Dm9jhKbG32ndR1BB g+836qPvgcl+/QSjqcSg7z4BryUocSc/zv32XLZUrkWCIwNO61RwD+ULohebm0ibI4nq W+O98OpgnN7Aps9HgLmvgVzmnaZQvMOxXmdxYyYG2Sn/vgv8bR8upOv5dJT8CCXjfNe0 yHQCzWk3/5ew100vKhZrVz1yqrEv3zW7aDUY1pTGtScw+b4rkmy9OS+h9leMbAcEVNBg XV7xVqw8tcfpPD75EczIAx1mUJcUMeDN374lalJDjUFQ1wPh7/AV5IBjL/IZh9xvDOBU cEPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776790777; x=1777395577; 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=Dc7z9eFec98ao+dc2Vh1ZPzSBnM7NHud5P8tRM1qhHs=; b=DtF2kdzaYH+yDdhe6mk6t2UzW/fuYM+Bfvbg/ZKz9NX+6joPS/LldiuVqfWtfpHNyt nOQh+pI9UZTcuc+oMBVLLO+yw8tjR56MmtpYK8OkbNYpVBtUC6Q1qwDkNsirxGQ9IG2L V0LsLj7mt9Xai8tbQUN9/IPC4Re4frLZk6tnV6PkhlXKL2+NB94AuaFuASe0d2OhLlj4 YO4Wj6vbnUDzqC+CeHsPRfp5vDzEsmNOLfESnmadvqJZKmrVDo2T7XglxtcltRHVCsqC ZtJJil4bZf5mR+pxfXVucJdpgnape8VhTSAVwzutAL7SdDOeugkUQAEvfmX34Tdi7lew Eg9g== X-Forwarded-Encrypted: i=1; AFNElJ839Bm1SpDoXSQ1Jbv3jcz+xgANwUhEamLpfoS1Uv1X9LcZCTyqc5HciLEO3vvIlRyNu7YkD9F3X2ACm7M=@vger.kernel.org X-Gm-Message-State: AOJu0Yxo+BirvNbZ2wJOHtJOSWkQw+hErahyOaP1Pj3f08HOedveFUBL B1B4GgqR5eNQHBEf+6kc6LMNzsGmk/qtfbuGOi0tIP2Bu0o8fbd3B7pk4REpjPcFWgk26IDmyWv MLPP+fupBnJ+IJVcjicvX5RpitCp1qUhk/kz3gPEI4dzpGLlcYVBzJkq4bz4CaToVOQ== X-Gm-Gg: AeBDiesm+imZZACdWyvokqv39XQOKwYPnu8wJWW8UK2mzsMAJVqN/vT1uUbfiopGxeV G9XDYuPUZ4BOrWh5iuFrO/5YTE5v7qOQsumB3vlLmTSEOB5oH2oTcsGQP8lSukUyaUJt9B2U1b1 zjBc8CpfSoCUe1ARVeMJ4/v4xbcQR4ejsv1ga5gBm+ORA3Pvj1vaJn1pSIO/D03tEBMrdA3xiuB ES2L5l90MAS4NfXgjGKovMoi+kSWHyiGH2GEiT/arynLsdTdhR5QmnWCK9wqoFN4hdbKxL0ywzs zy2+HQwTau7NvYluK+bySPHi67wZbfo17ap6hSFORw1PgqKSXZiT9xnVDIK3dXXx6Q7LR2taan9 D33Yf9oTgSy/AB4VPcE59+D6N30BwA7a8EQj5M7hu9LZkC7u/Sh/6Bw== X-Received: by 2002:a05:600c:1993:b0:489:e696:836f with SMTP id 5b1f17b1804b1-489e69686a7mr110733735e9.10.1776790776721; Tue, 21 Apr 2026 09:59:36 -0700 (PDT) X-Received: by 2002:a05:600c:1993:b0:489:e696:836f with SMTP id 5b1f17b1804b1-489e69686a7mr110733065e9.10.1776790776231; Tue, 21 Apr 2026 09:59:36 -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 5b1f17b1804b1-488fc140c82sm350387875e9.12.2026.04.21.09.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2026 09:59:35 -0700 (PDT) Date: Tue, 21 Apr 2026 12:59:32 -0400 From: "Michael S. Tsirkin" To: Gregory Price Cc: "David Hildenbrand (Arm)" , 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 Subject: Re: [PATCH RFC v2 00/18] mm/virtio: skip redundant zeroing of host-zeroed reported pages Message-ID: <20260421125842-mutt-send-email-mst@kernel.org> References: <20260420192037-mutt-send-email-mst@kernel.org> <20260421090341-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 Tue, Apr 21, 2026 at 12:51:00PM -0400, Gregory Price wrote: > On Tue, Apr 21, 2026 at 09:06:00AM -0400, Michael S. Tsirkin wrote: > > On Mon, Apr 20, 2026 at 10:38:19PM -0400, Gregory Price wrote: > > > > > > Can we leave folio_zero_user() callers the same, but add a PG_zeroed > > > check in folio_zero_user() that skips the zeroing (but not the cache > > > flush) and clear the PG_zeroed bit? > > > > > > Is this feasible? > > > > I do not see how - this would require leaking the page flag out of the > > buddy allocator. > > > > Right, but you're leaking that bit of information out one way or another > - whether it's a page-flag or something else (pghint_t) you have the > same lifecycle problems (when does it become invalidated? how long can > it be trusted for?). > > I suppose at least with (pghint_t) the data (in theory) falls out of > scope and doesn't live with the page - but guaranteed it just ends up > polluting more and more interfaces. > > I'm seeing why David's suggest to plumb __GFP_ZERO correctly makes > sense, it's really the only feasible approach here that doesn't generate > a staleness problem with whatever information you try to leak out. > > ~Gregory OK, v3 with that incoming.