From: Jens Axboe <[email protected]>
To: Stefan Roesch <[email protected]>,
Linus Torvalds <[email protected]>
Cc: io-uring <[email protected]>,
linux-fsdevel <[email protected]>,
Kernel Team <[email protected]>,
Pavel Begunkov <[email protected]>
Subject: Re: [PATCH v5 3/5] fs: split off do_getxattr from getxattr
Date: Tue, 21 Dec 2021 15:57:25 -0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 12/21/21 2:59 PM, Stefan Roesch wrote:
>
>
> On 12/21/21 11:18 AM, Linus Torvalds wrote:
>> On Tue, Dec 21, 2021 at 11:15 AM Stefan Roesch <[email protected]> wrote:
>>>
>>> Linus, if we remove the constness, then we either need to cast away the constness (the system call
>>> is defined as const) or change the definition of the system call.
>>
>> You could also do it as
>>
>> union {
>> const void __user *setxattr_value;
>> void __user *getxattr_value;
>> };
>>
>
> Pavel brought up a very good point. By adding the kname array into the
> xarray_ctx we increase the size of io_xattr structure too much. In
> addition this will also increase the size of the io_kiocb structure.
> The original solution did not increase the size.
>
> Per opcode we limit the storage space to 64 bytes. However the array
> itself requires 256 bytes.
Just to expand on that a bit - part of struct io_kiocb is per-command
data, and we try pretty hard to keep that at 64-bytes as that's the
largest one we currently have. If we add the array to the io_xattr
structure, then that will increase the whole io_kiocb from 224 bytes to
more than twice that.
So there are really two options here:
1) The xattr_ctx structure goes into the async data that a command has
to allocate for deferred execution. This isn't a _huge_ deal as we
have to defer the xattr commands for now anyway, as the VFS doesn't
support a nonblocking version of that yet. But it would still be nice
not to have to do that.
2) We keep the original interface that Stefan proposed, leaving the
xattr_ctx bits embedded as they fit fine like that.
#2 would be a bit more efficient, but I don't feel that strongly about
it for this particular case.
Comments?
--
Jens Axboe
next prev parent reply other threads:[~2021-12-21 22:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-21 16:49 [PATCH v5 0/5] io_uring: add xattr support Stefan Roesch
2021-12-21 16:49 ` [PATCH v5 1/5] fs: split off do_user_path_at_empty from user_path_at_empty() Stefan Roesch
2021-12-21 16:49 ` [PATCH v5 2/5] fs: split off setxattr_setup function from setxattr Stefan Roesch
2021-12-21 16:49 ` [PATCH v5 3/5] fs: split off do_getxattr from getxattr Stefan Roesch
2021-12-21 17:22 ` Linus Torvalds
2021-12-21 19:15 ` Stefan Roesch
2021-12-21 19:18 ` Linus Torvalds
2021-12-21 21:59 ` Stefan Roesch
2021-12-21 22:57 ` Jens Axboe [this message]
2021-12-21 16:49 ` [PATCH v5 4/5] io_uring: add fsetxattr and setxattr support Stefan Roesch
2021-12-21 16:49 ` [PATCH v5 5/5] io_uring: add fgetxattr and getxattr support Stefan Roesch
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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