From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (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 E961B3E6DD4 for ; Mon, 8 Jun 2026 20:16:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780949818; cv=none; b=fXlhbDhxYQJ4YzYBTwJn5ARmSwjSXpfD5W/LYbU/CHlVtsJtK4IvIe2+FjVpIYOpxpG3vVLmfkqQHyXm6EJSCP+XHzeVB6XjnsgzfdrnWu2KjCu8hfcaSW0iOtksBwOymCDFCvwq19QFKLQK124HWjAqyVqHZa5cknPW3ya9uI0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780949818; c=relaxed/simple; bh=voJULOD6Bk4RPV8CLqcNAoUiGbKpXWPiJOWQF6KUr+g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bQYiIOdqwn2BL4jAvqHgTkaFa5U/GhoG3IGFalP2NqDCUZzmnwwp6c9Pm9m+nQEx6zXptj/XTxXKPm+h3qHTr5hX33n6w8Q3GfcIMDf99k33KlXXINrOZ3JOIL6DC0WLVlmfZvOLY0ZnxvDQ3ufpcFMc0vmrXHMALXu8BOpZzRM= 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=eEsQkSxD; arc=none smtp.client-ip=209.85.219.49 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="eEsQkSxD" Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-8ce9df31130so76976566d6.1 for ; Mon, 08 Jun 2026 13:16:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1780949816; x=1781554616; 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=5P0019yd+Yz79EK8psJPf72tTRfll1uVTKsf/rhDJ6c=; b=eEsQkSxD6mbiXL0RIiff2ZoCKZUfk+O2D3ZSTE10tECNNwcVj+tss2AxMdw2OdF8Wy oXTD+h1BqhGp977CSpKw2n+VXLraw3C+c9vk/V39gy8K+HbrmdgO8JWjTz3+5/fD6Xd1 tZWzC2vrOCTYxzt/VINNjekEXy886bXIrAVTF/7Q0oRBhpRqGOMCNRQVwV+zuTdTQBs7 JzdMJDvpim8yN+zlpaaWYy1CH6+DDpklv+0ryPvEyodj9AtbQRVUedKWN4+gagmrLBoT tmkFW9nslM8IL4EP5tJXL0S82TrsK8+hQDHvsvhCS7N+yclq1JA8fjSY8ZBlqjXAIkfi 4vhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780949816; x=1781554616; 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=5P0019yd+Yz79EK8psJPf72tTRfll1uVTKsf/rhDJ6c=; b=hiMg6AmeVTxfay9/v8GSQZMSZHuT9Px9i3hYrzOIFX9vrnC0/CL2IFKeVy5BstEmWD eE15umoJO/FFTg17d61fWdyYN/RakXnbZHNQdhmNhvcwCi/mFV5ywQ9GCrTaY1FydDNF hfvBNkGnuriKNAoAQoNBVl4F+abqf0N7Hm0s6IOmBHsfVxJz0tyEhg/MQTYfytI5W6l7 UwN1YQhktG5Z/uVyaR32LN4nXXQQwARV7n7OIjfVi74RAtx4XvRxp7FwfhjoIg3ykotN 1h0ND5q6wtUO5Qd0nuIbdOETodfaqHQXKPFQ2byjGhJslIk+7X56ghXgPqxWxOzHyv4q LRsA== X-Forwarded-Encrypted: i=1; AFNElJ8sEh+za+OTbCpwdI0WRZggQy+u7njiRw2EsNS5E5usc35rFlwyEr5egLBS25kwjCN9zow6eby5ujYnpxo=@vger.kernel.org X-Gm-Message-State: AOJu0Yzi0c19gEYBO3HBR0+mw+H4UhIkez6E5c067sSdW5JfhJY7l0jy DYwF28vzTuQpssQxkaahUWCXOcBnfQklNiN1+a8OyrrEukk4yBbdIPxQRy+0z7/m6ik= X-Gm-Gg: Acq92OHY400CPiQtv8bzxZ6TBvkL0M4lY6uS7aJZwQXRvpcKEmUt+eI9oMBNb12LM9i Nim23c8uTIkxMOOi4nbg1lugqEA3bKor/BYAF5sSIDJMrjNYpX1/xSA16t5KXqf/5z+4rottGq8 pWVY/qlyr+DwgYMzJTHdEAOFZptU9E5s3xL89NU3C/i0IdXhbJrpeV+H0eSiAvAlNTkv0zmYMyn 8B49MaJHXTovC/ARyMj/i2vcigaxr/J1C7kE0xv2Rb1hjbqi16jgWIaMc820NcJzjpSZFCCam08 5m5ThiQ9+3W1Ymlq22tfk9btvh42tGiDzoRUc9Ocve/w6l+eiaYNsfHvTZ+6GfpO2QNwGCH1uur FEcH6ZWAdoQZwkDHpy66Xys6YY75O7soHAfxJhvRcuUYVJryC8K6myju3OW08eodAjl5CQygb8d auMgCeP95rlTMO68VI2bvFlnbGvLjp31uCi2n8ZxSd3+j51Yfu3rWA1FbD+CZUE59LupmsNeRA+ c7lK+gscgLl69mR0g5yAJfXIvDY X-Received: by 2002:a05:622a:a6c4:b0:517:79f0:ae34 with SMTP id d75a77b69052e-51795bbfb19mr190530941cf.20.1780949815842; Mon, 08 Jun 2026 13:16:55 -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 d75a77b69052e-51775c4648asm177764561cf.10.2026.06.08.13.16.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 13:16:55 -0700 (PDT) Date: Mon, 8 Jun 2026 16:16:53 -0400 From: Gregory Price To: "Michael S. Tsirkin" Cc: 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 , 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: <20260608154354-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: <20260608154354-mutt-send-email-mst@kernel.org> On Mon, Jun 08, 2026 at 03:45:58PM -0400, Michael S. Tsirkin wrote: > On Mon, Jun 08, 2026 at 11:53:40AM -0400, Gregory Price wrote: > > > > If `user_addr` is now implying anything other than exactly: "This needs > > to be zeroed / caches flushed", then this is bad. > > > > ~Gregory > > Well if you do folio_zero_user in a non sleepable context then things > are not going to work. So combining e.g. GFP_ATOMIC and GFP_ZERO and > user_addr all together is not a good idea. > Can you say whether (GFP_ATOMIC | GFP_ZERO) w/o user_addr has the same issue? If not, then this subtle complexity is now a tripping hazard. Is there some combination of arguments here that should just outright fail if a user attempts it? > > You are saying it's bad? It's pretty fundamental to the idea of moving > zeroing into the allocator, I feel. > I'm saying having to infer that safety state from the cobbling of those things together is not a good pattern (at least as-is). If the introduction of user_addr into the mix is the thing that causes us to have to infer safety, then there's an argument the page allocator shouldn't handle that operation (in this case: user_addr cache flush). Please consider that this is arguably the most fundamental interface in in all of mm/. All we're doing is going through the process of figuring out what changes here are reasonable while trying to meet your goal. ~Gregory