]> www.infradead.org Git - users/dwmw2/linux.git/commit
rust: alloc: add __GFP_HIGHMEM flag
authorAlice Ryhl <aliceryhl@google.com>
Fri, 7 Jun 2024 08:23:41 +0000 (08:23 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 8 Jul 2024 20:39:39 +0000 (22:39 +0200)
commitab44079e2869c9f1743d167d5f9b5befe375b6d9
tree3e0b69e1c73d2b7879aacda1ac3ec77b4c3c8719
parentd3ee24cce4e558041cbf21a5bc9cd9a4b1b3c7e7
rust: alloc: add __GFP_HIGHMEM flag

Make it possible to allocate memory that doesn't need to mapped into the
kernel's address space. This flag is useful together with
Page::alloc_page [1].

Rust Binder needs this for the memory that holds incoming transactions
for each process. Each process will have a few megabytes of memory
allocated with this flag, which is mapped into the process using
vm_insert_page. When the kernel copies data for an incoming transaction
into a process's memory region, it will use kmap_local_page to
temporarily map pages that are being modified. There is no need for them
to take up address space in the kernel when the kernel is not writing an
incoming transaction into the page.

Link: https://lore.kernel.org/all/20240528-alice-mm-v7-4-78222c31b8f4@google.com/
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20240607-highmem-v1-1-d18c5ca4072f@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/bindings/bindings_helper.h
rust/kernel/alloc.rs