Re: [PATCH 1/2] fuse: optimize struct fuse_conn fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 18 Apr 2025 at 23:06, Joanne Koong <joannelkoong@xxxxxxxxx> 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.

Not sure about that.

AFAIK aligned int or long is supposed to be independent from
neighboring fields on all architectures.  But that's definitely not
true of bitfields and I'm not sure about bool.  Maybe
READ_ONCE()/WRITE_ONCE() make accessing bool safe, but I haven't found
any documentation about that.

Previous rule about bitfields in fuse_conn have been that they are either

 - only set at INIT reply time, or
 - losing a setting due to a race is a non-issue

The new ones are not so clear cut, so it definitely needs some more
explanation why they are safe (if they are safe).

Thanks,
Miklos




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux