From: Jingbo Xu <jefflexu@linux.alibaba.com>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org,
bernd.schubert@fastmail.fm, kernel-team@meta.com
Subject: Re: [PATCH 1/2] fuse: optimize struct fuse_conn fields
Date: Wed, 23 Apr 2025 13:50:01 +0800 [thread overview]
Message-ID: <aa430dfd-55dc-4079-8bc8-b63cc8a999bd@linux.alibaba.com> (raw)
In-Reply-To: <CAJnrk1ZN3MwWX8gdR7bu5jX5BpDzS_hyTs_V8S_oMh1fcm0J1w@mail.gmail.com>
On 4/23/25 12:25 AM, Joanne Koong wrote:
> On Mon, Apr 21, 2025 at 7:07 PM Jingbo Xu <jefflexu@linux.alibaba.com> wrote:
>>
>>
>>
>> On 4/19/25 5:06 AM, Joanne Koong wrote:
>>> Use a bitfield for tracking initialized, blocked, aborted, and io_uring
>>> state of the fuse connection. Track connected state using a bool instead
>>> of an unsigned.
>>>
>>> On a 64-bit system, this shaves off 16 bytes from the size of struct
>>> fuse_conn.
>>>
>>> No functional changes.
>>>
>>> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
>>> ---
>>> fs/fuse/fuse_i.h | 24 ++++++++++++------------
>>> 1 file changed, 12 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
>>> index b54f4f57789f..6aecada8aadd 100644
>>> --- a/fs/fuse/fuse_i.h
>>> +++ b/fs/fuse/fuse_i.h
>>> @@ -690,24 +690,24 @@ struct fuse_conn {
>>> * active_background, bg_queue, blocked */
>>> spinlock_t bg_lock;
>>>
>>> - /** Flag indicating that INIT reply has been received. Allocating
>>> - * any fuse request will be suspended until the flag is set */
>>> - int initialized;
>>> -
>>> - /** Flag indicating if connection is blocked. This will be
>>> - the case before the INIT reply is received, and if there
>>> - are too many outstading backgrounds requests */
>>> - int blocked;
>>> -
>>> /** waitq for blocked connection */
>>> wait_queue_head_t blocked_waitq;
>>>
>>> /** Connection established, cleared on umount, connection
>>> abort and device release */
>>> - unsigned connected;
>>> + bool connected;
>>
>> Why not also convert connected to bitfield?
>
> fuse_drop_waiting() checks the connected state locklessly through
> READ_ONCE(fc->connected). The smallest size READ_ONCE supports is a
> byte, I don't think it works on bitfields.
Okay, that makes sense. Thanks.
--
Thanks,
Jingbo
next prev parent reply other threads:[~2025-04-23 5:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 21:06 [PATCH 1/2] fuse: optimize struct fuse_conn fields Joanne Koong
2025-04-18 21:06 ` [PATCH 2/2] fuse: clean up struct fuse_conn bitfields Joanne Koong
2025-04-21 11:36 ` Bernd Schubert
2025-04-21 11:33 ` [PATCH 1/2] fuse: optimize struct fuse_conn fields Bernd Schubert
2025-04-22 2:07 ` Jingbo Xu
2025-04-22 16:25 ` Joanne Koong
2025-04-23 5:50 ` Jingbo Xu [this message]
2025-05-06 11:09 ` Miklos Szeredi
2025-05-12 17:36 ` Joanne Koong
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=aa430dfd-55dc-4079-8bc8-b63cc8a999bd@linux.alibaba.com \
--to=jefflexu@linux.alibaba.com \
--cc=bernd.schubert@fastmail.fm \
--cc=joannelkoong@gmail.com \
--cc=kernel-team@meta.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.