'node' can't be in union with 'rcu' because simple_xattr_list() uses 'node' to walk the list of xattrs with just rcu protection. call_rcu() on the freed xattr would corrupt the forward chaining that is used in this situation. Removing from the union results in a 16 byte increase in the size of simple_xattr. New measurements: v7.0 (no rhashtable): File creation: 993.40 bytes/file Xattr addition: 79.99 bytes/file v7.1-rc2 (per-inode rhashtable): File creation: 939.73 bytes/file Xattr addition: 1296.08 bytes/file v7.1-rc2 + this patch (per-sb rhashtable) File creation: 946.84 bytes/file Xattr addition: 111.86 bytes/file The overhead of a single xattr is reduced to nearly v7.0 levels. The per xattr overhead is slightly larger due to the addition of three pointers to struct simple_xattr. Fixes: 12e9e3cd03b5 ("simpe_xattr: use per-sb cache") Signed-off-by: Miklos Szeredi --- include/linux/xattr.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/linux/xattr.h b/include/linux/xattr.h index a75b99eb1f04..7aaaf4f8aff5 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h @@ -112,11 +112,9 @@ struct simple_xattr_cache { struct simple_xattr { struct rhash_head hash_node; - union { - struct list_head node; - struct rcu_head rcu; - }; struct list_head *parent; + struct list_head node; + struct rcu_head rcu; char *name; size_t size; char value[] __counted_by(size); -- 2.54.0