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 245A439903A for ; Mon, 8 Jun 2026 20:33:45 +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=1780950827; cv=none; b=IQNJJP4f3O/XKNaZZmqf+T6grP9BWctKBd5iVVyxOM5aW8CbUzjuMrPiLkedrteFQGnJCKHex1e0D3BJIzZW/g6WLP1PJkQYA9dNT9gkNXWqplTuG/3O+DxvIMqq7ACbedJ6vdKyH6YY+N8RekuRwl7INotOHQGLmCAyep+ZXQ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780950827; c=relaxed/simple; bh=W0dioJoghX7Q7sIdgbBbf5HsaBaheWAF7HSIZofrT2s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DmY0nNADmAFgRZxu7M6uoAgBRBJaR3LGlGJaZWIR1/CnvYwANYu6iyn7827+Jbl+ikZUQgxbzedAm/+AtGfHTi4OyEDlMREJfaK9GoxGTsrAGar5umZd9uYqN3AYGrWGaF+Os7OETvSO+V2OsljrLn2YzEhmvyA7c5/YxpP3Asw= 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=WJXr44I/; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=E0r+uZJw; 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="WJXr44I/"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="E0r+uZJw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780950825; 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=W1CZWnaLjy4XWhYnDZ8ZzqFQF7H0uYCpTeSCvjLh0TY=; b=WJXr44I/zBAYePpWfIATGEFqr7/CFYITh56/wIfAA/s9zGOWHPUiJh8pNE1Uy5+HzlbWcF gFj87EdvwNFn9Jpv4fb4KUh4WXDe+sYA1BnybNg6O+z7/ItnOrqoDMbIfWD0RLPf/wWmn+ 3hZxs3COUTIuf5AZj1ajLEXtKERs+RA= 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-308-GXNTpT_TMPSbJR9B5xPrqA-1; Mon, 08 Jun 2026 16:33:43 -0400 X-MC-Unique: GXNTpT_TMPSbJR9B5xPrqA-1 X-Mimecast-MFC-AGG-ID: GXNTpT_TMPSbJR9B5xPrqA_1780950822 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-490bfd70b0fso49312925e9.0 for ; Mon, 08 Jun 2026 13:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1780950822; x=1781555622; 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=W1CZWnaLjy4XWhYnDZ8ZzqFQF7H0uYCpTeSCvjLh0TY=; b=E0r+uZJwIXiHFlhhDGs2rMQfRDMy6wpvfbePM6xzS77t8fqsOunYEJ7Zm5M8Oaatdc fDfhLgepQcvpVopM3ODitRGeZOF5V3/fz7MI4uYgH9SfQlsi+4K/lTyT4E6sQCyFwK1g graMYlIdq5A9qSf+wqV438r+p3L/peAeGCK4ixI5HwvI2GFqk1n9jQZ7lpIibgFX79C7 szB+IlJFPiMfVVM4O1cmQbkV9OzZfjgX0n8daFEWrzDX0qGwUvYmx+UrxiuIm89ZlUpA yLQHroQ80LM4rxhmjZ1XCM+d6yXdHfdyx1oUSNjR4FwFa8C6edDrSZIYV8p4PJDADN5f EsVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780950822; x=1781555622; 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=W1CZWnaLjy4XWhYnDZ8ZzqFQF7H0uYCpTeSCvjLh0TY=; b=J7Bi8nGnu7WbJXqKx15Zlw4s+PbSzOVOWoPe9Hv5NUyYdowdrLg6QRwfmyAgy1Q38W Omg4ry8oF/CUIpb/r2XB2jF8LpyeGlI7Dw/6I2cc96mWx2oJRrHclcyaBxGBU1ZoVDfT xt5/NJ9ujaD/9auhrKDlfJBA+I05fpmtXReGXROSjYxYIIpk01HMblc0zKjxBvw0pdkq rvsJMbSHon4LChB5qYwX/8GzsIZGEcuVYln/NXafsrUGdu1ZwyKJt5gdHDt3NRAAA6f1 f1ai+WFIYl0EQsewIUejUTgJHRILgDB2wjd7ZwMSkCECS89oftzHb7rv0xSXQ3Ir0vmK HE7w== X-Forwarded-Encrypted: i=1; AFNElJ+rSBj6WPV7Gn4dlOfzEW1zm7fGp7+8DZA1G45Fo4B8A5GtyKq3jde39ZRsdK0v+hkdN1ga8cBIxEbXGJ0=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2UqKo/1JoY9LzAAAQvCp60LUVjIwSUdl+FOzAA5VNox9Rt9WS 9wZggGCSlsG33p1j9ebjH2ozGjdtCr+HiILmk+wbHnFyETgW3KFcrXYmvZrVCM+QfWdleOw8zvc iTKOWZpdxrEXcvMGfSAHBi5Sb0G0x/rVqKWUbnXbAS25ZbNb66YcUob7StvMW4yPDWA== X-Gm-Gg: Acq92OEEDYxMvFxlUxaXHszfwzeNW4h9cg75EGfbtfFohAsrjfoJnw1aZxXpgJdCJKL ZUgqv6tWfWjXyH+B4N23EbckFEXViknTiZ2KMbz9xuAbTZGOJipWbss5MrOLlVf4bI5nqkibmgB PPrZ//7ErpbGZvoytoqavnGgmc2pHbOrwALMBjo8fvNTtGkzm2d5TAaZ/26aOkwLZ3y3nq7oqI8 BNV8ON9Ttw+SoA00CnvCT4PqkVPelonEKLRRJ3lq4yUhySskRICzwMUFO7f56S3eQzbD3YEZy/F lJI+K9nlGy8MpP1LI1vwTcL0sNLVrVdAABo104AIgz9d5FoHy42Ml8X6RzdKGPiCeviMuzimMqL dv7YInSCoEVn40oDr0rXT0dubhCoiZw6vosVIuD3Q2KrcC/MNcfGpow== X-Received: by 2002:a05:600c:3107:b0:490:9588:bdb6 with SMTP id 5b1f17b1804b1-490c264cc2emr292104005e9.33.1780950821720; Mon, 08 Jun 2026 13:33:41 -0700 (PDT) X-Received: by 2002:a05:600c:3107:b0:490:9588:bdb6 with SMTP id 5b1f17b1804b1-490c264cc2emr292103725e9.33.1780950821331; Mon, 08 Jun 2026 13:33:41 -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-490c2d52e5esm196804455e9.2.2026.06.08.13.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 13:33:40 -0700 (PDT) Date: Mon, 8 Jun 2026 16:33:35 -0400 From: "Michael S. Tsirkin" To: Zi Yan Cc: Gregory Price , Matthew Wilcox , Lorenzo Stoakes , 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 , 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 07/37] mm: thread user_addr through page allocator for cache-friendly zeroing Message-ID: <20260608163257-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 04:21:08PM -0400, Zi Yan wrote: > On 8 Jun 2026, at 15:59, Gregory Price wrote: > > > On Mon, Jun 08, 2026 at 02:04:28PM +0100, Matthew Wilcox wrote: > >> On Mon, Jun 08, 2026 at 12:06:35PM +0100, Lorenzo Stoakes wrote: > >>> But instead of overloading user_addr to indicate all kinds of things, instead > >>> make life easier by actually breaking things out. > >>> > >>> Like: > >>> > >>> enum alloc_context_type { > >>> KERNEL_ALLOCATION, > >>> USER_MAPPED_ALLOCATION, > >>> USER_UNMAPPED_ALLOCATION, // Maybe? Do we ever? > >>> /* Perhaps some other states we want to encode? */ > >>> }; > >>> > >>> struct alloc_context { > >>> ... > >>> > >>> enum alloc_context_type type; > >>> unsigned long user_addr; // Only set if type == USER_ALLOCATION > >>> > >>> // Maybe something suggesting context or whether we init before in some > >>> // cases? > >>> }; > >> > >> Ugh, please, no. As I suggested last time I commented on this > >> trainwreck of a series, lift the zeroing functionality from > >> alloc_frozen_pages() into its callers. > > > > This sort of just implies writing the "alloc_frozen_zeroed_pages()" > > wrapper that does the zeroing at the end before return, and then killing > > the post hook nonsense associated with it in the first place. > > This means it is going to be a multi-step optimization. This is probably > step 1. > > > > > None of this resolves the user address annoyance which is needed on some > > archs for cache flushing. Whether anyone agrees that the page allocator > > should be responsible for this particular operation - open debate. > > This is probably step 2. But does the virtio use case apply to these > archs? Does the performance matter for them? If not, maybe this part can > be left as a TODO. > > > Best Regards, > Yan, Zi I doubt it. But I don't get what's proposed, the code that we have to modify is arch independent?