From d9da70c7c6230b9698dc4a1dbc4d7f05794d2740 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 3 Aug 2022 12:42:52 +0200 Subject: kernel: reuse a single allocation for all vfs_requests of a process $ iostress 32 512 0 > /vtty # before 512 calls, 0 bytes. avg 121133 $ iostress 32 512 0 > /vtty # after 512 calls, 0 bytes. avg 103540 103540/121133 = ~85% I think the tiny bit of added complexity is worth it here. --- src/kernel/proc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/kernel/proc.h') diff --git a/src/kernel/proc.h b/src/kernel/proc.h index c7e885a..d6f84bd 100644 --- a/src/kernel/proc.h +++ b/src/kernel/proc.h @@ -35,9 +35,6 @@ struct process { // saved value, meaning depends on .state union { int death_msg; // PS_DEAD - struct { - struct vfs_request *req; - } waits4fs; // PS_WAITS4FS struct { char __user *buf; size_t max_len; @@ -52,6 +49,9 @@ struct process { }; struct vfs_request *handled_req; + /* allocated once, the requests from WAITS4FS get stored here */ + struct vfs_request *reqslot; + /* vfs_backend controlled (not exclusively) by this process */ struct vfs_backend *controlled; -- cgit v1.2.3