From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 812EB2BB1D; Sat, 23 May 2026 17:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558888; cv=none; b=mIKbWpTgzXl4tp08HLppYIZVtN1Q3x54uY62MWBJXfk0iEkseFonWsqO6v8FT1GWieysvUe3+S6FyPkPwFU6vqfDbX1vOyhD/hqgDqWiMRxK3Fkc1qn20kBE0Cr+zSr9LIxcEgHO0OpZZnB7FKPfb2XktCT+YLktDRNo0l5onPs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558888; c=relaxed/simple; bh=r0cd8m/9lPWo3zUY7DznvxrgWtjRfjZqyn47CNuIbBw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ch3OuzPUGE9j1flY1QkNYodUsLVd51skmmb99kAQ2ZaCPbJEQK9pM7Hp99SRzMLyZ/3UQnJ8PRwjqAwVOOgc6kjGs6np7SfXqtg6/VIVLKuR/x/TJ7Ir6aPX0drzR1bY59Q/5M7Zpr8xfVOjra8q8GIv49pkJzGGvICyITE4FFo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=entiYHeQ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="entiYHeQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 644EE1F00A3A; Sat, 23 May 2026 17:54:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558887; bh=xNqONibNib/HURDSoCRdl8F/ugaDRVHwkYT5A3d+6K0=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=entiYHeQKdJpCq2RAkO9V3DfpsOkdAweTN9otxUQ+O8vgrrn4uoBnmky9dnsr9Fbx m4wuzqZzR5kX+E9pPoVCmlFVpTAW11ZEZACAYWQV4RjU+r1ZFA22q8b2P5ph0C7YXK 1DXqT1uS77S65UKLbwRFPf6L/4TWqrNbTww9gtbYR5ZfBcfDx1tVRapQXmJMHH+5Qk n8XIwq073N7B/vc1ZNlgL3xUnvihMimNGqIBpzEqFqEavTPULAoZuVZjF7WDOvBjeD PUHEN8u42mw/tjliBBXnMPRf2hgPurks8kLmsMdUGiyYXv57Cm7/XiWGt/T2OaWkqZ RFoyBRXH51pfw== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:13 +0300 Subject: [PATCH 01/17] quota: allocate dquot_hash with kmalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-1-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 dquot_init() allocates a single page for dquot_hash with __get_free_pages(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_pages() with kmalloc() and get rid of the order variable that remained 0 for more than 20 years. Signed-off-by: Mike Rapoport (Microsoft) --- fs/quota/dquot.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 64cf42721496..9850de3955d3 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -3022,7 +3022,7 @@ static const struct ctl_table fs_dqstats_table[] =3D { static int __init dquot_init(void) { int i, ret; - unsigned long nr_hash, order; + unsigned long nr_hash; struct shrinker *dqcache_shrinker; =20 printk(KERN_NOTICE "VFS: Disk quotas %s\n", __DQUOT_VERSION__); @@ -3035,8 +3035,7 @@ static int __init dquot_init(void) SLAB_PANIC), NULL); =20 - order =3D 0; - dquot_hash =3D (struct hlist_head *)__get_free_pages(GFP_KERNEL, order); + dquot_hash =3D kmalloc(PAGE_SIZE, GFP_KERNEL); if (!dquot_hash) panic("Cannot create dquot hash table"); =20 @@ -3046,7 +3045,7 @@ static int __init dquot_init(void) panic("Cannot create dquot stat counters"); =20 /* Find power-of-two hlist_heads which can fit into allocation */ - nr_hash =3D (1UL << order) * PAGE_SIZE / sizeof(struct hlist_head); + nr_hash =3D PAGE_SIZE / sizeof(struct hlist_head); dq_hash_bits =3D ilog2(nr_hash); =20 nr_hash =3D 1UL << dq_hash_bits; @@ -3054,8 +3053,8 @@ static int __init dquot_init(void) for (i =3D 0; i < nr_hash; i++) INIT_HLIST_HEAD(dquot_hash + i); =20 - pr_info("VFS: Dquot-cache hash table entries: %ld (order %ld," - " %ld bytes)\n", nr_hash, order, (PAGE_SIZE << order)); + pr_info("VFS: Dquot-cache hash table entries: %ld (%ld bytes)\n", + nr_hash, PAGE_SIZE); =20 dqcache_shrinker =3D shrinker_alloc(0, "dquota-cache"); if (!dqcache_shrinker) --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 031B52BB1D; Sat, 23 May 2026 17:54:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558896; cv=none; b=HGocYCCnP1uwqDFzGq35kKVHixvqHrPmyflKgQpLPcH927sF7Vf69+bbIG8WDFC7idwpkgAZZJaeXCxYm2DIxFW5X5/CZcaCxpWCLm19jLW4UkKh/cgHv5hsXc1nnkbX4psx7HRcBH3Qyfr8Md1m0qghncxy2OIK+mZUNq/WhMs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558896; c=relaxed/simple; bh=zjzC6WZgyCQNvgmUsQfpb6/kcemhlapPaIznXJ6qDpY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kYRWohvpnpnD3UW/Hb8/VQ6vrbjEbxT9SQGUULr3Nh2TqRp9oeTMUB05B173dageRqe5kTweqRBUbRb6fNCp/6Ekyi2/dnTCnPkLUCrliZ+1GNOqGndQa/52t3k8OGEBkvPaUXwYGg5hPozhg4T63ZU1xE6ZO0dyzhjh6mFspfw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bGH8ECXZ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bGH8ECXZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D93D61F000E9; Sat, 23 May 2026 17:54:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558894; bh=7bBokGp6YKVtCQZrud5e4II/4wZ3rZBymvn2I3mXFbw=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=bGH8ECXZQWVB8xYKDY/34dL7P/Mpormzto6UFwYqmQQ8V7u/iWPHMQTPBkPItAfkE JYt1o4Cf3CN+cxfmAzr35RKANhG/cmjfmksUsM7WzHVSpgYMHN3Gf0ZuFv44EHsQkG 5c6hR6iM1fBLLGWl1087vym9DDLVALaOOffnORm0ZfnH5ybe1PyWRRQEeu90AKgoDB Jw2dFEijdb+pzOPHlcGU7KJWjzyYOiV43iwFqaQc4PwA8Zbp5ATunapeAj83YgVs7z H3BqQnMH2LDOG2MvAZHZvX6Ua6wiohmfMIA9nYPkFYfAuWtOIlr24mdMezTmn2Hvz9 pETrQg4iAiu/A== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:14 +0300 Subject: [PATCH 02/17] proc: replace __get_free_page() with kmalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-2-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 A few functions in fs/proc/base.c use __get_free_page() to allocate a temporary buffer. kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_page() with kmalloc(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/proc/base.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index d9acfa89c894..e129dc509b79 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -261,7 +261,7 @@ static ssize_t get_mm_proctitle(struct mm_struct *mm, c= har __user *buf, if (pos >=3D PAGE_SIZE) return 0; =20 - page =3D (char *)__get_free_page(GFP_KERNEL); + page =3D kmalloc(PAGE_SIZE, GFP_KERNEL); if (!page) return -ENOMEM; =20 @@ -284,7 +284,7 @@ static ssize_t get_mm_proctitle(struct mm_struct *mm, c= har __user *buf, ret =3D len; } } - free_page((unsigned long)page); + kfree(page); return ret; } =20 @@ -347,7 +347,7 @@ static ssize_t get_mm_cmdline(struct mm_struct *mm, cha= r __user *buf, if (count > arg_end - pos) count =3D arg_end - pos; =20 - page =3D (char *)__get_free_page(GFP_KERNEL); + page =3D kmalloc(PAGE_SIZE, GFP_KERNEL); if (!page) return -ENOMEM; =20 @@ -371,7 +371,7 @@ static ssize_t get_mm_cmdline(struct mm_struct *mm, cha= r __user *buf, count -=3D got; } =20 - free_page((unsigned long)page); + kfree(page); return len; } =20 @@ -908,7 +908,7 @@ static ssize_t mem_rw(struct file *file, char __user *b= uf, if (!mm) return 0; =20 - page =3D (char *)__get_free_page(GFP_KERNEL); + page =3D kmalloc(PAGE_SIZE, GFP_KERNEL); if (!page) return -ENOMEM; =20 @@ -949,7 +949,7 @@ static ssize_t mem_rw(struct file *file, char __user *b= uf, =20 mmput(mm); free: - free_page((unsigned long) page); + kfree(page); return copied; } =20 @@ -1016,7 +1016,7 @@ static ssize_t environ_read(struct file *file, char _= _user *buf, if (!mm || !mm->env_end) return 0; =20 - page =3D (char *)__get_free_page(GFP_KERNEL); + page =3D kmalloc(PAGE_SIZE, GFP_KERNEL); if (!page) return -ENOMEM; =20 @@ -1062,7 +1062,7 @@ static ssize_t environ_read(struct file *file, char _= _user *buf, mmput(mm); =20 free: - free_page((unsigned long) page); + kfree(page); return ret; } =20 --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 D28C93191CA; Sat, 23 May 2026 17:55:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558904; cv=none; b=D5+dy40wzbS5mEuV02joTFAE1vklX/5/2pLznowoEhOBRRyZTPVnh+NJl46D1DUco0Lxj76edniqXMNHJ0zRl5WCvG/8BFl8g4hT5ZYJUm2KF2rWrzQwGk8wxsedKAgRzD9/l8yglPw/5PdvX8Zy4XATR4ffGzyYvNF/iXNP5fw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558904; c=relaxed/simple; bh=Vsd/wl1Tn0vzabGFFmOePP1xPlA5IcmcVVYveD8+Ib0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G/uCFUsuN2xnSFvHNAicgp/uKdGS+H7vBBOeTlM1ERS6mW8XP93MzhvwvIrqAQIoL5L243lzscKQH222SF0hVftt6QsS+kEbCcIcRXWD1EYeadJ9WWiTGVVOqp5HuZqeVNzt0XvI61qZEBFAzxcXwTIUoFjNi1P2MNNv1CeGpxI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=I7p9Lyua; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="I7p9Lyua" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B0E71F00A3A; Sat, 23 May 2026 17:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558902; bh=ITTiAQYd8mEQisPL9MCYMPbpKSqI/TuCeLpOsMIzCQI=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=I7p9LyuaY2ah6+I6CPot4PjChnihlTibi2SZ7+Ut7FOot90SlZtu+2clc390PgyyZ 9agzHx48psjaHZps3KSB/WOFgnxbJlsqb6/JLVfZdNfGceJ2Y9XcD86fjETSGQdG3g tKxIwd0x8Muwi4LWLDAtmpaPdQEJwZOXx6WyPNSbmE+u5QAgYaH89YA3aDsPYLEc0F PjqkH50UzUw1A3SKAhs1BhctyTes5QQ7FF41TMFoGMlhxOlWaVHTLMocXy3NuVP8dg 4SHkhHKEWrGrwrUVSXBb1eQNbTsp+le/+0d8UdKFZomhr8PP97eaoRyEAUgjIKv34e F2p7cOefs7OLQ== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:15 +0300 Subject: [PATCH 03/17] ocfs2/dlm: replace __get_free_page() with kmalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-3-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 A few places in ocsfs2 allocate temporary buffers with __get_free_page() or get_zeroed_page(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_page() and get_zeroed_page() with kmalloc() and kzalloc() respectively. Signed-off-by: Mike Rapoport (Microsoft) --- fs/ocfs2/dlm/dlmdebug.c | 24 +++++++++--------------- fs/ocfs2/dlm/dlmdomain.c | 8 +++++--- fs/ocfs2/dlm/dlmmaster.c | 5 ++--- fs/ocfs2/dlm/dlmrecovery.c | 4 ++-- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c index fe4fdd09bae3..6ca8b3b68eef 100644 --- a/fs/ocfs2/dlm/dlmdebug.c +++ b/fs/ocfs2/dlm/dlmdebug.c @@ -260,10 +260,10 @@ void dlm_print_one_mle(struct dlm_master_list_entry *= mle) { char *buf; =20 - buf =3D (char *) get_zeroed_page(GFP_ATOMIC); + buf =3D kzalloc(PAGE_SIZE, GFP_ATOMIC); if (buf) { dump_mle(mle, buf, PAGE_SIZE - 1); - free_page((unsigned long)buf); + kfree(buf); } } =20 @@ -280,7 +280,7 @@ static struct dentry *dlm_debugfs_root; /* begin - utils funcs */ static int debug_release(struct inode *inode, struct file *file) { - free_page((unsigned long)file->private_data); + kfree(file->private_data); return 0; } =20 @@ -327,17 +327,15 @@ static int debug_purgelist_open(struct inode *inode, = struct file *file) struct dlm_ctxt *dlm =3D inode->i_private; char *buf =3D NULL; =20 - buf =3D (char *) get_zeroed_page(GFP_NOFS); + buf =3D kzalloc(PAGE_SIZE, GFP_NOFS); if (!buf) - goto bail; + return -ENOMEM; =20 i_size_write(inode, debug_purgelist_print(dlm, buf, PAGE_SIZE - 1)); =20 file->private_data =3D buf; =20 return 0; -bail: - return -ENOMEM; } =20 static const struct file_operations debug_purgelist_fops =3D { @@ -384,17 +382,15 @@ static int debug_mle_open(struct inode *inode, struct= file *file) struct dlm_ctxt *dlm =3D inode->i_private; char *buf =3D NULL; =20 - buf =3D (char *) get_zeroed_page(GFP_NOFS); + buf =3D kzalloc(PAGE_SIZE, GFP_NOFS); if (!buf) - goto bail; + return -ENOMEM; =20 i_size_write(inode, debug_mle_print(dlm, buf, PAGE_SIZE - 1)); =20 file->private_data =3D buf; =20 return 0; -bail: - return -ENOMEM; } =20 static const struct file_operations debug_mle_fops =3D { @@ -775,17 +771,15 @@ static int debug_state_open(struct inode *inode, stru= ct file *file) struct dlm_ctxt *dlm =3D inode->i_private; char *buf =3D NULL; =20 - buf =3D (char *) get_zeroed_page(GFP_NOFS); + buf =3D kzalloc(PAGE_SIZE, GFP_NOFS); if (!buf) - goto bail; + return -ENOMEM; =20 i_size_write(inode, debug_state_print(dlm, buf, PAGE_SIZE - 1)); =20 file->private_data =3D buf; =20 return 0; -bail: - return -ENOMEM; } =20 static const struct file_operations debug_state_fops =3D { diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c index dc9da9133c8e..97bb9400e24b 100644 --- a/fs/ocfs2/dlm/dlmdomain.c +++ b/fs/ocfs2/dlm/dlmdomain.c @@ -63,7 +63,7 @@ static inline void byte_copymap(u8 dmap[], unsigned long = smap[], static void dlm_free_pagevec(void **vec, int pages) { while (pages--) - free_page((unsigned long)vec[pages]); + kfree(vec[pages]); kfree(vec); } =20 @@ -75,9 +75,11 @@ static void **dlm_alloc_pagevec(int pages) if (!vec) return NULL; =20 - for (i =3D 0; i < pages; i++) - if (!(vec[i] =3D (void *)__get_free_page(GFP_KERNEL))) + for (i =3D 0; i < pages; i++) { + vec[i] =3D kmalloc(PAGE_SIZE, GFP_KERNEL); + if (!vec[i]) goto out_free; + } =20 mlog(0, "Allocated DLM hash pagevec; %d pages (%lu expected), %lu buckets= per page\n", pages, (unsigned long)DLM_HASH_PAGES, diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 93eff38fdadd..aee3b4c56dcc 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c @@ -2548,7 +2548,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm, =20 /* preallocate up front. if this fails, abort */ ret =3D -ENOMEM; - mres =3D (struct dlm_migratable_lockres *) __get_free_page(GFP_NOFS); + mres =3D kmalloc(PAGE_SIZE, GFP_NOFS); if (!mres) { mlog_errno(ret); goto leave; @@ -2725,8 +2725,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm, if (wake) wake_up(&res->wq); =20 - if (mres) - free_page((unsigned long)mres); + kfree(mres); =20 dlm_put(dlm); =20 diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index 128872bd945d..9b97bf73df22 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c @@ -837,7 +837,7 @@ int dlm_request_all_locks_handler(struct o2net_msg *msg= , u32 len, void *data, } =20 /* this will get freed by dlm_request_all_locks_worker */ - buf =3D (char *) __get_free_page(GFP_NOFS); + buf =3D kmalloc(PAGE_SIZE, GFP_NOFS); if (!buf) { kfree(item); dlm_put(dlm); @@ -933,7 +933,7 @@ static void dlm_request_all_locks_worker(struct dlm_wor= k_item *item, void *data) } } leave: - free_page((unsigned long)data); + kfree(data); } =20 =20 --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4657D2EA754; Sat, 23 May 2026 17:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558911; cv=none; b=cI8TpjcSAAJxpv0l3Gm8ddlrb4wccLVlKV5j5Md64qGbjIVd2ppjkVqnMLz6JxhhkfOCZWfv64jZGUPw2ct95IHtOZ2Zr+ouks/drRC1uzge0kZsSfg70NpchTY+H0GEmPrAn0BKPxl3b04dRNqKCGqw+aYjTMw3JInYIhhCDec= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558911; c=relaxed/simple; bh=V8MCTKePA3znEFy3ImfiLkTvdxvI3yL3376d2q7SQ5A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=R+zVWjBdifySdZ3FlCT4jRFGpbfCt209OefY97qwuLgCHAZesQVv49EXa/mdwRf9axhp5t3hHel24iVYbFCtUvC7z529vxqyIQlDUpy3veAAJF98jM8Spk7euAcJscuk47/hGfXA4ULh0tQ+KxHWwQZggEyha7+X9fy5TnnwrRs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IK+wo7hI; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IK+wo7hI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D62951F000E9; Sat, 23 May 2026 17:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558909; bh=v/3ZZK1cCDduXYXcxKeKlOpSrmrsqWH7N/ziUw2jSZ0=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=IK+wo7hIR3ThlZ8Syhumfwrnj90K3fG4pOcL68OF1GGVeRIyIE55lypaqrwhkPQBp TR7+D2SKUENtlQm1ZJfKj1rpPgJEwB2o46mX/TcXx2bMBEmBF/XeID3EiM7gWCjKBR 6VXPIg75qWarkDd1bOPZvZO1/WArLxZZ1fXNQ+SNBWzFHWwoLDA2ghQliJUZaLG5yV RZU5VhCre+vUVnCKvEtvHsisSf4UJSscfwKHONUrvvD0yN4AbdKIMb0VKvCjZXjjzq xejc85BC4vEANUbQl625iHtC76mIYLb8lEerln76aSUcPnNP6oY8bi+TWI/w6zyA36 vAq3u0qURaKMw== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:16 +0300 Subject: [PATCH 04/17] nilfs2: replace get_zeroed_page() with kzalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-4-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 nilfs_ioctl_wrap_copy() allocates a temporary buffer with get_zeroed_page(). kzalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of get_zeroed_page() with kzalloc(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/nilfs2/ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c index e0a606643e87..b73f2c5d10f0 100644 --- a/fs/nilfs2/ioctl.c +++ b/fs/nilfs2/ioctl.c @@ -69,7 +69,7 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs, if (argv->v_index > ~(__u64)0 - argv->v_nmembs) return -EINVAL; =20 - buf =3D (void *)get_zeroed_page(GFP_NOFS); + buf =3D kzalloc(PAGE_SIZE, GFP_NOFS); if (unlikely(!buf)) return -ENOMEM; maxmembs =3D PAGE_SIZE / argv->v_size; @@ -107,7 +107,7 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilf= s, } argv->v_nmembs =3D total; =20 - free_pages((unsigned long)buf, 0); + kfree(buf); return ret; } =20 --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 960932BB1D; Sat, 23 May 2026 17:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558918; cv=none; b=D5Yk0u2ixDcwBAQvavekfbdCFPwVAeeEVKRCgVVR46Nc539eMWY1fMdLF6PTf/Kcg8468KVzP1DOTabDtC5Mi5kQcyYmVGOH/EcX8G8KNJK3cLBmOY0tp5bhZ3AmWU7nV2l6MoJW2sKL102bw/lQHNcxtZOHudWesX8ceMuEQfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558918; c=relaxed/simple; bh=FrSccbbs0hyrfruPAQEdMfu5TavFD0FZc2PEdgCxv1o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=itaqZc5Hm+YH5oPgEUxe3N0PNYg910DPWHS39iuupv/xz5vK6qCLh/RTLykTH4uMY8KcyVsSn9yh8Ho+REhIiyN74J6+8aRvkXipOqfo7+iJgEGDG+8FdZaPkU8Ol/dyhp0gudiVCQTj5iZyXd4yXs3COl39fos/lOdcK7+ft5Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ATnUMplv; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ATnUMplv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 587A61F00A3A; Sat, 23 May 2026 17:55:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558917; bh=iuTtZ9uTCrL2gUy5rhFYUqVCvakrQG2oy3wSLfhPcVk=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=ATnUMplvANtFqXnPMMG7NSH8t5x5kTr2rh2BxFK2/mVjIEx0Csre+Yxnx89gvCEvB uHhDVFvMFOGe5KELFWAxCXbgCTVrBKUMFRuF0LRLv78XqrCqluzw3rTHXpk0yXii4K fDJU8jmq2k/g/NjGNa5JSW+CPvvN53gcwu2ld51g061LrLeCS7I3OlrWU8/r17dOxF bJ5qv7tKsbMQ1Om/1fVqqTAJpam8n6zNmdQ1U/w3peqvRTGFGpN7qetPQI+JDlr74U +IrL/dYO28YRNMgTFDRp3h8h0WxOISk9xbTS2rZ8iV2rThE32PwWKlR2cNbCHn6/tO lPASwzWfCy/xA== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:17 +0300 Subject: [PATCH 05/17] NFS: replace __get_free_page() with kmalloc() in nfs_show_devname() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-5-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 nfs_show_devname() allocates a tmemporary buffer __get_free_page(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_page() with kmalloc(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/nfs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 4cd420b14ce3..8f8a03a68d3d 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -623,7 +623,7 @@ static void show_implementation_id(struct seq_file *m, = struct nfs_server *nfss) =20 int nfs_show_devname(struct seq_file *m, struct dentry *root) { - char *page =3D (char *) __get_free_page(GFP_KERNEL); + char *page =3D kmalloc(PAGE_SIZE, GFP_KERNEL); char *devname, *dummy; int err =3D 0; if (!page) @@ -633,7 +633,7 @@ int nfs_show_devname(struct seq_file *m, struct dentry = *root) err =3D PTR_ERR(devname); else seq_escape(m, devname, " \t\n\\"); - free_page((unsigned long)page); + kfree(page); return err; } EXPORT_SYMBOL_GPL(nfs_show_devname); --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 2F2C3330662; Sat, 23 May 2026 17:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558926; cv=none; b=KDxI1eNSN50GySDPuTcX9Dcaa49P1W4hCV5ZNKESG60yiFYjBp/73Fe3F+DUJ/683zchH+XO4WWUu/txVKZf43fXl62doZxz59mXjNURzzKuAIJATamce7nVrS0hzlVJaHkjOJGFMonYlINbXRNp128oLkQvE7c7uMJkWj6T/mQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558926; c=relaxed/simple; bh=MMjGYQ83G7dlBEgngWbzjzg8jJEgk+XNn0ECKJj3GxU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BmlU1XNTAEdELMC4OCIGbPn2NgM2cIiOLY6JIqGMLKRfuIJKtxaxM1iph9zBgkRuOj1i/bGJdRL0L+akYNk4nubsImqK9oAuRi1s6u2T5oLOplhcwGrlEJaeqM0kVg0Aq3H1vZZ7jr4oZ/z6qqkRlv59KyWMNh0rp95gUNczmCg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lSKIMgV4; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lSKIMgV4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE9901F000E9; Sat, 23 May 2026 17:55:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558924; bh=KmuweU/KpiHBgBQmq/LYn9YmIagqoe1ON60urAlAxBY=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=lSKIMgV425Pk6eUE5rd09QAtj32QltS3Ct51p6+09BGTmdEQiN5fqWWbJ245sUP40 fD+9vsAUhHfZiBF7kZk4yyCoKjlty4W70KXoxE+Ngbl0YdsNhSPh3mXM7spbkSdT9q FW4lT+b8U7o+ks/hQF/nJzYdKq1MUjcxvvmOuC/5iwz6Q0NcqfULhL2m2G2Q11S6J9 o0NVR6VLe5fABPC3cen+hZVxg0f3wxU+YECMqnVyK+B+MhAGByBix7x+POvJzfsX4C 4YbA4pwrEQu1kMJT2ze16r1ZZ7qSXRvF8GvvHRFRVrT1Q4+E7RfGIzP+/4fdoFv+I5 DZtpEIhLt/Y5Q== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:18 +0300 Subject: [PATCH 06/17] NFS: remove unused page and page2 in nfs4_replace_transport() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-6-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 Temporary buffers page and page2 allocated by nfs4_replace_transport() and passed to nfs4_try_replacing_one_location() are never used. Remove them and the code that allocates and frees memory for these buffers. Signed-off-by: Mike Rapoport (Microsoft) --- fs/nfs/nfs4namespace.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index 14f72baf3b30..2a03f02bba7c 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c @@ -481,7 +481,6 @@ int nfs4_submount(struct fs_context *fc, struct nfs_ser= ver *server) * Returns zero on success, or a negative errno value. */ static int nfs4_try_replacing_one_location(struct nfs_server *server, - char *page, char *page2, const struct nfs4_fs_location *location) { struct net *net =3D rpc_net_ns(server->client); @@ -541,21 +540,12 @@ static int nfs4_try_replacing_one_location(struct nfs= _server *server, int nfs4_replace_transport(struct nfs_server *server, const struct nfs4_fs_locations *locations) { - char *page =3D NULL, *page2 =3D NULL; int loc, error; =20 error =3D -ENOENT; if (locations =3D=3D NULL || locations->nlocations <=3D 0) goto out; =20 - error =3D -ENOMEM; - page =3D (char *) __get_free_page(GFP_USER); - if (!page) - goto out; - page2 =3D (char *) __get_free_page(GFP_USER); - if (!page2) - goto out; - for (loc =3D 0; loc < locations->nlocations; loc++) { const struct nfs4_fs_location *location =3D &locations->locations[loc]; @@ -564,14 +554,11 @@ int nfs4_replace_transport(struct nfs_server *server, location->rootpath.ncomponents =3D=3D 0) continue; =20 - error =3D nfs4_try_replacing_one_location(server, page, - page2, location); + error =3D nfs4_try_replacing_one_location(server, location); if (error =3D=3D 0) break; } =20 out: - free_page((unsigned long)page); - free_page((unsigned long)page2); return error; } --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 A1B9A33F588; Sat, 23 May 2026 17:55:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558933; cv=none; b=h8nyNguUacX3J+nfil7W6FiENPoMkcQz5SrGjN8YnruJUt20CsGuvW3VGMHGLUhEcPuKs8NJ7x8SMWCYo1o2TCxFd6I5lhQ65jITEYs5VKJJXVUU70k5QQ4DFEdiUyHvSuz9f5vBp3SAtEUj7p+caPwxMIMwdlYu6SYwsb0dPA0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558933; c=relaxed/simple; bh=R3TwlcGQ9Xmi8vrOdCdmDCY7yPMZ24GcwIIOd+RcbTk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xqv7weA4wTGoweo6aANvuqlrV9BhpoQknEEyKrfamhwack0fE8mtHrpBEj9Mb/IjOGxaSkdTVQxEHM5KC753o9YzoJ8Q9MLO5kaFmEqPzP1ixkEnJog+SCkOXMgvUhSJEi6PnDvEmrEgn5JXoC/y37aDxjOP0SvqhA92tOCrMP8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XHmgC1IK; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XHmgC1IK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50B621F00A3A; Sat, 23 May 2026 17:55:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558932; bh=CZp/X5zLgPC9r1L7fUvb/ePIYWMAGoK4GAELkUrcd6A=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=XHmgC1IKsMvTM0+2evr64HcGx16lMmVQxeLsbzqY++DoYRk4cRBp7HalnPlBMftcC SxgU0WB5nl4VEdUeM5DqdHgEmCtWE8ZmMoisQWZNGjx3UxyMH6kKnLIvIknCvqG78W 9DPcb0sWiVFHr4pXHDqNUdCcMRGeXhGZjXpcsRTFz3ktZ6U/o33frEVAMUboeAO80b 9PFdW5yU5Zt7qNf8QvoeVI82N62fOcPNRbE8s6REYzOHoqb2rMh7xwyEZKzOLHD1en wFbmxmiRtlOWQQbHfw+BASgeYU4qs4yBf1qbPCNlkrIdRKKwbaAfuq5qUKC9ar0XYi QbnnugkUrUatg== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:19 +0300 Subject: [PATCH 07/17] NFSD: replace __get_free_page() with kmalloc() in nfsd_buffered_readdir() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-7-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 nfsd_buffered_readdir() allocates a staging buffer with __get_free_page(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_page() with kmalloc(). Signed-off-by: Mike Rapoport (Microsoft) Acked-by: Jeff Layton --- fs/nfsd/vfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index eafdf7b7890f..c99e54b23cd9 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -2407,7 +2407,7 @@ static __be32 nfsd_buffered_readdir(struct file *file= , struct svc_fh *fhp, loff_t offset; struct readdir_data buf =3D { .ctx.actor =3D nfsd_buffered_filldir, - .dirent =3D (void *)__get_free_page(GFP_KERNEL) + .dirent =3D kmalloc(PAGE_SIZE, GFP_KERNEL) }; =20 if (!buf.dirent) @@ -2458,7 +2458,7 @@ static __be32 nfsd_buffered_readdir(struct file *file= , struct svc_fh *fhp, offset =3D vfs_llseek(file, 0, SEEK_CUR); } =20 - free_page((unsigned long)(buf.dirent)); + kfree((buf.dirent)); =20 if (host_err) return nfserrno(host_err); --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 354FD330B14; Sat, 23 May 2026 17:55:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558941; cv=none; b=gA6B36sCRA877BqJwAJJIHf93is+NdGDEznwHmK5Xi707h3Y3QWsp2ouCOwxoKNaDJlyhJTd556qTtzTiYEWHbUR8aRkTfX1FuASEafTgcJZXvvfr2EOz39vdEP6Rk4oeD2R4/QfulIXJh5O9+2iU8E9cu3+VcW8oyVFt9OOm9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558941; c=relaxed/simple; bh=IIc4FBJOhEeQzkBhvQ9lbobSkiYgyXqkSFDj9nvtGQA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=duT6QrTVRomLuJ578Ph4MDid+M4bEOaoDZ6dDhC7u/dktKB/Jv2kWX5hVKFsT/7fKrapDc1DQIjwZu045OeomCxUQrXUp5Tf9XccCnz9h1BgQ9W4/FqeUHVe8PxCKPdzpR7P0K6ub2BzpqCArumqwBSmAWMjgzdyxCvE5CLfDAY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jjm6d2SI; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jjm6d2SI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6D2C1F000E9; Sat, 23 May 2026 17:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558939; bh=Ciy3fc6rPG867pO7XlQiiPhPSYMnUaJVLh8uNzpmzP4=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=jjm6d2SI9Nu7Hx3j1OC2PLh3FqVe4KFNVo+MSAgv41PgIQXEqGyPVMvwpSfYgKnXH uzkfQ6qPea9ETsNeZobk+IVCuwvfr8LMKc2Q6kcmtsEoSQH4hnwmUngCTvzOg1hFFK CIRM38hr6bBmHU+IMHxo8otBgSjrHUnlcK7YmSCGa4B+ktawZtU2XLQk7TOtPkNKfm FO6jSlM6EBnZMmmQ/MVg/PXMYVhGaUjesm/iVxPHj2YthtQiCBY1qwXPlDnxfGkM5L egE3jan3i9N+780/faPy3D4BiqHbima0B01JeASewk99glkhCmxR3CIG5rCUqLCQBw DXOcG91KaO07g== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:20 +0300 Subject: [PATCH 08/17] libfs: simple_transaction_get(): replace get_zeroed_page() with kzalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-8-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 simple_transaction_get() allocates memory with get_zeroed_page(). That memory is used as a file local buffer that is accessed using copy_from_user() and simple_read_from_buffer(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of get_zeroed_page() with kzalloc(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/libfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/libfs.c b/fs/libfs.c index 1bbea5e7bae3..80a330c8296f 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -1258,7 +1258,7 @@ char *simple_transaction_get(struct file *file, const= char __user *buf, size_t s if (size > SIMPLE_TRANSACTION_LIMIT - 1) return ERR_PTR(-EFBIG); =20 - ar =3D (struct simple_transaction_argresp *)get_zeroed_page(GFP_KERNEL); + ar =3D kzalloc(PAGE_SIZE, GFP_KERNEL); if (!ar) return ERR_PTR(-ENOMEM); =20 @@ -1267,7 +1267,7 @@ char *simple_transaction_get(struct file *file, const= char __user *buf, size_t s /* only one write allowed per open */ if (file->private_data) { spin_unlock(&simple_transaction_lock); - free_page((unsigned long)ar); + kfree(ar); return ERR_PTR(-EBUSY); } =20 @@ -1294,7 +1294,7 @@ EXPORT_SYMBOL(simple_transaction_read); =20 int simple_transaction_release(struct inode *inode, struct file *file) { - free_page((unsigned long)file->private_data); + kfree(file->private_data); return 0; } EXPORT_SYMBOL(simple_transaction_release); --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 1CD9930CD81; Sat, 23 May 2026 17:55:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558949; cv=none; b=H9a73E5pY1Cp18kbW/cLDdPwuNx8q89WySzZGMA4YhDQpiDSDxWli27mX4JClbEqokisb9A8vm+ulRjhuzj5PNBWQvqjHf1eHPgFTxHu+qwikBNduTjlLpUGbUKvEG49ikSsEy80b+4imnRskn/wJCW85fjbmqv+weEHDh3+EOY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558949; c=relaxed/simple; bh=1d6KQsAeKgySPVpGarXocvBZjBPMu1KCr+fEp1NqfpA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jCgLZKTNaKyNxjiw6hioYS4z0egrcidRKNReH+BbSsMUcFlnUUzPdMzE+aB0Ojp72RBa7z5oLguoNFhby9HLCVK8posZjn/Bj/OakddNiV3uAKZhM9EW2LI5uq6UXe0mD9LBpQ9O3I7q5mS/RSPL0ko12BBnjbJDQsHaSjfGbDE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d7D2ybPr; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d7D2ybPr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 484671F00A3A; Sat, 23 May 2026 17:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558947; bh=yB2akKGsW8OhhHQjSAQNazF7z15KfNFtO0Wg450/3lA=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=d7D2ybPrqTXa2BX5BRBj5trjjELM1QO8HUQHB8PickiWyy8mZxEWuS5gG1w+Cl7Uy HER8CMshtp3q8ixb+8UkyigX5UBOVBE98jLaoBkGBKPIXVaYANzk4YXHUfoe4OXN79 xW4fhVINDce6E3jAU4Xai5n3r4y5DApu+mnEG3zTAoIGygmccs2LZ+VI8QEuVDFj4e nKsQlBUUtxGPAWg0DTy8gIDU8KAdfCFJKYgwGZYp3XtoDiua/XRmxDlb5rj39iDzW+ z1cf9/nRffFe1GKNVVbTa+W8bsuFDG4DWE1yHIDqMFcE2P+9dvdhMLon7+iYFqAkRL npBGpF3iBQjyg== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:21 +0300 Subject: [PATCH 09/17] jfs: replace __get_free_page() with kmalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-9-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 jfs_readdir() allocates dirent_buf with __get_free_page(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_page() with kmalloc(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/jfs/jfs_dtree.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c index ac0f79fafaca..8ce6e4458cc2 100644 --- a/fs/jfs/jfs_dtree.c +++ b/fs/jfs/jfs_dtree.c @@ -2729,7 +2729,7 @@ int jfs_readdir(struct file *file, struct dir_context= *ctx) struct ldtentry *d; struct dtslot *t; int d_namleft, len, outlen; - unsigned long dirent_buf; + void *dirent_buf; char *name_ptr; u32 dir_index; int do_index =3D 0; @@ -2884,7 +2884,7 @@ int jfs_readdir(struct file *file, struct dir_context= *ctx) } } =20 - dirent_buf =3D __get_free_page(GFP_KERNEL); + dirent_buf =3D kmalloc(PAGE_SIZE, GFP_KERNEL); if (dirent_buf =3D=3D 0) { DT_PUTPAGE(mp); jfs_warn("jfs_readdir: __get_free_page failed!"); @@ -2893,7 +2893,7 @@ int jfs_readdir(struct file *file, struct dir_context= *ctx) } =20 while (1) { - jfs_dirent =3D (struct jfs_dirent *) dirent_buf; + jfs_dirent =3D dirent_buf; jfs_dirents =3D 0; overflow =3D fix_page =3D 0; =20 @@ -2903,7 +2903,7 @@ int jfs_readdir(struct file *file, struct dir_context= *ctx) if (stbl[i] < 0) { jfs_err("JFS: Invalid stbl[%d] =3D %d for inode %ld, block =3D %lld", i, stbl[i], (long)ip->i_ino, (long long)bn); - free_page(dirent_buf); + kfree(dirent_buf); DT_PUTPAGE(mp); return -EIO; } @@ -2911,7 +2911,7 @@ int jfs_readdir(struct file *file, struct dir_context= *ctx) d =3D (struct ldtentry *) & p->slot[stbl[i]]; =20 if (((long) jfs_dirent + d->namlen + 1) > - (dirent_buf + PAGE_SIZE)) { + ((long)dirent_buf + PAGE_SIZE)) { /* DBCS codepages could overrun dirent_buf */ index =3D i; overflow =3D 1; @@ -3014,7 +3014,7 @@ int jfs_readdir(struct file *file, struct dir_context= *ctx) /* unpin previous leaf page */ DT_PUTPAGE(mp); =20 - jfs_dirent =3D (struct jfs_dirent *) dirent_buf; + jfs_dirent =3D dirent_buf; while (jfs_dirents--) { ctx->pos =3D jfs_dirent->position; if (!dir_emit(ctx, jfs_dirent->name, @@ -3037,13 +3037,13 @@ int jfs_readdir(struct file *file, struct dir_conte= xt *ctx) =20 DT_GETPAGE(ip, bn, mp, PSIZE, p, rc); if (rc) { - free_page(dirent_buf); + kfree(dirent_buf); return rc; } } =20 out: - free_page(dirent_buf); + kfree(dirent_buf); =20 return rc; } --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 149472C15B0; Sat, 23 May 2026 17:55:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558956; cv=none; b=m68OuzQtWzJuT+8XvrEUZA8Xm/sC/S9fHOD4/49MzOY1q+0wreSOQa8gC9fT3RL6da9Y9UrBYRoJta8m8pVEnYzVHzEMqF8mfGah9JlceHAeERn7NWvFdU/vCtrVFVTDfbtYo976pZGa0tnqqxJeeEKWPtUFC8Y3b460jHZnGdI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558956; c=relaxed/simple; bh=Wc2c8NjQ+LPTgG9EiPkpP4Thodyo3z11bkVysTs8d9M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Zts9ULdzvrFqdeCGn4L6oimFZgXxcNjueLB5tXsU4ygxeZxHgsm0zkPsj8r5LWG61CvsAtxxDNhUB7OScFdI7BVQwQD7otiCr1vQ7+eB2a3Bd6QK0s/GqKoIKiDG0MIko6IecflnWKe0CGMXH2ds0PRxCXjuC5dssMCuJI3qFk8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FEaGA2By; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FEaGA2By" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE1771F000E9; Sat, 23 May 2026 17:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558954; bh=SxGF956OZDQJ04Ha1BVCIxFwqpuZT0QUw7PeeB2x8ho=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=FEaGA2ByUVUb4gzO0lRcyjGQi2EY/wCi4EyO6v8VtYTBWBx6YG7dKrg4vMqbF1ooV WAUaxnU8AOp55vwtaP+3UQP9ccPWXV7xJpiq77GZF4K+RZRJH0UgOJsTSQrvBD4P6G TnjCadP00pKGHQhzbjpVokPQrVZFpNTOwTpF3hLxUvaiX3A9L7Tq8RWx83HlFJyaBt QEFNZTjsw+5/uNOPM2Bcb8E5O+3sF5zx3jplBNPReyTS53Zy8H+j6tiGYQb8h8G1Kg 646TOOJKUKfrQ3su+L3yeG4CfdpIKRXcovoEsdUEqQJhDFky4dSvKqdEKX99RF4YJY NJA9X4Sl9FkZQ== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:22 +0300 Subject: [PATCH 10/17] jbd2: replace __get_free_pages() with kmalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-10-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 jbd2_alloc() falls back from kmem_cache_alloc() to __get_free_pages() for allocations larger than PAGE_SIZE. But kmalloc() can handle such cases with essentially the same fallback. Replace use of __get_free_pages() with kmalloc() and simplify jbd2_free() as both kmem_cache_alloc() and kmalloc() allocations can be freed with kfree(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/jbd2/journal.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 4f397fcdb13c..1137b471e490 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -2784,7 +2784,7 @@ void *jbd2_alloc(size_t size, gfp_t flags) if (size < PAGE_SIZE) ptr =3D kmem_cache_alloc(get_slab(size), flags); else - ptr =3D (void *)__get_free_pages(flags, get_order(size)); + ptr =3D kmalloc(size, flags); =20 /* Check alignment; SLUB has gotten this wrong in the past, * and this can lead to user data corruption! */ @@ -2795,10 +2795,7 @@ void *jbd2_alloc(size_t size, gfp_t flags) =20 void jbd2_free(void *ptr, size_t size) { - if (size < PAGE_SIZE) - kmem_cache_free(get_slab(size), ptr); - else - free_pages((unsigned long)ptr, get_order(size)); + kfree(ptr); }; =20 /* --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 957BD3191CA; Sat, 23 May 2026 17:56:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558963; cv=none; b=d2n/D8eobPVdqG/mxX67o41na+eNFem3ffOieG7s4Zm9RdPZPLzGUIDV2B2FW+DcZdMEozDpbpI8sdSL+kDuovySIivppHGvKcUrf6V5guQGSnwDl9iAbEskeLfBkuA9mDwFB15peNR1ef/CoAnZ1tebSX2+qEZrwHTyzNf871s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558963; c=relaxed/simple; bh=IHKFef2x/jyYY5uYqDXxJ7Z15M5ZTikaFgXsQ8rpbDo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UqGhD9CdK4PdY2ty6lGGml/nUykoM575HLAiG1ZVGqaMADUL+QQXiwY6zvJ9rchYQShO2rvsaQa19NNBI2J7BBKgKZFe+zxAmr9rQqrJiELqOeeGkPnvPBp8OH/pvhwh2UVZya9NtoENRdvX5o32MaeElTF2jj4rV0OXoe/5YUM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oZhkwgXq; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oZhkwgXq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F4E91F00A3A; Sat, 23 May 2026 17:55:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558962; bh=xn1afLPdDj00dLAc64xuCdT5ncjg8HMcRvLHoM078ak=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=oZhkwgXqudyq5TncLZzYhSy/KChNIJsYMPo7KO3BUs0B5I3D4uMMlIJHJ5H/ZsIiR O7WDgdKc/37mYX8oVhIB+gQOs7nSvU3Wkc6MhR+TfDmZFcgB/B9ilaXie8CblGN9d0 KHAaqP8o4lh1HFEljI32jULXkHy6jjdEpet+Q/9ZjLd1IIUD9RwCL8TlSbnwXy2Ff+ 529elZn3TrKG4mapsyPR44RG0R8lKa7ncAu3JbZz7V/nyli4itQLLBzlDHjolS+khv Efkoiz0JR9RL0vbHFM55SfWM2z9m/9FY7WC1YyCJnnsu0Jf6lvKqAF9GJ0G7WAhp/b WbyGsmdljEtLA== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:23 +0300 Subject: [PATCH 11/17] isofs: replace __get_free_page() with kmalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-11-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 isofs_readdir() allocates a temporary buffer with __get_free_page(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_page() with kmalloc(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/isofs/dir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c index 2fd9948d606e..6d220eab531e 100644 --- a/fs/isofs/dir.c +++ b/fs/isofs/dir.c @@ -13,6 +13,7 @@ */ #include #include +#include #include "isofs.h" =20 int isofs_name_translate(struct iso_directory_record *de, char *new, struc= t inode *inode) @@ -255,7 +256,7 @@ static int isofs_readdir(struct file *file, struct dir_= context *ctx) struct iso_directory_record *tmpde; struct inode *inode =3D file_inode(file); =20 - tmpname =3D (char *)__get_free_page(GFP_KERNEL); + tmpname =3D kmalloc(PAGE_SIZE, GFP_KERNEL); if (tmpname =3D=3D NULL) return -ENOMEM; =20 @@ -263,7 +264,7 @@ static int isofs_readdir(struct file *file, struct dir_= context *ctx) =20 result =3D do_isofs_readdir(inode, file, ctx, tmpname, tmpde); =20 - free_page((unsigned long) tmpname); + kfree(tmpname); return result; } =20 --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C8699304972; Sat, 23 May 2026 17:56:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558970; cv=none; b=cVeNyTmX5cKW82dz7g/6j+5MUD8JNx5yeRcIfktUpiI5CFnostwmq7q7NyPdDOXjPIo+zSf4XVt+JCiBj5Ap44J02tatN4qOHy/72lHi6wlkbnISzj0mtZk18VMloHz7bRHp1j19aKC5LsoUksL04lA6H6C+a5q4/SUaK0f54Q0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558970; c=relaxed/simple; bh=1YSi5Q/4duH3X1f3c7sxJDgLdO0ztZpaoXFiqR71EUU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JZwTAnAxIyw6FQINrOV+aI2i0Lzy4MlMnCFg1bGVRd7UVoHpBjiZgLI+t8vAWVMhkt6Vu0LqvEZMlYovRwCoJnoz2sDnmHsHORZODMUlPJDIBMXkIbHyQaXjiXxU+5vG1yW0VV0K+aCwEOVyiDRp1H2F7eHM/p8LxprelNmnj8g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Vemu1kcE; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Vemu1kcE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B60BA1F000E9; Sat, 23 May 2026 17:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558969; bh=jKo+LttHIUD1A+iCHOd4XzHNPdNF0nPTlnjXQ41S2wE=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=Vemu1kcEUmxAiAsIh4TQkBUpCC3eZFLAlCkzcG0Ph2QDZmgnFcsh7HLo7bRLypN8a 4O7sRSwfz2Si3bQK2prGFIm51brNn7HbhUaf390IGY4RTpOK9E8GLQB8JKv3yIPy0B 3OdF2356XNi2W9iVTCP19aIpZ2waAUBqPL7ZzV+8B2EMdYa3X/q7R3kTltzAJrZtQ4 tRoFYGSZ+KINhrDUrwdsnLgD0fHos/wX1o4WYbKLoqZlRnjjBayViPqjymIH+D+ySn 8Bt6vC1T0wx8wpclGTNSjEIacKIfZ77fy2GThGy2IPX0jx4CLFYSPKZfbwpZORl5W9 3GQkT9VAlRXUA== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:24 +0300 Subject: [PATCH 12/17] fuse: replace __get_free_page() with kmalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-12-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 fuse_do_ioctl allocates memory for struct iov array using __get_free_page(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_page() with kmalloc(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/fuse/ioctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/fuse/ioctl.c b/fs/fuse/ioctl.c index fdc175e93f74..3614ea603913 100644 --- a/fs/fuse/ioctl.c +++ b/fs/fuse/ioctl.c @@ -10,6 +10,7 @@ #include #include =20 +#include #define FUSE_VERITY_ENABLE_ARG_MAX_PAGES 256 =20 static ssize_t fuse_send_ioctl(struct fuse_mount *fm, struct fuse_args *ar= gs, @@ -252,7 +253,7 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd,= unsigned long arg, =20 err =3D -ENOMEM; ap.folios =3D fuse_folios_alloc(fm->fc->max_pages, GFP_KERNEL, &ap.descs); - iov_page =3D (struct iovec *) __get_free_page(GFP_KERNEL); + iov_page =3D kmalloc(PAGE_SIZE, GFP_KERNEL); if (!ap.folios || !iov_page) goto out; =20 @@ -400,7 +401,7 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd,= unsigned long arg, } err =3D 0; out: - free_page((unsigned long) iov_page); + kfree(iov_page); while (ap.num_folios) folio_put(ap.folios[--ap.num_folios]); kfree(ap.folios); --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 7CAAC304972; Sat, 23 May 2026 17:56:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558978; cv=none; b=CTedX1hOW9QMD0LscWcvwBIIFTItobfRXOfcNMnGtHBUtMIf4o7mkV4w6PRh3KOQySATrGIALNYRqfJP/RkjwBhoHz1rAB/6+0fWgowJ3tbUE8sY3Ns1Ay0m/zPUJaJSbC4MeONRCxPDlmH001cxI7tUdX46KAv2mBmrH9k4tgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558978; c=relaxed/simple; bh=9jocJk3xNegPSqjFg768bKmBGXxSKUoFZQXOKLQq6xw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O3i9vY+iJH3tKwTMt6A1rxVg/rQAdP0v29ah2Zy2jtzx3Ix5KvjJknvZfIDP+h/OpWPeTDcuV2OD7yEYG42lbF+8Msd8B1gKPe5CisAa1xFIeZcOfRKNeMTyIv58wgpoUPn41X93IVTfspZzAjZaEm9bByf3eEWeGZ4ZIaGwfYM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IPMImHOH; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IPMImHOH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 369561F00A3A; Sat, 23 May 2026 17:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558977; bh=Lb9R1+4tK0UkG7ujaRwCAX/p5J9rcF0zL4gQIBfdRGo=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=IPMImHOHZX9R3AYIw3MrZ7UCgx62XFn7hoyyedz0iFQPJGvDjWaHpwmxJB5koBaxa /Zc5t8a2CPG487TQZEccpAsZr3Cf1rO92HRpgstttNSWqixLgLGXd0DvsUS9tZtlla d329bJbl/Atss8Vx+9BzQKI0uNEQtubea4TOBfBsFNekgNqOkGDqHmCQSubaFIZfAT TauGSVKvJQhiO+GYyWyay/Wiwy869ulfv9WbRoBbyef941Hh/lralRMIiBOuObnSZQ Z4Cg5jGvVivL+u0EWcq3emC3mmNYhjnSI624SUa8QgsCk9k0C1+RlnpQa3FfKJZTlc xbJ0tHiFeZ+0g== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:25 +0300 Subject: [PATCH 13/17] fs/select: replace __get_free_page() with kmalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-13-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 poll_get_entry() allocates new memory for poll_table entries using __get_free_page(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_page() with kmalloc(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/select.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/select.c b/fs/select.c index 75978b18f48f..6fa63e48cdee 100644 --- a/fs/select.c +++ b/fs/select.c @@ -150,7 +150,7 @@ void poll_freewait(struct poll_wqueues *pwq) } while (entry > p->entries); old =3D p; p =3D p->next; - free_page((unsigned long) old); + kfree(old); } } EXPORT_SYMBOL(poll_freewait); @@ -165,7 +165,7 @@ static struct poll_table_entry *poll_get_entry(struct p= oll_wqueues *p) if (!table || POLL_TABLE_FULL(table)) { struct poll_table_page *new_table; =20 - new_table =3D (struct poll_table_page *) __get_free_page(GFP_KERNEL); + new_table =3D kmalloc(PAGE_SIZE, GFP_KERNEL); if (!new_table) { p->error =3D -ENOMEM; return NULL; --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 160CE348875; Sat, 23 May 2026 17:56:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558986; cv=none; b=Cc5oZuAvzCoYwXqSDcRB1WWBdsbtp/kHmJtwEq8hi+t71W+5+R7jOUSWovmU13QwhBzPodlvfWL84cG7Za4Di7wwZxn3yOCtpJY31l+d8yfVI4VjWqtMgbqh8YyM5ZPzZnv/yCVmTi6v2LGE7iB3fh6bd9X8NUil7C5q2gAI4lU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558986; c=relaxed/simple; bh=HXrQZpeWN85ojYx7kPWIMvSe3/c5RK1MgAHwTCxVs7s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BGDFk7XNWf0KEBAgnbG5Pc2EAKnoHJX2CdMrgrBDXgqfwA7JIXGOQN6FGeXWCkzAqouRieUSVfbKyTo5h4Tjx6wJ8HN+p2RdkjUN0OzTjguOoznKhV79geWHIcnAU5a36h6I73HhcXAgdW/pvRnXWebytjOdsInA/CGsUT+uOYY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CveTOEuJ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CveTOEuJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB9F91F000E9; Sat, 23 May 2026 17:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558984; bh=64moEsVhgfwgI6MhFHgVhfH5MiESSq4cUiaY8/kUbXc=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=CveTOEuJd+8kC+bH8xjZnQAePmub9EwWAVXdLRANzb/MECJO4ML8rsBSy4pLSKa0W FrVbvpSksYISZvH1Z5MZbtgs9CxiG5hrdqrLB5qb0lPXnY4XumgNVts5Zabanhatzt SKf24aQMydc6/9+t12q/leOfbrgBdAYUSXhlUiHVGD/YoGeJL1Jf4asA3Ki526udT+ OUho1AaqLkVVrZMX+o13pw+MCa0ch38JG20IOMI7GBteAYKyB1H0hGJ+66+wJQ2oXV 6XzMbyLsODlr9wOMo0TqSG+134+nnOMh4L23aLFTHMFEUHc6qs/zEMUbSzSTl5JWtv RScWemXv3O84A== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:26 +0300 Subject: [PATCH 14/17] fs/namespace: use __getname() to allocate mntpath buffer 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-14-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 mnt_warn_timestamp_expiry() allocates memory for a path with __get_free_page() although there is a dedicated helper for allocation of file paths: __getname(). Replace __get_free_page() for allocation of a path buffer with __getname(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/namespace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index fe919abd2f01..2ed9cd846a81 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -3303,7 +3303,7 @@ static void mnt_warn_timestamp_expiry(const struct pa= th *mountpoint, (ktime_get_real_seconds() + TIME_UPTIME_SEC_MAX > sb->s_time_max)) { char *buf, *mntpath; =20 - buf =3D (char *)__get_free_page(GFP_KERNEL); + buf =3D __getname(); if (buf) mntpath =3D d_path(mountpoint, buf, PAGE_SIZE); else @@ -3319,7 +3319,7 @@ static void mnt_warn_timestamp_expiry(const struct pa= th *mountpoint, =20 sb->s_iflags |=3D SB_I_TS_EXPIRY_WARNED; if (buf) - free_page((unsigned long)buf); + __putname(buf); } } =20 --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 41385330662; Sat, 23 May 2026 17:56:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558993; cv=none; b=GoyTaCRI91dPSM1fM4JY/+pNFoZh3DQk7s4UHPR88cHz64iW8Uo5RYJpmmgMcc7YzwMGDRjmQ2OE0Z66Bo9lWRvlzPGRwDDPtbNHvQxhJ+5pcII7/+glZQden7N5BNa0LC2+lZaaIZW0TweMD2txTDuj8HrGe0qDqBSzrxtZyQU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779558993; c=relaxed/simple; bh=SBC0xcwck7YqyR4+c7ort1g4YhFB6ZS5sPCyTtNomsk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dGZQon20cdrY7hGVO6ojcYud1Q2a6W3e3ZeSIC5uMSnk0eQqHm0VKhd++cJg0h9rauepHD43GYkZEddIkd/hCOBXidsjl8J+pd6Dhukk+kRok5VMLJf2TKgkHfXYxmwTTGQ5f5beHus3O5B2uBFDWE6Kp1bR7sgfaPAHWZYCYV0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nCSdfqNI; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nCSdfqNI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CA291F00A3A; Sat, 23 May 2026 17:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558992; bh=avaAlGi99keULPCZbynNTnKAsRLlbRGsrJ8jPwcvMgE=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=nCSdfqNIbpAILIl1hkV8eRrcN1BW63mPl1SXXJDMC2qdR5RyaxxJGoqPP46gwgR1S +23QGRthqb5rkclytzrT4aNNh23BqD/SFor3S4bTV7lcsIexjJFjf/nTcfVKNnZdDl zm9CpBj4O92KD7M+sFppTDfYRg0P+I0San410HCOyA9/hucFpDsekC0skrneiMae8f s/FlJUMcGqpZ1eE2hEooc/JDON11jyXAJlM8GzjJCY6gaCzDLXOtxw70PzbGh78UeZ t8GLZb8jdivXwzqrjSaSh/j10uwgwnPH68J080OEN8uh3h/W49iDDQ35JPS1eZv99G yvks9jaAUnw4w== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:27 +0300 Subject: [PATCH 15/17] configfs: replace __get_free_pages() with kzalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-15-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 configfs allocates staging buffers __get_free_pages(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_pages() with kzalloc(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/configfs/file.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/configfs/file.c b/fs/configfs/file.c index ef8c3cd10cc6..a48cece775a3 100644 --- a/fs/configfs/file.c +++ b/fs/configfs/file.c @@ -59,7 +59,7 @@ static int fill_read_buffer(struct file *file, struct con= figfs_buffer *buffer) ssize_t count =3D -ENOENT; =20 if (!buffer->page) - buffer->page =3D (char *) get_zeroed_page(GFP_KERNEL); + buffer->page =3D kzalloc(PAGE_SIZE, GFP_KERNEL); if (!buffer->page) return -ENOMEM; =20 @@ -184,7 +184,7 @@ static int fill_write_buffer(struct configfs_buffer *bu= ffer, int copied; =20 if (!buffer->page) - buffer->page =3D (char *)__get_free_pages(GFP_KERNEL, 0); + buffer->page =3D kmalloc(PAGE_SIZE, GFP_KERNEL); if (!buffer->page) return -ENOMEM; =20 @@ -381,8 +381,7 @@ static int configfs_release(struct inode *inode, struct= file *filp) struct configfs_buffer *buffer =3D filp->private_data; =20 module_put(buffer->owner); - if (buffer->page) - free_page((unsigned long)buffer->page); + kfree(buffer->page); mutex_destroy(&buffer->mutex); kfree(buffer); return 0; --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 BFF8036A374; Sat, 23 May 2026 17:56:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779559000; cv=none; b=dlyBXmzE6JBsbDGhViCynL8EJkWag+l2e09U/7Jzh92uBIujq0OiafK7zNNiY6bBRLOu7+7Zwx7ILuiMKsajjOnOb+avcF8IcsjrWQROfaFopdQ4kMcLy/J+lRWbQDudcY4c39lqVJjsq/Rr/U+Skpd/DkJcRWtO0sGHh2aeRqs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779559000; c=relaxed/simple; bh=XU20uLrOwUf9z96AonyK2eJYbZ7IIPLDPk49CorEEY4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MBarusJs5RL80YZEdZp3IqX0NDtqffPA/WSXGJHdrcEiRHMh12MgyGdntESAzOW51pujwoyQD+okXk8HaWJCAm6fHDILJfzGD4RPpYkjMib6je92ZAMEU6P4aRGzsftS8E49ZHOZYC9xb6Qsw4TisK1sBsMoGZmsmbpnotwZsLc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BBZAZdcE; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BBZAZdcE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A30DC1F000E9; Sat, 23 May 2026 17:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779558999; bh=ukrRzZydclNePROfQDTuyRdGagizkwrv8BiO6E2x4AA=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=BBZAZdcEVz/p/msk+v6WT2AsRtCoFYBx3Z0qlKQpUVbqTTbkufOrda1SFIO7l1SpK 0+apuNi1AgkI0nv8JogTKz8wOv4b5mpvv9u/xDPzwAED3kA3JFSABvqXVcMQHbe+lH VfZAKI61R0AS0GYB6HHcfVezMPaXJquvTDImNyT6NiTXW+RaW6vpy7tY0D+UKyAawh jCVkOl/9QaWWRWLTIeXzvccQTZ8YykJTCul62f93TjwBE+wLiNuNiL1GEnrH4p3nuK 9ErpfHG5KC/WNMAH6vNpsC3L+3apRTMtE61nyfp/IroAR1bZ/zd+pANUHOaQfbyAvV D/d7xN/FwOJkQ== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:28 +0300 Subject: [PATCH 16/17] binfmt_misc: replace __get_free_page() with kmalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-16-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 bm_entry_read() allocates temporary buffer using __get_free_page(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_page() with kmalloc(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/binfmt_misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index b3d8fd70e8b1..84349fcb93f1 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -704,7 +704,7 @@ bm_entry_read(struct file *file, char __user *buf, size= _t nbytes, loff_t *ppos) ssize_t res; char *page; =20 - page =3D (char *) __get_free_page(GFP_KERNEL); + page =3D kmalloc(PAGE_SIZE, GFP_KERNEL); if (!page) return -ENOMEM; =20 @@ -712,7 +712,7 @@ bm_entry_read(struct file *file, char __user *buf, size= _t nbytes, loff_t *ppos) =20 res =3D simple_read_from_buffer(buf, nbytes, ppos, page, strlen(page)); =20 - free_page((unsigned long) page); + kfree(page); return res; } =20 --=20 2.53.0 From nobody Sun May 24 18:41:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 6A07E2BB1D; Sat, 23 May 2026 17:56:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779559008; cv=none; b=HJ5KFQoUPkuZ/aNnpraIIc7zZZ+PxJOQl+QeApBuXkeofvj5wMZVgDX1atTMVGwQ2LxAu/xJhqILOkP62opqMB1Gc8DbTznXi1bJeW+xkYo4kO7azEATHcDKQ0CdfPCWblC1YYuqeTKSPiZFZ6Jxro5/GFR2K8fJvVls2jlFTwc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779559008; c=relaxed/simple; bh=ctfgg59w3W9Ve9cILqgBzW84u/gnz1aQjpp1bYMsf+M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KzhLlHQHV7uLf91Le/IRxCRl8XieuUGsFGjPlLgGKko6r78Z+ihN+ICFnBI5WTQHJOBlIYcjAHaLz01mez0xwTBu3ROFEwOGTViqPK/QWN+XdZPESZrfG+E4qqCwe78i00+ZKTwY/9SCjrTyCS2eox+WsR+zWdl948+gXzVfR/c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=m7xL6A+P; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="m7xL6A+P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 251481F00A3A; Sat, 23 May 2026 17:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779559007; bh=4ZPGEhDpFGQ4u9PuMAl3Sd2ga9kaV9qTLPAdSB24HI8=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=m7xL6A+PruyXrPWvmsAoypMnFQsfwqCPeKuQPez0FgnKXSO06Un5FB8QHqDpQb4H3 8QknBb1CUFzuPKF4giiNNpeUdLdIIIsPnz1Ln2weva2frsm2ejuVEJ0bFmsRwjAxNu i/DzE4LeSWzHIfmW+ns99umidgSpMcOIIIYllFd6PYxpQLLXwQ4XMKHOu1/fIaLcCt zhdM2i/e3b8Ke1xmeXKtbBVQbZpbUhT64iUOlh5+FfVjeiu90PmDJCNxVosZZxEitS O561RMw4EqfbRr+CldkljoL1KHUYKOwku2ScXQEPToGxFFI4OwACtEaaJ5nvb9VOZi 6JI2zyrKgrbMg== From: "Mike Rapoport (Microsoft)" Date: Sat, 23 May 2026 20:54:29 +0300 Subject: [PATCH 17/17] bfs: replace get_zeroed_page() with kzalloc() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260523-b4-fs-v1-17-275e36a83f0e@kernel.org> References: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> In-Reply-To: <20260523-b4-fs-v1-0-275e36a83f0e@kernel.org> To: Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Ryusuke Konishi , Viacheslav Dubeyko , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Alexander Viro , Christian Brauner , Jan Kara , Dave Kleikamp , Theodore Ts'o , Miklos Szeredi , Andreas Hindborg , Breno Leitao , Kees Cook , "Tigran A. Aivazian" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-mm@kvack.org, "Mike Rapoport (Microsoft)" X-Mailer: b4 0.15.2 bfs_dump_imap() allocates temporary buffer with get_zeroed_page(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of get_zeroed_page() with kzalloc(). Signed-off-by: Mike Rapoport (Microsoft) --- fs/bfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 19e49c8cf750..0d7b95371271 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -311,7 +311,7 @@ void bfs_dump_imap(const char *prefix, struct super_blo= ck *s) { #ifdef DEBUG int i; - char *tmpbuf =3D (char *)get_zeroed_page(GFP_KERNEL); + char *tmpbuf =3D kzalloc(PAGE_SIZE, GFP_KERNEL); =20 if (!tmpbuf) return; @@ -323,7 +323,7 @@ void bfs_dump_imap(const char *prefix, struct super_blo= ck *s) strcat(tmpbuf, "0"); } printf("%s: lasti=3D%08lx <%s>\n", prefix, BFS_SB(s)->si_lasti, tmpbuf); - free_page((unsigned long)tmpbuf); + kfree(tmpbuf); #endif } =20 --=20 2.53.0