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.129.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 BB34D3E7152 for ; Mon, 8 Jun 2026 19:59:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780948745; cv=none; b=cxeEhC6nMwojcVJVkQREaLgEoXlNQHdmdAYqjwR7XfRSJZcuvAsXoN4eUtuAv2jL+uzvTiexZzdGFgqef9ZroMGx5gXOoCLuMaEep68fQE6ph5mh1ZHURZH/9uIGBmnwidLnip/OjURSudnMA6gdFsIrP71a+lksXm0+6/M1VT0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780948745; c=relaxed/simple; bh=qiwIhtw7NmMcaCXTfNudfYlEPNd416ZpKyvIlCb5FKM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qpOFXeYnCXSHKHAs6HFD7QGA0j0iPN7u33elRi8ky+Gmn51W3PBAtMgxMndq+zkp58uVB6C6iV/GDSC+ds26As7tUV7SAL6dOApRgJoww5/hCIuV17qB9TaQLJIkOdJaPyBj4rEdqZKkCtz1Ot//sFLIj8gCdNCtuwRmrCUjdfY= 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=Xe2ZHjqT; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=LaTCGaN4; arc=none smtp.client-ip=170.10.129.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="Xe2ZHjqT"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="LaTCGaN4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780948743; 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=eqSTEGK8xl8EZeqE74tv6zlFs8hlnJlJcde7w58YuZs=; b=Xe2ZHjqTZy9O37zwqM0MIGsnQxasFGJLb5+XxZpXyNHa0iGB+bJwR2zyyPsqPnxloT77sP NuQFriXBO5/jPeZSh6Q0c4fCi4die3Lz9wcsBVMzmrxUZxLPKLBrG8YpgcDY4I93rH3Uob RrRnCW1xt5R6wZT6sojHPyUyp4/rAjw= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-SiroPwB4Pyax2O3DYZi40A-1; Mon, 08 Jun 2026 15:59:02 -0400 X-MC-Unique: SiroPwB4Pyax2O3DYZi40A-1 X-Mimecast-MFC-AGG-ID: SiroPwB4Pyax2O3DYZi40A_1780948741 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-460153ce644so3372672f8f.0 for ; Mon, 08 Jun 2026 12:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1780948741; x=1781553541; 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=eqSTEGK8xl8EZeqE74tv6zlFs8hlnJlJcde7w58YuZs=; b=LaTCGaN4ShDv6WeFe82YCrF7XFWaYgDyZE4YVX2C4/khXzl16g1r320qrlsBNRUZ/U gL0kDjGRzabLr7Wow0tzG+pL9U1i8iFvqyDRR5fmIR+FvB3BAlJNf7o/EwRxuZqvqZbq cNl7VkAVlyMtgSP//PcdDcDcZGu8r+cBBFTrTcEOLGIgBycOlOwerm1mi8JkU82Iq/Xc 8m0uxIoSyXntSOuU0GvldF0PIjChB5+LOhN0u9gOdMGzpWEfZ32jBnLY0Az85HtgL0R+ PtqVozW249sGAhY0YYpH3k9YxLb7Ad5TxJaT1Ps6QmKigSCZuyRgydeGN7nJJ7DQ5tcb sZwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780948741; x=1781553541; 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=eqSTEGK8xl8EZeqE74tv6zlFs8hlnJlJcde7w58YuZs=; b=M0YcC0iD0xEiMoP2yWfpa77oP8owhDiG/T8DrFtxWJX38AXKP2TpD8x4TnUj3/Bv3p xXa7B2JGytc3I21zbq7I3N/pAQx0vECjT7M+ehio13J5tUOkx9HeL+ppXd6NOzyky5gw QAya/wEwBMuBGVWmFD/wBAnTwcuYM0q8gTrc/3ACCTyhKkXlsPOwbvUCIuuEvptwzW9J pewAyHUGvVWyYdjSPaqjT5y+YrRZOrpDs1/UmAjEFPW/+40x1D/0WrfgSDcU82mA1zhy cwcNQCSaQIwYPetgQe906h5CyZt2A6qYb6yijkSFgynjBdsTJR8KvKWuSRjGRoZY+3pH TPEQ== X-Forwarded-Encrypted: i=1; AFNElJ82VL6oxy1sniaaqvqozI70sa4RUpx8Jka7AOBuojWRfQAgR/CoImx0GQtogjR/vumSHhjfM3aZ4WugYvA=@vger.kernel.org X-Gm-Message-State: AOJu0YyN+R4U5oie4rqBgcgMB+ITceyB9PJWabnswEIhlFDtBKOH59ch 2UxpYvTYjUQ0Zj0PCSbDg/wuYUTv++zauq0lfj7YaCq7YJDBswyo7jTkfRItCLw2Nhmt47C2UGG 853aE7x4AedWkhRjsGCnWHBKxFykwhweWzKHRa2/sfVVNhpHKw0cYXuvkAmjZA5FB7A== X-Gm-Gg: Acq92OG0xJU3UDBMnAQECg/7d5ZDPElmnm+Sw4GeAzMn9qYmh4kt/VcIm6ha2Mk8GPK SlDExRRMU0We75mctw9hftQoFyXo/hx0TOu6BhRDOVvcGsyvNlno650xL7NJTyoruSwwgVs5tvo KlrACukBLqEDoaRBGqWeNwbeV04hKft0pj1upBNdRtjdHAwyVNj4slmnPBOn0MBB7gZRF/ps4Ve g6CkJDjDdQjYEfhG2CGchA2cQSFaxihA9miKV7hZt/bU1uLS/9di1uW3HxCUyafuNISKT0+b5DL ziYxxiohmftDn5T5/UTsr8dombiWWh+CgfSw7qBgIaTQKMz6lpLUTV8/zWJ/KX63UMOKJ9QepZ5 Ehs2Sl2qBYqOeR3TObTCjQu1s3JllaAJl1W/iR4YNIgnvzMMQP4DU2g== X-Received: by 2002:a5d:4d0b:0:b0:44b:5398:4e85 with SMTP id ffacd0b85a97d-46030502519mr19992688f8f.22.1780948741112; Mon, 08 Jun 2026 12:59:01 -0700 (PDT) X-Received: by 2002:a5d:4d0b:0:b0:44b:5398:4e85 with SMTP id ffacd0b85a97d-46030502519mr19992648f8f.22.1780948740596; Mon, 08 Jun 2026 12:59:00 -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 ffacd0b85a97d-4601f351d40sm54186487f8f.26.2026.06.08.12.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 12:59:00 -0700 (PDT) Date: Mon, 8 Jun 2026 15:58:54 -0400 From: "Michael S. Tsirkin" To: "David Hildenbrand (Arm)" Cc: Lorenzo Stoakes , linux-kernel@vger.kernel.org, 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 , Gregory Price , 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 24/37] mm: add put_page_zeroed and folio_put_zeroed Message-ID: <20260608155520-mutt-send-email-mst@kernel.org> References: <8ec82477-b497-466c-902b-82e108ae2b7b@kernel.org> <20260608100602-mutt-send-email-mst@kernel.org> <497dff41-e831-43a1-a56b-a6ab98bc11a3@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: <497dff41-e831-43a1-a56b-a6ab98bc11a3@kernel.org> On Mon, Jun 08, 2026 at 04:28:48PM +0200, David Hildenbrand (Arm) wrote: > On 6/8/26 16:08, Michael S. Tsirkin wrote: > > On Mon, Jun 08, 2026 at 02:46:34PM +0200, David Hildenbrand (Arm) wrote: > >> On 6/8/26 14:25, Lorenzo Stoakes wrote: > >>> > >>> Do not put comments about specific expected races like this in the commit > >>> message but not in the code. Subtleties need to be called out. > >>> > >>> The commit message also doesn't at all explain why PG_zeroed doesn't > >>> suffice here. > >>> > >>> > >>> I really don't understand why you have a 'zeroed' folio flag but need to > >>> also have new API calls to detect that? > >>> > >>> They're also HORRIBLY named. Zeroed as in what? Zero page? Huge zero page? > >>> Memory zeroed by kernel? Pages that userland happen to have zeroed? Or host > >>> VM zeroed? > >>> > >>> Each are cases we address individually and relate to folios. > >>> > >>> You absolutely fail to clarify _which one_ you mean, and provide absolutely > >>> no documentation and add an exported mm API with no description. > >>> > >>> This is just I think not something we want to add? Especially on something > >>> so fundamental? > >> > >> I raised previously that providing a folio helper is odd, and that I suggested > >> that we defer this change. > > > > Sadly it's a dependency actually - without it memcg failures would cause > > repeated re-zeroing where previously it failed without zeroing. > > Oh, you mean that we succeeded allocating (+zeroing) but failed to charge? > > I don't immediately see that to be a real problem? Yes exactly. I don't really know if any real applications live close enough to memcg edge that repeatedly wasting cycles zeroing pages then discarding that information will be noticeable. I should be able to write a test to show the difference, if that's the question. So just writing code in a way that we are not regressing them seemed cleaner to me. But I'm not a maintainer so hey. Just so we are clear. -- MST