From a70cc5ca1dc6ae0c64e734c0f234c75ab8a184dc Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 23 Feb 2020 09:28:31 +0100 Subject: [PATCH] Kernel: Commit the entire region up front in KBuffer::copy() Since we know exactly how much physical memory we'll need, we might as well commit it up front instead of letting page faults drive it. --- Kernel/KBuffer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Kernel/KBuffer.h b/Kernel/KBuffer.h index 0b529b821e9..dd39544e067 100644 --- a/Kernel/KBuffer.h +++ b/Kernel/KBuffer.h @@ -56,6 +56,7 @@ public: static NonnullRefPtr copy(const void* data, size_t size, u8 access, const char* name) { auto buffer = create_with_size(size, access, name); + buffer->region().commit(); memcpy(buffer->data(), data, size); return buffer; }