From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (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 591CD43DA3A for ; Mon, 11 May 2026 16:52:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778518335; cv=none; b=cCgl7iDjnSbXLAdNwzeXpoIUzp6rFgAPVFR7MeS6yPrEeBSNLPmVYsACuKdaXkmwHVEbISnqODBoGfG+sDn/CIm3sZQEwzCCexEPJiyjhWJpjIOcbU6rTWNdt3DFwdCOq3VJH5p1EqYgXd/qo6PC/fcnnHk/pV/sTM5UlbQF0Jk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778518335; c=relaxed/simple; bh=w++Mc6fsfXBYdFsz3+M4dmIRX40lX1nYDeGHE6Q83+c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=S+YrG4IIbhY7lNIsNg6ldOhBBoNW/jmr13YBxmAWUVNeFL2Gyc6622PZtA2qSCgze6a23zUcPh55NdEOYt/oIO1l8d7t6gR3I1vJKEsuWoA/0B5qNl6xpEMhCJ4PhOK1sU6LySyKcJcAWiZjXfZWUa5Qn/2kfvKsVuK4qO6DrfI= 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=hHlJ3Kob; arc=none smtp.client-ip=209.85.160.171 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="hHlJ3Kob" Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-50e63771d91so46938771cf.0 for ; Mon, 11 May 2026 09:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1778518333; x=1779123133; 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=O2xFv/znNeupkUwLf2eAcAA4yCdnf8t4om4s5YlKB70=; b=hHlJ3KobqAj/RWlL95PU1RusgxcVtX0/o3syx/KlXisBEFnrRJLtg04PkUlNL7A92v 9vaxDvDaLPJlaWRvReYNNLryuo97WsDjWjAfmU3IPLo5iDGYNLbqx3SKOwI69L+YgHhK 1SR+eI76rGKpurzibSnPAd80SXFnno9ZZf898BCgBs+4v5g+KkAs+cztRAGT9IbtbHZ7 t7jyLvIiSKu2n2gXdGmLavsxhZhhjUP1SGIsM30SkxazL5Di1A3/+6XPcb7rG7Od4nVE nuo9ME0yybXbi9LaiwaLutb1oDCIcav4h+HLjvsaVN/bNhiSeBXzhcdiZWTFL09gLzO7 fMfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778518333; x=1779123133; 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=O2xFv/znNeupkUwLf2eAcAA4yCdnf8t4om4s5YlKB70=; b=pVS1HYoZ1DZPCOcyHoO1zAL+zOzXKr87c77DypmVlmU+cB5yQYOscqXnAPwrvwdjpB zBsIfe/x+gZB6dtx6xDMGHBfwA6ylQSJEpJN7qAuZB8FDIAvxPU2Xo5qlTcAY0ma3yRC xeDr//tbiQBDqQ0x9K55kArG4HK+ZaxXToXnhEkmj3eF+Z6syYnKjsoRmqbvysF9kO+v KSfYH/P3YJ0aeGz7LZx6tJvO8l9VW4QDmUeWpAnx989A2RtHHWIbzC2IBLoTRJOGuJOD FQER6OC4MMzvW6ms+ZxFxiRqX8AwXkl+DLCPlj+9eUIcNM85o1vCaPI3olMzoqlBvsLb c4Ew== X-Gm-Message-State: AOJu0YwX8pgU5YRrAb12DO5SRQqRSILuxRH+aoT1g2xi8EFhioG75o1N v5c2iQx+Rp6zsiMqalg0LwJEvw238WTu7D6FJ0cQ8r2nPNYKAF4W8ng86DS0iew0/QQ= X-Gm-Gg: Acq92OEiUEVKXX32mL/MIVMy/GzAoyStZ32c0MP9KYt6nB4nmTlF02S0/7VG+gVp/YB Gc8majG2ajVl+pr4pz8Xz2zNFrwH+ZFcvKWTLBHCmVZY0l/f2p9qI/NxjaMymjNSvFPaT5fsjOT CXFVymD1j2dK7mMyteVEgCpuGVdh4QoWytOtz1oBwK3MkPwZ3/WS6qCk8VaOuwuUn8x+Dez8AVp 5Y62J/B3DvGVNkDD1YBvOFrk8b+SV2f8bxOdGH2/mZNxXqMDn8UB7Lb7wnJz/NeAWFkptSG5sP3 amvqa9q4+l15SwsVoCgcQxwg+VbngY46/lqNk8uoasFHHezn6/UG1NFLUcDNlZytPrXnfhFrnVV PEnVLlFcmu28S1uSLVQd+9ChyMm/2q0dHzHGSSGhY8Tt3dC+iyk49glBueXdoSdXXMlPnCDWrVD EGb885itKovEW4o3X+fH7ppjHvlHa9HtMDp4w8BgT9tdgke5tMlLJv8w5b1iDITwQFRQX42PEvW qZK+eaYU0Ii X-Received: by 2002:ac8:5704:0:b0:510:141d:9d06 with SMTP id d75a77b69052e-514a0a2a364mr162992381cf.10.1778518333136; Mon, 11 May 2026 09:52:13 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-100-36-248-188.washdc.fios.verizon.net. [100.36.248.188]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5148e7bf7e4sm94051171cf.17.2026.05.11.09.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 09:52:12 -0700 (PDT) Date: Mon, 11 May 2026 12:52:10 -0400 From: Gregory Price To: "Michael S. Tsirkin" Cc: 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 , Lorenzo Stoakes , "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 , "Liam R. Howlett" , Harry Yoo , Hao Li Subject: Re: [PATCH resend v6 03/30] mm: thread user_addr through page allocator for cache-friendly zeroing Message-ID: References: <9b53972f4854c1064b92cefc464f51949afeb83f.1778489843.git.mst@redhat.com> <20260511114853-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: <20260511114853-mutt-send-email-mst@kernel.org> On Mon, May 11, 2026 at 11:55:40AM -0400, Michael S. Tsirkin wrote: > On Mon, May 11, 2026 at 11:37:37AM -0400, Gregory Price wrote: > > On Mon, May 11, 2026 at 05:01:55AM -0400, Michael S. Tsirkin wrote: > > > > > +/* > > > + * Sentinel for user_addr: indicates a non-user allocation. > > > + * Cannot use 0 because address 0 is a valid userspace mapping. > > > + */ > > > +#define USER_ADDR_NONE ((unsigned long)-1) > > > > Ehm, hm. Does -1 hold as a non-user address across all architectures? > > > > What about in linear addressing / no VM mode? > > this is used on a fault. I don't think there are any faults then? > But maybe FAULT_ADDR_NONE would be clearer. > Meh, naming here is less relevant than the sentinel correctness. My only concern is really whether -1 could end up being a valid address in some horrid future timeline and this all going belly up. Is why I asked about whether this is correct on all architectures. > > So the trade off is: > > a) churn the current interface for everyone > > b) add a user_ variant and know people will just get it wrong > > I was also explicitly asked not to proliferate too many new APIs. > Yeah simply spelling it out, not asking for a change. Probably no better way to go about it. ~Gregory