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 5196C2F12DA for ; Sun, 26 Apr 2026 20:54:46 +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=1777236888; cv=none; b=pwLVw0RkeTLwFnq7gZ9f0KqtAt3akTQPTf7jVg95+MyGeuPkY5Wu7ZwrBLg6uwtBIV0RiNpWk1Y8K0Ty7YMGyml0eMwLJwcLKrOjmC0ZzCXPDkdW9s30ZB1HlCw+uiOLi+qZxnUoZroY8rbh0CP1JdgwUl406up7LBBYfM6HGUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777236888; c=relaxed/simple; bh=jNoc5WheHY4CCYh5RHGgtSgYu68JyP4sZul+uV4WPds=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fDoLSAdUNFKkNsE6zRPWZsmvVmQiGPzQ3WGGhW2tN3weulcQdclWD2XwTf5mqwAErujP++xHOT4WWP5nAJoViVfGAgei43z4W7/EEwMXlYlu13O+HfV/3lHqgjxFwz7alHh6Og+3Re8gmaTzyvKiJegtoOZbWX/LcD+qrFuwn30= 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=AsIJj3Bl; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=LX3BsBgR; 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="AsIJj3Bl"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="LX3BsBgR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777236885; 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=F7ngkkoYTFNaoszFfXjnqMQHnCI7xfB39TzmshJL6/Q=; b=AsIJj3Bl4555v1QiDKCLiynDZxxG/s/bmorNrGecz2yWnz7lwFcJ4SrgikwC1IwqiVH75M /CYGnfaHsTZTjSlV55RRPY7ZiIE1VdhD9LrEendEdL69cORZtC0LSfkobWmBYs7hQlcWxf cTzI0y+gr1RqC+laD4NW4FBZ4C7SRUA= 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-314-zbhSQ_gTPfOpGm0T2DiCkg-1; Sun, 26 Apr 2026 16:54:44 -0400 X-MC-Unique: zbhSQ_gTPfOpGm0T2DiCkg-1 X-Mimecast-MFC-AGG-ID: zbhSQ_gTPfOpGm0T2DiCkg_1777236883 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-488c2aa6becso87272745e9.2 for ; Sun, 26 Apr 2026 13:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1777236883; x=1777841683; 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=F7ngkkoYTFNaoszFfXjnqMQHnCI7xfB39TzmshJL6/Q=; b=LX3BsBgRyQwVz8AxrLY7Cw0ITSzvopTpKBU/i6A03sR87lS/dQg4lgmyR9I/SkTrDJ UJP8Z8h0N/dxaxpBEETxsWwhjcwJpERGvIeF36XDMSxBFps8MjdTdtWXKx0VicYlSrVy 7+HqF+mNZu29yPadCT1haDncVB7vfYhl+coNSw1d11B8lI8rd3fshsw3DU+niXRENcNM jrxgtgixKW6KEcpv/KyM89OLkIKV5ctVBf2XJIPApmKn3zvuejrH9SZB5uar/JgWv4s5 BidQL0b/zOlWHPdcjCpbf9Q4Uo/dGHa3tmKr+5O0aPkvUdBpaaUoeF7b9uLbhxyh+wk4 V21A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777236883; x=1777841683; 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=F7ngkkoYTFNaoszFfXjnqMQHnCI7xfB39TzmshJL6/Q=; b=L6mAz7M0SgaNeeqREidaN3lPJIv5W8zhHw/cO0uJh3XHJGQVvNc0qaut6us4ygS77Q cE6DDZrcTH3bUFYsI5V9xT1lUA7rOeF0AikLB4WA4ro0KNiIWK5g2NEhScv85AcgXvhj 6Ib60zzhY1MQ54cdWXsiAaF80Q8WLwHdwZpinAsxWeIPsmsHuEUdGd3pZCW1mUKK0U7H ZDKdeinYLgDFW9i2x7MuNezyblxz7htpptbCCqBTky8f53h//dLCXHCrU4CR74Xy/2Cd pZFtYGIBesRyZ5/9PfKquBmWBZx6pnmhX62xJeiPgw3EZfGLJxhvCVrb5gzMYcC//bcs kqTA== X-Gm-Message-State: AOJu0YyAbtn4UecdJhnuQNrNABWq4a2uTxxoF6mfYXhsyLnxhmOV8oT4 fP6jzRrFtOWyx8twSDkmgkZS8homPs1xGuVhzP1ZV4szPWzH7mIzktwsMZrcLPojn9SFRjq8KEg z/L6c0eA2r/CBJADziesb9EdC6OVzMhiS1msFrsQnT5mCHokyaxswDdcZPorfp3kpsg== X-Gm-Gg: AeBDievP3Wp66fgeD8hy4xZPDnSd9Cr2vW1JnZDjA9x7zZ1aoI2E+VSCFM0JKr4iAm5 iq+LhiVS9hzRPPvRAyXljTYIerJnGnX38OJlrSa14FjWGjDaD1vuCSCE3iXQaIvYIbIJs9aeY7Y tz/B7xCAa1eg3r3dF3DwNqi/it/ypc0NRsrtUoWZqnNXVSbSMJDX33XoY2vjw6OO/1+onP7+5qm Zu3oMo+BdqcD82ZPyEHUM8IGZUA4paul8QEDKTkhoK4cP4+xoMmGzHp9tKrZSHEYbRIgPTi8xIm HzcVkERSFUfL2D8RGNGLxC9rwmUA0xU6swIjadmNQ8u+1Krw2RCvbv0oaUUGxJkqCIb0mojbYr9 Z4tGbU9ulAm6G20WAdv5ycHhItnqbpDU2Ckii09KsLi3RAHBM140L2EUQ X-Received: by 2002:a05:600c:3e0d:b0:489:6c28:dbc6 with SMTP id 5b1f17b1804b1-4896c28dd4emr413474175e9.31.1777236882613; Sun, 26 Apr 2026 13:54:42 -0700 (PDT) X-Received: by 2002:a05:600c:3e0d:b0:489:6c28:dbc6 with SMTP id 5b1f17b1804b1-4896c28dd4emr413473955e9.31.1777236882086; Sun, 26 Apr 2026 13:54:42 -0700 (PDT) Received: from redhat.com (IGLD-80-230-47-179.inter.net.il. [80.230.47.179]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a5c24d82asm164063795e9.7.2026.04.26.13.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 13:54:41 -0700 (PDT) Date: Sun, 26 Apr 2026 16:54:35 -0400 From: "Michael S. Tsirkin" To: Matthew Wilcox Cc: linux-kernel@vger.kernel.org, Andrew Morton , David Hildenbrand , Vlastimil Babka , Brendan Jackman , Michal Hocko , Suren Baghdasaryan , Jason Wang , Andrea Arcangeli , Gregory Price , linux-mm@kvack.org, virtualization@lists.linux.dev, Johannes Weiner , Zi Yan , Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport , Muchun Song , Oscar Salvador , Baolin Wang , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Ying Huang , Alistair Popple , Hugh Dickins , Christoph Lameter , David Rientjes , Roman Gushchin , Harry Yoo , Chris Li , Kairui Song , Kemeng Shi , Nhat Pham , Baoquan He , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH RFC v3 01/19] mm: thread user_addr through page allocator for cache-friendly zeroing Message-ID: <20260426165330-mutt-send-email-mst@kernel.org> References: <9dd9deabd42801f3c344326991d1431c3d8db39d.1776808210.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 Fri, Apr 24, 2026 at 07:41:03PM +0100, Matthew Wilcox wrote: > On Tue, Apr 21, 2026 at 06:01:10PM -0400, Michael S. Tsirkin wrote: > > Thread a user virtual address from vma_alloc_folio() down through > > the page allocator to post_alloc_hook(). This is plumbing preparation > > for a subsequent patch that will use user_addr to call folio_zero_user() > > for cache-friendly zeroing of user pages. > > > > The user_addr is stored in struct alloc_context and flows through: > > vma_alloc_folio -> folio_alloc_mpol -> __alloc_pages_mpol -> > > __alloc_frozen_pages -> get_page_from_freelist -> prep_new_page -> > > post_alloc_hook > > I don't like this. I think we should instead lift the zeroing from > post_alloc_hook() to the callers of __alloc_frozen_pages(). can you and david agree somehow? I don't like being caught betweem maintainers like this. > I don't understand why you want to remove the double-zeroing of memory > when the user has asked for zero_on_alloc. They asked for stupid things, > let them bear the cost. it's just a side effect. I did not even test what effect it has. what I care about is the overhead with reporting.