From: Zefan Li <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kernel-team-b10kYP2dOMg@public.gmane.org
Subject: Re: [PATCHSET] kernfs, cgroup: reimplement "cgroup.procs" reading for v2
Date: Mon, 26 Dec 2016 14:22:18 +0800 [thread overview]
Message-ID: <5860B71A.9070006@huawei.com> (raw)
In-Reply-To: <20161220161222.15234-1-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
On 2016/12/21 0:12, Tejun Heo wrote:
> On cgroup v1, the pid listings in "cgroup.procs" and "tasks" are
> sorted which adds a lot of complications and overhead. v2 doesn't
> have such requirement and has been intentionally using a modified
> sorting order so that the output doesn't look sorted to users.
>
> This patchset re-implements "cgroup.procs" reading for v2 which simply
> keeps a css_task_iter open while the file is being read. Keeping the
> iterator open makes it unnecessary to skip to the right position on
> each read segment and associated errors - e.g. incorrectly skipping
> over pids because earlier pids disappeared between the reads.
>
> Using persistent iterator across multiple read calls requires
> ->release() callback to clean it up. kernfs operations
> ->open/release() are added and piped through cftype.
>
> This patchset contains the following five patches.
>
> 0001-kernfs-make-kernfs_open_file-mmapped-a-bitfield.patch
> 0002-kernfs-add-kernfs_ops-open-release-callbacks.patch
> 0003-cgroup-add-cftype-open-release-callbacks.patch
> 0004-cgroup-reimplement-reading-cgroup.procs-on-cgroup-v2.patch
> 0005-cgroup-remove-cgroup_pid_fry-and-friends.patch
>
> 0001 is a misc kernfs patch and 0002 adds ->open/release() to kernfs.
> 0003 pipes ->open/release() through cftype. 0004 implements the new
> cgroup.procs for v2 and 0005 removes the now unused sort order frying
> logic.
>
> Greg, would it be okay to route the kernfs patches through
> cgroup/for-4.11?
>
> The patches are also available in the following git branch.
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-cgroup2-procs
>
> diffstat follows. Thanks.
>
> fs/kernfs/dir.c | 2
> fs/kernfs/file.c | 53 +++++++++++++++--
> fs/kernfs/kernfs-internal.h | 2
> include/linux/cgroup-defs.h | 3 +
> include/linux/kernfs.h | 12 +++-
> kernel/cgroup.c | 130 +++++++++++++++++++++++++++++---------------
> 6 files changed, 148 insertions(+), 54 deletions(-)
>
Acked-by: Zefan Li <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
WARNING: multiple messages have this Message-ID (diff)
From: Zefan Li <lizefan@huawei.com>
To: Tejun Heo <tj@kernel.org>, <gregkh@linuxfoundation.org>,
<hannes@cmpxchg.org>
Cc: <linux-kernel@vger.kernel.org>, <cgroups@vger.kernel.org>,
<kernel-team@fb.com>
Subject: Re: [PATCHSET] kernfs, cgroup: reimplement "cgroup.procs" reading for v2
Date: Mon, 26 Dec 2016 14:22:18 +0800 [thread overview]
Message-ID: <5860B71A.9070006@huawei.com> (raw)
In-Reply-To: <20161220161222.15234-1-tj@kernel.org>
On 2016/12/21 0:12, Tejun Heo wrote:
> On cgroup v1, the pid listings in "cgroup.procs" and "tasks" are
> sorted which adds a lot of complications and overhead. v2 doesn't
> have such requirement and has been intentionally using a modified
> sorting order so that the output doesn't look sorted to users.
>
> This patchset re-implements "cgroup.procs" reading for v2 which simply
> keeps a css_task_iter open while the file is being read. Keeping the
> iterator open makes it unnecessary to skip to the right position on
> each read segment and associated errors - e.g. incorrectly skipping
> over pids because earlier pids disappeared between the reads.
>
> Using persistent iterator across multiple read calls requires
> ->release() callback to clean it up. kernfs operations
> ->open/release() are added and piped through cftype.
>
> This patchset contains the following five patches.
>
> 0001-kernfs-make-kernfs_open_file-mmapped-a-bitfield.patch
> 0002-kernfs-add-kernfs_ops-open-release-callbacks.patch
> 0003-cgroup-add-cftype-open-release-callbacks.patch
> 0004-cgroup-reimplement-reading-cgroup.procs-on-cgroup-v2.patch
> 0005-cgroup-remove-cgroup_pid_fry-and-friends.patch
>
> 0001 is a misc kernfs patch and 0002 adds ->open/release() to kernfs.
> 0003 pipes ->open/release() through cftype. 0004 implements the new
> cgroup.procs for v2 and 0005 removes the now unused sort order frying
> logic.
>
> Greg, would it be okay to route the kernfs patches through
> cgroup/for-4.11?
>
> The patches are also available in the following git branch.
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-cgroup2-procs
>
> diffstat follows. Thanks.
>
> fs/kernfs/dir.c | 2
> fs/kernfs/file.c | 53 +++++++++++++++--
> fs/kernfs/kernfs-internal.h | 2
> include/linux/cgroup-defs.h | 3 +
> include/linux/kernfs.h | 12 +++-
> kernel/cgroup.c | 130 +++++++++++++++++++++++++++++---------------
> 6 files changed, 148 insertions(+), 54 deletions(-)
>
Acked-by: Zefan Li <lizefan@huawei.com>
next prev parent reply other threads:[~2016-12-26 6:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-20 16:12 [PATCHSET] kernfs, cgroup: reimplement "cgroup.procs" reading for v2 Tejun Heo
2016-12-20 16:12 ` [PATCH 1/5] kernfs: make kernfs_open_file->mmapped a bitfield Tejun Heo
2016-12-20 16:12 ` [PATCH 2/5] kernfs: add kernfs_ops->open/release() callbacks Tejun Heo
2016-12-20 16:12 ` [PATCH 4/5] cgroup: reimplement reading "cgroup.procs" on cgroup v2 Tejun Heo
2016-12-20 16:12 ` [PATCH 5/5] cgroup: remove cgroup_pid_fry() and friends Tejun Heo
[not found] ` <20161220161222.15234-1-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-12-20 16:12 ` [PATCH 3/5] cgroup add cftype->open/release() callbacks Tejun Heo
2016-12-20 16:12 ` Tejun Heo
2016-12-21 9:59 ` [PATCHSET] kernfs, cgroup: reimplement "cgroup.procs" reading for v2 Greg KH
2016-12-21 9:59 ` Greg KH
2016-12-26 6:22 ` Zefan Li [this message]
2016-12-26 6:22 ` Zefan Li
2016-12-27 19:53 ` Tejun Heo
2016-12-27 19:53 ` Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2016-12-20 16:10 Tejun Heo
2016-12-20 16:17 ` Tejun Heo
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=5860B71A.9070006@huawei.com \
--to=lizefan-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=kernel-team-b10kYP2dOMg@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.