From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F254B313E34 for ; Fri, 20 Mar 2026 11:37:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774006628; cv=none; b=Jf/3fJHVqpjTsBGLSWX/FyDfNfY1wCA61MOAi3caSY+exU7sgJ1KBn++XNlNt7U4rpKZ1tUTANsS/T1DHkKtqj6xm3WmzPdnrA9zr+QdG/Nv+mlc2DNOX29/TARMNpvQYfU9lkTO8vojiculCIZXti5QpMWEFEMSpfvoesuYlNE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774006628; c=relaxed/simple; bh=ODUX2J4py669jbR3MwFlsEzBfVh9nwBiRsgKM8tmtBM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Et9nE2nYoazr0w4fionCuunNHBb8aHxmzWRS8eQZytBPFvbDjGRBKCPHAp6RDJQZazKKFYVx5mjirwQ9SilCLWQ/CXp5rbMJ8P9RBnhsWBKpxDfTjFOhCqRrBlizkv7dxqxcdErRVQHDbretV3rvP/vRJ1zg8LSjoXutk3BEPSM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ATiMesD5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ATiMesD5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 082CDC4CEF7; Fri, 20 Mar 2026 11:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774006627; bh=ODUX2J4py669jbR3MwFlsEzBfVh9nwBiRsgKM8tmtBM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ATiMesD5y01atO3/tS3Hw5QUIcvIspmzjXBNvUHBDF4ttzIxVhVAIM+RZiryMqH0j em8L9FX0QnowlymU12ASvGnZsKMDaDGRGNx0WhWUmezu7eC/sfjiX8oyHPc7t9e927 q1AbpOZWH+m0lWlnqEEOHjAeoVWO7FaTUHLVY9YMDAboozyFjS5aDAfjT9NXB72Veo CBBHARERFsuQPgbX0z11B7Iv0ImW0kcfb97Zt/fnucfG3NT0QbIV+DzpYK0QYy13G3 kVpF6nYMRZt9V0adKOJ7b3ejPFT3SL3msJ3XERIcMdV9wlsSWM1oxQto6OR55n9jka S80mHWrVxEp0A== Date: Fri, 20 Mar 2026 13:37:01 +0200 From: Mike Rapoport To: Chenghao Duan Cc: pasha.tatashin@soleen.com, pratyush@kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, jianghaoran@kylinos.cn Subject: Re: [PATCH v1 2/3] mm/memfd_luo: remove unnecessary memset in zero-size memfd path Message-ID: References: <20260319012845.29570-1-duanchenghao@kylinos.cn> <20260319012845.29570-3-duanchenghao@kylinos.cn> 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: <20260319012845.29570-3-duanchenghao@kylinos.cn> On Thu, Mar 19, 2026 at 09:28:44AM +0800, Chenghao Duan wrote: > The memset(kho_vmalloc, 0, sizeof(*kho_vmalloc)) call in the zero-size > file handling path is unnecessary because the allocation of the ser > structure already uses the __GFP_ZERO flag, ensuring the memory is > already zero-initialized. > > Signed-off-by: Chenghao Duan Reviewed-by: Mike Rapoport (Microsoft) > --- > mm/memfd_luo.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/mm/memfd_luo.c b/mm/memfd_luo.c > index 5ddd3657d8be..413df8c75c1d 100644 > --- a/mm/memfd_luo.c > +++ b/mm/memfd_luo.c > @@ -103,7 +103,6 @@ static int memfd_luo_preserve_folios(struct file *file, > if (!size) { > *nr_foliosp = 0; > *out_folios_ser = NULL; > - memset(kho_vmalloc, 0, sizeof(*kho_vmalloc)); > return 0; > } > > -- > 2.25.1 > -- Sincerely yours, Mike.