linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 9p: Use kvmalloc for message buffers
@ 2025-07-30 15:08 Pierre Barre
  2025-07-30 16:08 ` Christian Schoenebeck
  0 siblings, 1 reply; 10+ messages in thread
From: Pierre Barre @ 2025-07-30 15:08 UTC (permalink / raw)
  To: v9fs; +Cc: ericvh, lucho, asmadeus, linux_oss, linux-kernel

While developing a 9P server (https://github.com/Barre/ZeroFS) and testing it under high-load, I was running into allocation failures. The failures occur even with plenty of free memory available because kmalloc requires contiguous physical memory.

This results in errors like:
ls: page allocation failure: order:7, mode:0x40c40(GFP_NOFS|__GFP_COMP)

Signed-off-by: Pierre Barre <pierre@barre.sh>
---
 net/9p/client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/9p/client.c b/net/9p/client.c
index 5c1ca57ccd28..f82b5674057c 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -230,7 +230,7 @@ static int p9_fcall_init(struct p9_client *c, struct p9_fcall *fc,
 		fc->sdata = kmem_cache_alloc(c->fcall_cache, GFP_NOFS);
 		fc->cache = c->fcall_cache;
 	} else {
-		fc->sdata = kmalloc(alloc_msize, GFP_NOFS);
+		fc->sdata = kvmalloc(alloc_msize, GFP_NOFS);
 		fc->cache = NULL;
 	}
 	if (!fc->sdata)
@@ -252,7 +252,7 @@ void p9_fcall_fini(struct p9_fcall *fc)
 	if (fc->cache)
 		kmem_cache_free(fc->cache, fc->sdata);
 	else
-		kfree(fc->sdata);
+		kvfree(fc->sdata);
 }
 EXPORT_SYMBOL(p9_fcall_fini);
 
-- 
2.39.5 (Apple Git-154)

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-08-08 11:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-30 15:08 [PATCH] 9p: Use kvmalloc for message buffers Pierre Barre
2025-07-30 16:08 ` Christian Schoenebeck
2025-07-30 16:19   ` Pierre Barre
2025-07-30 17:28     ` Christian Schoenebeck
2025-07-30 20:16       ` Pierre Barre
2025-07-30 22:07         ` asmadeus
2025-07-31  0:36           ` Pierre Barre
2025-08-06 15:50             ` Pierre Barre
2025-08-06 21:44               ` Dominique Martinet
2025-08-08 11:12                 ` Christian Schoenebeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).