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 CB3E2241686 for ; Mon, 8 Jun 2026 19:33:50 +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=1780947232; cv=none; b=bXuSPBLZdY5F8kEUVzp/Gyw3n93a4eLg2G+iAFEaJVHYjgLl8rwQwy6Xm3Vpx2UzMJODcRmMlJSnZxE/+m7HEopt4StjoawFsXNRMzQV0e5AXKcB3WJWnfHEbINnxTyp/xkxcekbcmc8W0T9yEhU3lzGk6QIDmC258xX9XIScwA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780947232; c=relaxed/simple; bh=oX3pYk42Bzqeoce9KeAXxQgg7Plx9HwjbhS1YrGiaE0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=C7kT4p6zQRKM/27d8zrNJDkCrO9FS2T2FXy25eI+zyHrViM4r/3ApqJAaifj8+G2W+Kpn/1e5qd4I/gAqAOIaSyMJZ1lvTx0+7XpslOtIsCf/JPdzsHvNdYxnNahkoS+E1KVReyL2prIXIcXBOYautDQwKBN13+M7iGfLvBBJ/M= 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=IUTD3PQs; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=jTc1J1jr; 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="IUTD3PQs"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="jTc1J1jr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780947229; 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=3dDLQst0ldE4FdJBA8ABzv/FPI+QsS8HzDNtt2amioI=; b=IUTD3PQsWhug7zidmA+fbmvnFoFWk8T70geMStWNnv0707TUpWrADaTyMdFZSHHyLJQWXU UTlvRXtl/DcgZuTz9epWko2x1qaoseL10lH9GJ8+u4K4TXdZ/C+AyQog9azw0G8RBIc0al QJ9/zMM4AAfgXbzC3Jp6RpQY9McbQaM= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-635-IgGTVpAiNnmsorkXMitZgA-1; Mon, 08 Jun 2026 15:33:41 -0400 X-MC-Unique: IgGTVpAiNnmsorkXMitZgA-1 X-Mimecast-MFC-AGG-ID: IgGTVpAiNnmsorkXMitZgA_1780947220 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-490b7959b9fso48215745e9.2 for ; Mon, 08 Jun 2026 12:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1780947220; x=1781552020; 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=3dDLQst0ldE4FdJBA8ABzv/FPI+QsS8HzDNtt2amioI=; b=jTc1J1jrK7pZfL2efDGIsOZB/eLG1MjPWbrjY5NSbKnJYlX5FV+ipKdZBMHN6TfE3E WNOJsI0yEB386pSG6fVLFSjrI7V9RAUXQfmzust5MdqRU2Y1fWbFNb9AWg0IG6FraPJV 4UmIchvrxmD8e1m0zqMmIpqWtC909aZz8fgJI3QlkzGS82i4DVT8bEYdl0GeGFCprNYx 4h84q1iX97LJ1OCq3fbSv75SXEvmiZOhAOSAxLwildfWzd2WsQPjK906zemsfAH/La2D cbkJqksHlQzYp67pY0IzfWQ9+O6d53C5b9iVxr5gQrtK7OuGdU+X+054N2XbzTTH7fEL vLKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780947220; x=1781552020; 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=3dDLQst0ldE4FdJBA8ABzv/FPI+QsS8HzDNtt2amioI=; b=a1FASrTpYpQB0ufvfSmBVqu0Q4yRZDZS5Nfx8rthqqkBcTnWg5iZG+uhvpI/EWGC/q Ha5CeBwdc+gdAzS3NhP/up87PBGW1t4dZEIs4EB+eeBA15YnmteM8GP/05o2kwpAC36Z VHJ9V6RI9VxIsLtRDJ5wvp2d5Xvc/2LOZ+PKZQ+ftF3wEMHqDISfbNXFSRNg7uHs1xn5 ZBqART5qgx4dMEg2ihsrmOcKPULvu7eWF/wtVgUtFN9Xy0Q0BVYPz9PbJiUzTbOOs2Uz f0tITgzelQ7XNneBHhHHB203G83gLwxmkEwJg5sc4zGogp7g01ys46qZob5BTrUpmM6+ W9iQ== X-Forwarded-Encrypted: i=1; AFNElJ9GJ0FfIo3DN+Wf61Mof8m8DEq37NAgAFEP5p4wAlijpnTQm+t9dhnRdbMRHgxhLRUijVlBuD6nom2fNgo=@vger.kernel.org X-Gm-Message-State: AOJu0Yzh6mwAK8fkR7m6rXug+bA11AbAy1w9ZP5/ATtY+Q6I+H72Do1m TTc5nHcO1wfOA3yjHE4RW2G5eMBxBXLTSK4kmoqArhMshcthTrnC1AA/u/HSVGZHICI7+XZIIbL HSzEOHPHdV4hzjPpATEJbcfQ0dRrUS2G/kFm60pp7wPtLdX1XAZpD65xBVyLLOMlcAw== X-Gm-Gg: Acq92OFN3mkH0ucQOVPJT/ww3QLMHBAtQKB7jccyLSbwxFmV/Bl9y5gQKf85NXXZdlU YFdJTh4T5BKi/Fg5LUh7iDIlndBYjL4GIPOe6Wd8KL5Hn/4yi31x/iwy7mhIM6j7e7JqeNx0Ka3 m4yEY+YF2+x+sWKr1QDPKSQUWneLkCyQ253OYwnqd3VUVLHgdYB2BmeWBMYubNldlLDmuIXcFVa DbdcxJyBIZA+IZF/poLcMAKgXXPagbwxuWwNdzXSIp6xwzCGyLa/1ieRv7JKEqlLVNvs5i0ksx5 c3ZUhAEQlibbikm4Pvhf6q59mzeR4NvT64BEsvCZUJuNIU0KhPgIXyt4fZQjIJ0b8NLcU8DQqCm 4E7JaMmx1BsfVQ40dhJh+aYgqlZV9UoAwSJQlkqx8sKeC/8ZdmDX1TQ== X-Received: by 2002:a05:600c:4708:b0:490:bd66:e522 with SMTP id 5b1f17b1804b1-490c26038d2mr274762065e9.29.1780947220409; Mon, 08 Jun 2026 12:33:40 -0700 (PDT) X-Received: by 2002:a05:600c:4708:b0:490:bd66:e522 with SMTP id 5b1f17b1804b1-490c26038d2mr274761275e9.29.1780947219772; Mon, 08 Jun 2026 12:33:39 -0700 (PDT) Received: from redhat.com (IGLD-80-230-85-71.inter.net.il. [80.230.85.71]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490bc413adbsm420621035e9.15.2026.06.08.12.33.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 12:33:39 -0700 (PDT) Date: Mon, 8 Jun 2026 15:33:33 -0400 From: "Michael S. Tsirkin" To: Matthew Wilcox Cc: "David Hildenbrand (Arm)" , Lorenzo Stoakes , linux-kernel@vger.kernel.org, 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 , Gregory Price , 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 07/37] mm: thread user_addr through page allocator for cache-friendly zeroing Message-ID: <20260608153223-mutt-send-email-mst@kernel.org> References: <50d410b47fe3f45327783e05bd306d5eaab75e65.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 03:44:29PM +0100, Matthew Wilcox wrote: > On Mon, Jun 08, 2026 at 04:37:03PM +0200, David Hildenbrand (Arm) wrote: > > On 6/8/26 16:31, Matthew Wilcox wrote: > > > On Mon, Jun 08, 2026 at 04:26:18PM +0200, David Hildenbrand (Arm) wrote: > > >> If that means that we would handle __GFP_ZERO consistently in the callers of > > >> alloc_frozen_pages(), that would also do I guess. We'd still have to pass the > > >> user address down to some degree, through folio interfaces only at least. > > > > > > What I don't understand is how the kernel page allocator needs to know > > > the user address in order to effectively zero it, but the hypervisor is > > > able to zero the page without knowing the user address. It feels like > > > somebody has x86-centric thinking where cache colouring doesn't matter. > > > > (not commenting on the icache dache mess we have to drag along) > > Well, that was kind of the point of this email ... I did ask the > question you're answering in a different email so let me respond > to that too. > > > The thing is that with free-page-reporting the memory is already zeroed by the > > hypervisor as part of discarding that memory previously (e.g., MADV_DONTNEED) > > and allocating fresh pages on re-access. > > > > So it's not a question of "why is the hypervisor zeroing less efficiently", as > > zeroing is just a side-product of reclaiming that memory in the first place. > > We definitely have users who don't want the guest to trust the > hypervisor. So how do they disable this optimisation? What do you mean, how? This is done by: [PATCH v10 35/37] virtio_balloon: disable reporting zeroed optimization for confidential guests -- MST