public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Tejun Heo <tj@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
	Li Zefan <lizefan@huawei.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Song Liu <liu.song.a23@gmail.com>,
	cgroups@vger.kernel.org
Subject: [PATCH v2 0/2] cgroup: Sync cgroup id and inode number
Date: Mon,  4 Nov 2019 17:45:18 +0900	[thread overview]
Message-ID: <20191104084520.398584-1-namhyung@kernel.org> (raw)

Hello,

This patchset changes cgroup inode number and id management to be in
sync with kernfs.  The cgroup inode number is managed by kernfs but
cgroup id is allocated by a separate idr.  The idea is to have a
single id for internal usage, inode number and file handle which can
be accessed from userspace.  Actually this work is from Tejun who also
provided the idea.  I just took over the work and fixed some errors
and finally was able to run perf for testing.

The background of this work is that I want to add cgroup sampling
feature in the perf event subsystem.  As Tejun mentioned that using
cgroup id is not enough and it'd better using file handle instead.
But getting file handle in perf NMI handler is not possible so I want
to get the info from a cgroup node.

The first patch converted kernfs id into a single 64bit number and in
the second patch cgroup uses the kernfs id as cgroup id.

The patches are based on the for-next branch in Tejun's cgroup tree.
Tested with tools/testing/selftests/cgroup/test_stress.sh.

Thanks
Namhyung


Tejun Heo (2):
      kernfs: Convert to u64 id
      cgroup: Use 64bit id from kernfs

 fs/kernfs/dir.c                  | 36 +++++++++++++++++++------------
 fs/kernfs/file.c                 |  4 ++--
 fs/kernfs/inode.c                |  4 ++--
 fs/kernfs/kernfs-internal.h      |  2 --
 fs/kernfs/mount.c                | 92 +++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
 include/linux/cgroup-defs.h      | 18 ++++------------
 include/linux/cgroup.h           | 17 +++++++--------
 include/linux/exportfs.h         |  5 +++++
 include/linux/kernfs.h           | 47 +++++++++++++++++++++++++----------------
 include/net/netprio_cgroup.h     |  8 +++----
 include/trace/events/writeback.h | 92 ++++++++++++++++++++++++++++++++++++++++----------------------------------------
 kernel/bpf/helpers.c             |  2 +-
 kernel/cgroup/cgroup.c           | 68 +++++++++++++++++++----------------------------------------
 kernel/trace/blktrace.c          | 66 +++++++++++++++++++++++++++------------------------------
 net/core/filter.c                |  4 ++--
 net/core/netprio_cgroup.c        |  4 ++--
 16 files changed, 236 insertions(+), 233 deletions(-)

-- 
2.23.0.700.g56cf767bdb-goog


             reply	other threads:[~2019-11-04  8:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04  8:45 Namhyung Kim [this message]
2019-11-04  8:45 ` [PATCH v2 1/2] kernfs: Convert to u64 id Namhyung Kim
2019-11-04 13:59   ` Steven Rostedt
2019-11-04  8:45 ` [PATCH v2 2/2] cgroup: Use 64bit id from kernfs Namhyung Kim
2019-11-04 18:58   ` David Miller
2019-11-04 16:49 ` [PATCH v2 0/2] cgroup: Sync cgroup id and inode number 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=20191104084520.398584-1-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liu.song.a23@gmail.com \
    --cc=lizefan@huawei.com \
    --cc=rafael@kernel.org \
    --cc=tj@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox