From: Tejun Heo <tj@kernel.org>
To: Daniel Xu <dxu@dxuuu.xyz>
Cc: cgroups@vger.kernel.org, lizefan@huawei.com, hannes@cmpxchg.org,
linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
kernel-team@fb.com
Subject: Re: [PATCH 1/2] kernfs: Add option to enable user xattrs
Date: Wed, 4 Mar 2020 11:39:22 -0500 [thread overview]
Message-ID: <20200304163922.GG189690@mtj.thefacebook.com> (raw)
In-Reply-To: <C11GC2SN5D18.2S00I3KONE9ZE@dlxu-fedora-R90QNFJV>
Hello,
On Tue, Mar 03, 2020 at 11:37:28AM -0800, Daniel Xu wrote:
> It looks like in fs/xattr.c:setxattr, there is already:
>
> ...
> if (size) {
> if (size > XATTR_SIZE_MAX)
> return -E2BIG;
> ...
>
> where XATTR_SIZE_MAX is defined as 64k. Do you want it even smaller?
Oh, I missed that. Order 5 allocations can still be on the big side
tho. Ideally, something like the following?
* Total number of bytes limit as the primary limit so that we can say
that for a given cgroup user xattrs don't consume more than X bytes.
We can pick an arbitrary number which is large enough for most use
cases but not too big. e.g. 128k or whatever.
* Total number of xattrs limit. Again, some arbitrary not too low, not
too high limit.
* Switch to kvmalloc() for attr allocation so that we don't have to
worry about high order allocations.
Thanks.
--
tejun
next prev parent reply other threads:[~2020-03-04 16:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 1:38 [PATCH 0/2] Support user xattrs in cgroupfs Daniel Xu
2020-03-03 1:39 ` [PATCH 1/2] kernfs: Add option to enable user xattrs Daniel Xu
2020-03-03 13:19 ` Tejun Heo
2020-03-03 19:19 ` Daniel Xu
2020-03-03 19:37 ` Daniel Xu
2020-03-04 16:39 ` Tejun Heo [this message]
2020-03-03 1:39 ` [PATCH 2/2] cgroupfs: Support " Daniel Xu
2020-03-03 16:50 ` [PATCH 0/2] Support user xattrs in cgroupfs Shakeel Butt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200304163922.GG189690@mtj.thefacebook.com \
--to=tj@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=dxu@dxuuu.xyz \
--cc=gregkh@linuxfoundation.org \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).