From: Hanqing Zhao <ouckarlzhao@gmail.com>
To: rust-for-linux <rust-for-linux@vger.kernel.org>
Subject: [KernelAllocator] Usage of GlobalAlloc
Date: Fri, 21 May 2021 13:42:40 -0400 [thread overview]
Message-ID: <CAKmvQ+WEAFJCAn2my8iRUZBDvREExsFCydUxZxUxfSV51MK_Uw@mail.gmail.com> (raw)
Hi all,
While implementing an alloc crate, I intend to pass custom parameters
and extra parameters such as
memory flags (GFP_KERNEL, GFP_ATOMIC, etc) through the `Layout` parameter.
However, the current implementation of GlobalAlloc
(https://github.com/Rust-for-Linux/linux/blob/rust/rust/kernel/allocator.rs#L13)
is not actually used,
because the kernel allocation directly resorts to `__rust_alloc`
( https://github.com/Rust-for-Linux/linux/blob/rust/rust/kernel/allocator.rs\#L34),
`__rust_dealloc`, etc.
In this way, it hinders me to use the `layout` parameter.
Is this intended or avoidable?
Best,
Hanqing Zhao
Georgia Tech
next reply other threads:[~2021-05-21 17:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 17:42 Hanqing Zhao [this message]
2021-05-22 8:22 ` [KernelAllocator] Usage of GlobalAlloc Gary Guo
[not found] ` <CAKmvQ+UpHb0tBbYo9pR-YJa=SC3bd2T8pE_R8tLkOqKCsK9kXA@mail.gmail.com>
2021-05-22 19:17 ` Gary Guo
2021-05-22 20:30 ` Hanqing Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKmvQ+WEAFJCAn2my8iRUZBDvREExsFCydUxZxUxfSV51MK_Uw@mail.gmail.com \
--to=ouckarlzhao@gmail.com \
--cc=rust-for-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).