From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 22C36312832 for ; Mon, 8 Jun 2026 15:53:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780934025; cv=none; b=EzKd4mFdI4FmYTFZHkJMyN4aBu76si+q6erQpKFwtP9Xmi139OECbM4PN9GyHtEyh3Bt6RNNLK9UEEftylcpScPw3q3mXAtvxMjzmRyAMLlTRXUwQmCjVJj0CDSoHctR1+HkWzhffMjCy7BNXMnEYH7poGMNalsykRck/8fGW9I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780934025; c=relaxed/simple; bh=eHM9J9p6LiPDM1cCsLghpx82/BPSwbww5tvhH9MP7GA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hnCSD7lr3MeevhNyieDnEC1AVDREcMGlaqFjlOmxmD69ed5OtfjH5kz5a9DQwfr8nxbfWjEqmf6NbCu6eqt88nDV/Oq8r12w1/sM80Nj/3nyq5j/gsjTyRN5GAzHfHkWzyewXWOdiaMYbh1T8BnWEatlHM/kzLXR5L9ORgNeHsM= 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=UEOX23nc; arc=none smtp.client-ip=209.85.222.177 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="UEOX23nc" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-9158c621ebbso540227285a.2 for ; Mon, 08 Jun 2026 08:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1780934023; x=1781538823; 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=TE9J+WgrCGKOabTk6u8XUcIRp2nQnN2zdp+a9uxxJ3k=; b=UEOX23ncJy0uaI9WxgHFtZ0FERauO14EeBl8+dahQLp/yyK3AQUZ9HyCKdWLFiPgh9 /1h9rtnWFMg4Qefs8JNiPO5wOVyn3dUEBvROJUCJlpdQeJspPU7gtGBC5dbrJnbSYrWb CpuMA82i7Uuqp90QV5H08QQKMgRScNCj8rQ8H9nBVsbX9mYP/0KQGmnqjCRs48Matj+M EPheRWcFikp5fplm3GFO4PdCxYaYcjIp+TDS2jjcR8PfuS5pTBZLpEXOzcrzq14ZQv6M TUxLkaIwc+h7RoOEys4YfzU8jOPE1T7i63jH3aKb/MPIClKhV20AMZr71PMCvaifEDPM OVhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780934023; x=1781538823; 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=TE9J+WgrCGKOabTk6u8XUcIRp2nQnN2zdp+a9uxxJ3k=; b=PdMqazDj9QrI5IDiFEmtL1ukiA4d93TSBceyv4fS2CdjqLhhKJhTLBDxpcco28xKzb zOw8L6UuVqN2e8JtAj+9u9IcODlV4g01o7CrBZaSqwf0UcuXM7faPrw6bYCMHK/R8sQi 6yJtxi5nAMuZe9Xwaf5yXrOOv4F+lBBdiIjcrKtdmAN/mmBBqisKLbjslkpfHPOAnxx9 KQE7HWa0sYB+V+9CXIlV7UwewQXzp6gR1XpbBAh5L+CYTQFfH2xbatjAODc4YmqMAdek 0Bx3o6krFwWxgiZMyWqL2Y4rYtfu4096q8OFyBfS8JKDmqex4oYOfMhUl1E4HhrchXuP mB7g== X-Forwarded-Encrypted: i=1; AFNElJ/yIBx0+fPZuYIyneLpKEef0W0E87vPpxXk9VkaJ9vyFJAtvuvj3m3DBP1VTNsFkriNXWCLuUqwUNfTuNY=@vger.kernel.org X-Gm-Message-State: AOJu0YxjONpBZUmO9/K2lOrJqGT/wvV0W9Cc50qhvg4c4gjwqt5/WgCH NQ1diT6aU11uOsfSkPb+kNvKRHeNUcu0kckV5NHICCoW3ZH9qxUYkQ146sKWmJeQoBo= X-Gm-Gg: Acq92OHhsdJ5h99xF2D4Qk2VQMBGYH3GFZi2I1Y54DOP51BdQyBnOYcTRC9gYnBfShS HsBOKcL4Y9BW3lvMzcHuWzhdM7Jarr9fdO6AuMSu4TxfePRgioH5EvDzJnkBPQ1nwtGjpwwfTwD KSZ6Kwj1oZDCEL1nMwl5f2XWEprzKKgirEjPSoJmsadnb+nlX1aJ/d/YZm/rdtQXtjSOCy85v/y 3D79EYh/fbWR2i1ecWufXGJw3e0mecsPIQyQjP7MXIf4cozOzv1irLvnqmDKVm+5hRyJ6d6sbHx tx4yBrCr/RROVuMXf2+7nufDcxB+LQLvSjyl9ps/y4p6fOZeO2YtNO0Ii2w9wUSu71TbCjrPy++ LZQbDhzF9JIDQg6b5qzmFEPN3DqLeE3QxmpPDnnfdq1S8Ky62ZeCGPu8wjpJbJ5Yo1dwycG0NAP pw+pTiiG0DzBnubMBannu+WNeLXbwoKiqXC0Tc0+zNg9FQTkeTev49ywIbRyOnZIwQ1S7CpBjKP 6QhLpDC4ObE8j3Adg== X-Received: by 2002:a05:620a:a407:10b0:915:745a:70fe with SMTP id af79cd13be357-915a9d763c3mr1868020985a.28.1780934023069; Mon, 08 Jun 2026 08:53:43 -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-9158a37bcd6sm1798163585a.25.2026.06.08.08.53.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 08:53:42 -0700 (PDT) Date: Mon, 8 Jun 2026 11:53:40 -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 12/37] mm: use folio_zero_user for user pages in post_alloc_hook Message-ID: References: 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 12:23:07PM +0100, Lorenzo Stoakes wrote: > On Mon, Jun 08, 2026 at 04:36:38AM -0400, Michael S. Tsirkin wrote: > > > + * user_addr != USER_ADDR_NONE implies sleepable > > + * context (user page fault). > > Can you safely assume that? Also inferring which context we are in from this > parameter seems risky. > > It seems to me that you're now making it such that kernel developers: > > - Have to know when and when not to specify a user address, and under what > circumstances we might consider that to be mapped. > > - Need to know to do this correctly for aliasing architectures or have silent > correctness issues. > > - Need to take context into account when specifying this. > > We definitely need to find a simpler way to do this! > This feedback was poked at in earlier versions. There's a tension between keeping the old interface as-is, having explicit interfaces for something like this, and the state of a page inside the allocator vs outside. Double-plus complicated by the fact that we're trying to reason about two allocators at once: host and guest. It seems it has gotten a bit more complicated since then (I missed this "sleepable context" bit, not sure if it was there on prior versions). If `user_addr` is now implying anything other than exactly: "This needs to be zeroed / caches flushed", then this is bad. ~Gregory