Re: [PATCH] uidgid: make sure we fit into one cacheline

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

 



On Tue, Sep 10, 2024 at 12:48:16PM +0200, Mateusz Guzik wrote:
> May I suggest adding a compile-time assert on the size? While it may be
> growing it will be unavoidable at some point, it at least wont happen
> unintentionally.

That should be fine for this structure since everything is defined in
terms of types that should be fixed across architectures, and they
aren't using any types that might change depending on the kernel
config, but as a general matter, we should be a bit careful when
rearranging structrues to avoid holes and to keep things on the same
cache line.

I recently had a patch submission which was rearranging structure
order for an ext4 data structure, and what worked for the patch
submitter didn't work for me, because of differences between kernel
configs and/or architecture types.

So it's been on my todo list to do a sanity check of various ext4
structuers, but to do so checking a number of different architectures
and common production kernel configs (I don't really care if enabling
lockdep results in more holes, because performance is going to be
impacted way more for reasons other than cache lines :-).

Hmm, maybe fodder for a GSOC or intern project would be creating some
kind of automation to check for optimal structure layouts across
multiple configs/architectures?

	     	      	      	    	       - Ted




[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