cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Jeff Moyer <jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org,
	ctalbott-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	rni-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	"Daniel P. Berrange"
	<berrange-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 11/11] blkcg: implement per-blkg request allocation
Date: Fri, 27 Apr 2012 13:21:10 -0400	[thread overview]
Message-ID: <20120427172110.GM10579@redhat.com> (raw)
In-Reply-To: <20120427162012.GP27486-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

On Fri, Apr 27, 2012 at 09:20:12AM -0700, Tejun Heo wrote:
> Hello,
> 
> On Fri, Apr 27, 2012 at 11:56:12AM -0400, Vivek Goyal wrote:
> > > I find allowing unpriv users creating cgroups dumb.  cgroup consumes
> > > kernel memory.  Sans using kmemcg, what prevents them from creating
> > > gazillion cgroups and consuming all memories?  The idea of allowing
> > > cgroups to !priv users is just broken from the get go.
> > 
> > Well creating a task consumes memory too but we allow unpriv users to
> > create tasks. :-)
> 
> We have ulimit.
> 
> > May be a system wide cgroup limit will make sense?
> 
> IMHO, this was one of the larger mistakes cgroup has made.  There are
> two ways when building interface for admin stuff like this, you can
> either implement and expose the core functionality and let userland
> deal with distribution or build things such that the kernel can fully
> virtualize and distribute the control to each process.  Both
> approaches have their pros and cons but I generally think it's better
> to go for the latter for new and extra stuff like cgroup as it is much
> simpler and tends to more flexible and adapts better as use cases
> develop.
> 
> The problem with cgroup is that it's neither the former or the latter.
> It's caught somewhere in the middle with its pants down where it does
> half-assed job of providing an interface which looks like it could be
> made to be directly accessible from !priv processes while not really
> being able to handle such usage.
> 
> I mean, just think about the case you just raised.  Forget about
> memory usage.  What about weights?  If you allow a random user to
> create arbitrary number of blkcg groups, [s]he gets 500 extra weight
> with each blkcg!  Yeah!

This is a concern only with flat hierarhcy. With full hierarchcal
it becomes a non-issue like cpu controller.

> 
> If we support full hierarchy on all controllers, exposing cgroups
> directly to !priv users may start to make more sense but I'd much
> prefer having resource policy controlled and administered centrally in
> userland.  It's a job much better suited for userland.  If such
> mechanism would require certain features, sure we can accomodate that
> but I think trying to allow !priv users directly to cgroup is stupid
> especially at this point, so let's just drop it.

For non-priviliged users, something along the lines of per session
cpu autogroup might make sense.  But even then if some IO is submitted
from that autoblkgroup, kernel can't claim that memory till IO is
completed.

So per cgroup number of request will probably be a problem even if
kenrel managed those completely.

So are you planning to put a patch in kernel to disallow cgroup creation
for non-priviliged users?

I am CCing Daniel Berrange (libvirt), who create cgroups for virtual
machines and containers. Just in case he is relying on creating cgroups
in unprivliged mode.

Thanks
Vivek

  parent reply	other threads:[~2012-04-27 17:21 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 21:59 [PATCHSET] block: implement per-blkg request allocation Tejun Heo
     [not found] ` <1335477561-11131-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2012-04-26 21:59   ` [PATCH 01/11] blkcg: fix blkg_alloc() failure path Tejun Heo
     [not found]     ` <1335477561-11131-2-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2012-04-27 14:26       ` Vivek Goyal
     [not found]         ` <20120427142652.GH10579-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-27 14:27           ` Tejun Heo
2012-04-26 21:59   ` [PATCH 02/11] blkcg: __blkg_lookup_create() doesn't have to fail on radix tree preload failure Tejun Heo
     [not found]     ` <1335477561-11131-3-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2012-04-27 14:42       ` Vivek Goyal
     [not found]         ` <20120427144258.GI10579-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-27 14:47           ` Tejun Heo
2012-04-27 21:18       ` [PATCH UPDATED 02/11] blkcg: __blkg_lookup_create() doesn't need radix preload Tejun Heo
2012-04-26 21:59   ` [PATCH 03/11] blkcg: make root blkcg allocation use %GFP_KERNEL Tejun Heo
     [not found]     ` <1335477561-11131-4-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2012-04-27 21:19       ` [PATCH UPDATED " Tejun Heo
2012-04-26 21:59   ` [PATCH 04/11] mempool: add @gfp_mask to mempool_create_node() Tejun Heo
2012-04-26 21:59   ` [PATCH 05/11] block: drop custom queue draining used by scsi_transport_{iscsi|fc} Tejun Heo
     [not found]     ` <1335477561-11131-6-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2012-05-02  4:55       ` Mike Christie
2012-04-26 21:59   ` [PATCH 06/11] block: refactor get_request[_wait]() Tejun Heo
2012-04-26 21:59   ` [PATCH 07/11] block: allocate io_context upfront Tejun Heo
2012-04-26 21:59   ` [PATCH 08/11] blkcg: inline bio_blkcg() and friends Tejun Heo
2012-04-26 21:59   ` [PATCH 10/11] block: prepare for multiple request_lists Tejun Heo
2012-04-26 21:59   ` [PATCH 11/11] blkcg: implement per-blkg request allocation Tejun Heo
     [not found]     ` <1335477561-11131-12-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2012-04-27 14:54       ` Jeff Moyer
     [not found]         ` <x49wr51usxi.fsf-RRHT56Q3PSP4kTEheFKJxxDDeQx5vsVwAInAS/Ez/D0@public.gmane.org>
2012-04-27 15:02           ` Tejun Heo
     [not found]             ` <20120427150217.GK27486-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-04-27 15:40               ` Vivek Goyal
     [not found]                 ` <20120427154033.GJ10579-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-27 15:45                   ` Tejun Heo
     [not found]                     ` <20120427154502.GM27486-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-04-27 15:48                       ` Vivek Goyal
     [not found]                         ` <20120427154841.GA16237-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-27 15:51                           ` Tejun Heo
     [not found]                             ` <20120427155140.GN27486-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-04-27 15:56                               ` Vivek Goyal
     [not found]                                 ` <20120427155612.GK10579-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-27 16:19                                   ` Vivek Goyal
2012-04-27 16:20                                   ` Tejun Heo
     [not found]                                     ` <20120427162012.GP27486-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-04-27 17:21                                       ` Vivek Goyal [this message]
     [not found]                                         ` <20120427172110.GM10579-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-27 17:25                                           ` Tejun Heo
2012-04-27 19:46       ` Vivek Goyal
     [not found]         ` <20120427194654.GN10579-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-27 20:15           ` Tejun Heo
     [not found]             ` <20120427201516.GJ26595-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-04-27 20:21               ` Vivek Goyal
2012-04-26 21:59 ` [PATCH 09/11] block: add q->nr_rqs[] and move q->rq.elvpriv to q->nr_rqs_elvpriv 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=20120427172110.GM10579@redhat.com \
    --to=vgoyal-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
    --cc=berrange-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=ctalbott-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rni-hpIqsD4AKlfQT0dZR+AlfA@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 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).