[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h6h8sisp.fsf@metaspace.dk>
Date: Thu, 14 Mar 2024 20:41:10 +0100
From: Andreas Hindborg <nmi@...aspace.dk>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: Boqun Feng <boqun.feng@...il.com>, Jens Axboe <axboe@...nel.dk>,
Christoph Hellwig <hch@....de>, Keith Busch <kbusch@...nel.org>, Damien
Le Moal <Damien.LeMoal@....com>, Bart Van Assche <bvanassche@....org>,
Hannes Reinecke <hare@...e.de>, "linux-block@...r.kernel.org"
<linux-block@...r.kernel.org>, Andreas Hindborg <a.hindborg@...sung.com>,
Wedson Almeida Filho <wedsonaf@...il.com>, Niklas Cassel
<Niklas.Cassel@....com>, Greg KH <gregkh@...uxfoundation.org>, Matthew
Wilcox <willy@...radead.org>, Miguel Ojeda <ojeda@...nel.org>, Alex
Gaynor <alex.gaynor@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy
Baron <bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>,
Alice Ryhl <aliceryhl@...gle.com>, Chaitanya Kulkarni
<chaitanyak@...dia.com>, Luis Chamberlain <mcgrof@...nel.org>, Yexuan
Yang <1182282462@...t.edu.cn>, Sergio González Collado
<sergio.collado@...il.com>, Joel Granados <j.granados@...sung.com>,
"Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>, Daniel Gomez
<da.gomez@...sung.com>, open list <linux-kernel@...r.kernel.org>,
"rust-for-linux@...r.kernel.org" <rust-for-linux@...r.kernel.org>,
"lsf-pc@...ts.linux-foundation.org" <lsf-pc@...ts.linux-foundation.org>,
"gost.dev@...sung.com" <gost.dev@...sung.com>
Subject: Re: [RFC PATCH 1/5] rust: block: introduce `kernel::block::mq` module
Andreas Hindborg <nmi@...aspace.dk> writes:
> Miguel Ojeda <miguel.ojeda.sandonis@...il.com> writes:
>
>> On Thu, Mar 14, 2024 at 9:58 AM Andreas Hindborg <nmi@...aspace.dk> wrote:
>>>
>>> Yes, good point. Another option suggested by Miguel is that
>>> `__blk_mq_free_request` need not be exported at all. We can make it
>>> non-static and then call it from
>>> `rust_helper_blk_mq_free_request_internal()`. Then only the latter will
>>> be in the kernel image symbol table, which might be better in terms of
>>> not exposing `__blk_mq_free_request()` directly.
>>
>> The helper is not needed, i.e. what I meant was to make it non-static
>> and add it to `include/linux/blk-mq.h`.
>
> The way the current code compiles, <kernel::block::mq::Request as
> kernel::types::AlwaysRefCounted>::dec_ref` is inlined into the `rnull`
> module. A relocation for `rust_helper_blk_mq_free_request_internal`
> appears in `rnull_mod.ko`. I didn't test it yet, but if
> `__blk_mq_free_request` (or the helper) is not exported, I don't think
> this would be possible?
>
I just tested what you suggested Miguel, and I get a link error for
`__blk_mq_free_request` being undefined when the module is linked. This
is even though the code that calls this function lives in the `kernel`
crate, because it is inlined.
BR Andreas
Powered by blists - more mailing lists