linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Support user xattrs in cgroupfs
@ 2020-03-12 20:03 Daniel Xu
  2020-03-12 20:03 ` [PATCH v3 1/4] kernfs: kvmalloc xattr value instead of kmalloc Daniel Xu
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Daniel Xu @ 2020-03-12 20:03 UTC (permalink / raw)
  To: cgroups, tj, lizefan, hannes, viro
  Cc: Daniel Xu, shakeelb, linux-fsdevel, linux-kernel, gregkh, kernel-team

User extended attributes are useful as metadata storage for kernfs
consumers like cgroups. Especially in the case of cgroups, it is useful
to have a central metadata store that multiple processes/services can
use to coordinate actions.

A concrete example is for userspace out of memory killers. We want to
let delegated cgroup subtree owners (running as non-root) to be able to
say "please avoid killing this cgroup". This is especially important for
desktop linux as delegated subtrees owners are less likely to run as
root.

The first two commits set up some stuff for the third commit which
intro introduce a new flag, KERNFS_ROOT_SUPPORT_USER_XATTR,
that lets kernfs consumers enable user xattr support. The final commit
turns on user xattr support for cgroupfs.

Changes from v2:
- Rephrased commit message for "kernfs: kvmalloc xattr value instead of
  kmalloc"

Changes from v1:
- use kvmalloc for xattr values
- modify simple_xattr_set to return removed size
- add accounting for total user xattr size per cgroup

Daniel Xu (4):
  kernfs: kvmalloc xattr value instead of kmalloc
  kernfs: Add removed_size out param for simple_xattr_set
  kernfs: Add option to enable user xattrs
  cgroupfs: Support user xattrs

Daniel Xu (4):
  kernfs: kvmalloc xattr value instead of kmalloc
  kernfs: Add removed_size out param for simple_xattr_set
  kernfs: Add option to enable user xattrs
  cgroupfs: Support user xattrs

 fs/kernfs/inode.c           | 91 ++++++++++++++++++++++++++++++++++++-
 fs/kernfs/kernfs-internal.h |  2 +
 fs/xattr.c                  | 17 +++++--
 include/linux/kernfs.h      | 11 ++++-
 include/linux/xattr.h       |  3 +-
 kernel/cgroup/cgroup.c      |  3 +-
 mm/shmem.c                  |  2 +-
 7 files changed, 119 insertions(+), 10 deletions(-)

-- 
2.21.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-03-16 19:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12 20:03 [PATCH v3 0/4] Support user xattrs in cgroupfs Daniel Xu
2020-03-12 20:03 ` [PATCH v3 1/4] kernfs: kvmalloc xattr value instead of kmalloc Daniel Xu
2020-03-12 21:03   ` Shakeel Butt
2020-03-12 21:09   ` Andreas Dilger
2020-03-12 20:03 ` [PATCH v3 2/4] kernfs: Add removed_size out param for simple_xattr_set Daniel Xu
2020-03-12 20:03 ` [PATCH v3 3/4] kernfs: Add option to enable user xattrs Daniel Xu
2020-03-12 20:03 ` [PATCH v3 4/4] cgroupfs: Support " Daniel Xu
2020-03-12 20:09 ` [PATCH v3 0/4] Support user xattrs in cgroupfs Daniel Xu
2020-03-12 21:17 ` Tejun Heo
2020-03-12 21:19   ` Tejun Heo
2020-03-12 22:05   ` Greg KH
2020-03-13  1:00 ` Chris Down
2020-03-16 19:55 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).