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/vfs/request.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/kernel/vfs/request.h') diff --git a/src/kernel/vfs/request.h b/src/kernel/vfs/request.h index cb560c9..ee33623 100644 --- a/src/kernel/vfs/request.h +++ b/src/kernel/vfs/request.h @@ -51,6 +51,8 @@ struct vfs_request { long offset; int flags; + /* if caller != NULL, owned by it - don't free, the allocation will be reused + * if caller == NULL, free on finish */ struct process *caller; struct vfs_backend *backend; -- cgit v1.2.3