Re: [PATCH v3 0/3] cgroup: add xattr support

From: Aristeu Rozanski
Date: Mon Jul 23 2012 - 14:13:07 EST


On Sun, Jul 22, 2012 at 12:12:07PM -0700, Hugh Dickins wrote:
> Please, do not do this.
>
> It may be fun to implement, but not to review and maintain.
>
> If we're going to start supporting swappable kernel memory, tmpfs
> xattrs is not the right place to start, and libfs xattrs certainly not:
> they are a poor fit for swappable memory. (You contemplate using whole
> pages above: that will not be very kind to those without swap.)
>
> By all means continue Zefan's work to move xattr support from tmpfs
> to libfs (ah, to fs/xattr.c actually, okay), but keep them as kmem.
>
> Support setting and removing user xattrs only if the user has the
> appropriate capability (which root will have): looking through the
> list of existing capabilities, CAP_IPC_LOCK actually looks appropriate,
> although I admit its name certainly does not - it's the "lock down
> unlimited amounts of memory" capability.

ok, will have to do it in cgroupfs because it allows user prefixes, not the
case on tmpfs.

> And support setting and removing user xattrs only if the filesystem
> opts in to that: so cgroupfs can opt in, everything else stay out,
> and we know where to look when memory goes missing.

hm, for tmpfs, there's a config option for it, while cgroup has a mount
option, default off.

> Will "lsattr -R" in the cgroupfs mountpoint do enough to judge how
> much memory is being used in this way? I expect not, but I'm
> unfamliar with it: you may need to show counts elsewhere.

that's for ext{2,3,4} file attributes, not extended attributes. but agreed,
there's a need to have this stat somewhere. Tejun, any ideas?

--
Aristeu

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/