[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-10-07 Thread Tejun Heo
Hello, Glauber. On Thu, Oct 04, 2012 at 03:55:14PM +0400, Glauber Costa wrote: > I don't want to bloat unrelated kmem_cache structures, so I can't embed > a memcg array in there: I would have to have a pointer to a memcg array > that gets assigned at first use. But if we don't want to have a stati

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-10-07 Thread Michal Hocko
On Thu 04-10-12 07:43:16, Tejun Heo wrote: [...] > > That is right but I think that the current discussion shows that a mixed > > (kmem disabled and kmem enabled hierarchies) workloads are far from > > being theoretical and a global knob is just too coarse. I am afraid we > > I'm not sure there's

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-10-04 Thread Glauber Costa
On 10/04/2012 02:54 AM, Tejun Heo wrote: > Hello, Glauber. > > On Mon, Oct 01, 2012 at 12:45:11PM +0400, Glauber Costa wrote: >>> where kmemcg_slab_idx is updated from sched notifier (or maybe add and >>> use current->kmemcg_slab_idx?). You would still need __GFP_* and >>> in_interrupt() tests bu

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-10-03 Thread Tejun Heo
Hello, Glauber. On Mon, Oct 01, 2012 at 12:46:02PM +0400, Glauber Costa wrote: > > Yeah, it will need some hooks. For dentry and inode, I think it would > > be pretty well isolated tho. Wasn't it? > > We would still need something for the stack. For open files, and for > everything that becomes

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-10-03 Thread Tejun Heo
Hello, Glauber. On Mon, Oct 01, 2012 at 12:45:11PM +0400, Glauber Costa wrote: > > where kmemcg_slab_idx is updated from sched notifier (or maybe add and > > use current->kmemcg_slab_idx?). You would still need __GFP_* and > > in_interrupt() tests but current->mm and PF_KTHREAD tests can be > > r

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-10-03 Thread Tejun Heo
Hey, Michal. On Mon, Oct 01, 2012 at 11:27:56AM +0200, Michal Hocko wrote: > > Yeah but, if we can get it down to, say, around 1% under most > > workloads for memcg users, it is quite questionable to introduce full > > hierarchical configuration to allow avoiding that, isn't it? > > Remember that

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-10-01 Thread Michal Hocko
Hi, On Sun 30-09-12 17:47:50, Tejun Heo wrote: [...] > > > The hot path overhead is quite minimal - it doesn't do much more than > > > indirecting one more time. In terms of memory usage, it sure could > > > lead to a bit more fragmentation but even if it gets to several megs > > > per cgroup, I

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-10-01 Thread Glauber Costa
On 09/30/2012 02:37 PM, Tejun Heo wrote: > Hello, James. > > On Sun, Sep 30, 2012 at 09:56:28AM +0100, James Bottomley wrote: >> The beancounter approach originally used by OpenVZ does exactly this. >> There are two specific problems, though, firstly you can't count >> references in generic code,

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-10-01 Thread Glauber Costa
On 09/30/2012 12:23 PM, Tejun Heo wrote: > Hello, Glauber. > > On Thu, Sep 27, 2012 at 10:30:36PM +0400, Glauber Costa wrote: >>> But that happens only when pages enter and leave slab and if it still >>> is significant, we can try to further optimize charging. Given that >>> this is only for case

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-10-01 Thread Glauber Costa
On 10/01/2012 04:57 AM, Tejun Heo wrote: > Hello, James. > > On Sun, Sep 30, 2012 at 12:25:52PM +0100, James Bottomley wrote: >> But you've got to ask yourself who cares about accurate accounting per >> container of dentry and inode objects? They're not objects that any >> administrator is used to

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-10-01 Thread Glauber Costa
On 09/30/2012 11:57 AM, Tejun Heo wrote: > Hello, Glauber. > > On Thu, Sep 27, 2012 at 10:45:01PM +0400, Glauber Costa wrote: >>> Can you please give other examples of cases where this type of issue >>> exists (plenty of shared kernel data structure which is inherent to >>> the workload at hand)?

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-30 Thread Tejun Heo
Hello, James. On Sun, Sep 30, 2012 at 12:25:52PM +0100, James Bottomley wrote: > But you've got to ask yourself who cares about accurate accounting per > container of dentry and inode objects? They're not objects that any > administrator is used to limiting. What we at parallels care about > isn'

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-30 Thread James Bottomley
On Sun, 2012-09-30 at 19:37 +0900, Tejun Heo wrote: > Hello, James. > > On Sun, Sep 30, 2012 at 09:56:28AM +0100, James Bottomley wrote: > > The beancounter approach originally used by OpenVZ does exactly this. > > There are two specific problems, though, firstly you can't count > > references in

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-30 Thread Tejun Heo
Hello, James. On Sun, Sep 30, 2012 at 09:56:28AM +0100, James Bottomley wrote: > The beancounter approach originally used by OpenVZ does exactly this. > There are two specific problems, though, firstly you can't count > references in generic code, so now you have to extend the cgroup > tentacles i

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-30 Thread James Bottomley
On Sun, 2012-09-30 at 17:02 +0900, Tejun Heo wrote: > On Sun, Sep 30, 2012 at 04:57:00PM +0900, Tejun Heo wrote: > > On Thu, Sep 27, 2012 at 10:45:01PM +0400, Glauber Costa wrote: > > > > Can you please give other examples of cases where this type of issue > > > > exists (plenty of shared kernel da

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-30 Thread Tejun Heo
Hello, Michal. On Thu, Sep 27, 2012 at 05:09:50PM +0200, Michal Hocko wrote: > On Thu 27-09-12 07:33:00, Tejun Heo wrote: > > I'm not too convinced. First of all, the overhead added by kmemcg > > isn't big. > > You are probably talking about memory overhead which is indeed not that > big (excep

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-30 Thread Tejun Heo
Hello, Glauber. On Thu, Sep 27, 2012 at 10:30:36PM +0400, Glauber Costa wrote: > > But that happens only when pages enter and leave slab and if it still > > is significant, we can try to further optimize charging. Given that > > this is only for cases where memcg is already in use and we provide

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-30 Thread Tejun Heo
On Sun, Sep 30, 2012 at 04:57:00PM +0900, Tejun Heo wrote: > On Thu, Sep 27, 2012 at 10:45:01PM +0400, Glauber Costa wrote: > > > Can you please give other examples of cases where this type of issue > > > exists (plenty of shared kernel data structure which is inherent to > > > the workload at hand

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-30 Thread Tejun Heo
Hello, Glauber. On Thu, Sep 27, 2012 at 10:45:01PM +0400, Glauber Costa wrote: > > Can you please give other examples of cases where this type of issue > > exists (plenty of shared kernel data structure which is inherent to > > the workload at hand)? Until now, this has been the only example for

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Glauber Costa
On 09/27/2012 09:46 PM, Tejun Heo wrote: > Hello, > > On Thu, Sep 27, 2012 at 06:57:59PM +0400, Glauber Costa wrote: >>> Because we're not even trying to actually solve the problem but just >>> dumping it to userland. If dentry/inode usage is the only case we're >>> being worried about, there can

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Glauber Costa
On 09/27/2012 06:58 PM, Tejun Heo wrote: > Hello, Mel. > > On Thu, Sep 27, 2012 at 03:43:07PM +0100, Mel Gorman wrote: >>> I'm not too convinced. First of all, the overhead added by kmemcg >>> isn't big. >> >> Really? >> >> If kmemcg was globally accounted then every __GFP_KMEMCG allocation in >

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Michal Hocko
On Thu 27-09-12 10:46:05, Tejun Heo wrote: [...] > > > The part I nacked is enabling kmemcg on a populated cgroup and then > > > starting accounting from then without any apparent indication that any > > > past allocation hasn't been considered. You end up with numbers which > > > nobody can't tel

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Tejun Heo
Hello, On Thu, Sep 27, 2012 at 06:57:59PM +0400, Glauber Costa wrote: > > Because we're not even trying to actually solve the problem but just > > dumping it to userland. If dentry/inode usage is the only case we're > > being worried about, there can be better ways to solve it or at least > > we

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Glauber Costa
On 09/27/2012 06:49 PM, Tejun Heo wrote: > Hello, Mel. > > On Thu, Sep 27, 2012 at 03:28:22PM +0100, Mel Gorman wrote: >>> In addition, how is userland supposed to know which >>> workload is shared kmem heavy or not? >> >> By using a bit of common sense. >> >> An application may not be able to fi

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Michal Hocko
On Thu 27-09-12 07:33:00, Tejun Heo wrote: > Hello, Michal. > > On Thu, Sep 27, 2012 at 02:08:06PM +0200, Michal Hocko wrote: > > Yes, because we have many users (basically almost all) who care only > > about the user memory because that's what occupies the vast majority of > > the memory. They us

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Tejun Heo
Hello, Mel. On Thu, Sep 27, 2012 at 03:43:07PM +0100, Mel Gorman wrote: > > I'm not too convinced. First of all, the overhead added by kmemcg > > isn't big. > > Really? > > If kmemcg was globally accounted then every __GFP_KMEMCG allocation in > the page allocator potentially ends up down in >

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Tejun Heo
Hello, Mel. On Thu, Sep 27, 2012 at 03:28:22PM +0100, Mel Gorman wrote: > > In addition, how is userland supposed to know which > > workload is shared kmem heavy or not? > > By using a bit of common sense. > > An application may not be able to figure this out but the administrator > is going to

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Mel Gorman
On Thu, Sep 27, 2012 at 07:33:00AM -0700, Tejun Heo wrote: > Hello, Michal. > > On Thu, Sep 27, 2012 at 02:08:06PM +0200, Michal Hocko wrote: > > Yes, because we have many users (basically almost all) who care only > > about the user memory because that's what occupies the vast majority of > > the

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Tejun Heo
Hello, Michal. On Thu, Sep 27, 2012 at 02:08:06PM +0200, Michal Hocko wrote: > Yes, because we have many users (basically almost all) who care only > about the user memory because that's what occupies the vast majority of > the memory. They usually want to isolate workload which would disrupt > th

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Mel Gorman
On Wed, Sep 26, 2012 at 04:08:07PM -0700, Tejun Heo wrote: > Hello, Glauber. > > On Thu, Sep 27, 2012 at 02:54:11AM +0400, Glauber Costa wrote: > > I don't. Much has been said in the past about the problem of sharing. A > > lot of the kernel objects are shared by nature, this is pretty much > > un

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Michal Hocko
On Thu 27-09-12 16:40:03, Glauber Costa wrote: > On 09/27/2012 04:40 PM, Michal Hocko wrote: > > On Thu 27-09-12 16:20:55, Glauber Costa wrote: > >> On 09/27/2012 04:15 PM, Michal Hocko wrote: > >>> On Wed 26-09-12 16:33:34, Tejun Heo wrote: > >>> [...] > >> So, this seems properly crazy to me

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Glauber Costa
On 09/27/2012 04:40 PM, Michal Hocko wrote: > On Thu 27-09-12 16:20:55, Glauber Costa wrote: >> On 09/27/2012 04:15 PM, Michal Hocko wrote: >>> On Wed 26-09-12 16:33:34, Tejun Heo wrote: >>> [...] >> So, this seems properly crazy to me at the similar level of >> use_hierarchy fiasco. I'm g

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Michal Hocko
On Thu 27-09-12 16:20:55, Glauber Costa wrote: > On 09/27/2012 04:15 PM, Michal Hocko wrote: > > On Wed 26-09-12 16:33:34, Tejun Heo wrote: > > [...] > So, this seems properly crazy to me at the similar level of > use_hierarchy fiasco. I'm gonna NACK on this. > >>> > >>> As I said: all u

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Glauber Costa
On 09/27/2012 04:15 PM, Michal Hocko wrote: > On Wed 26-09-12 16:33:34, Tejun Heo wrote: > [...] So, this seems properly crazy to me at the similar level of use_hierarchy fiasco. I'm gonna NACK on this. >>> >>> As I said: all use cases I particularly care about are covered by a >>> globa

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Michal Hocko
On Wed 26-09-12 16:33:34, Tejun Heo wrote: [...] > > > So, this seems properly crazy to me at the similar level of > > > use_hierarchy fiasco. I'm gonna NACK on this. > > > > As I said: all use cases I particularly care about are covered by a > > global switch. > > > > I am laying down my views

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Glauber Costa
>>> Michal, Johannes, Kamezawa, what are your thoughts? >>> >> waiting! =) > > Well, you guys generated a lot of discussion that one has to read > through, didn't you :P > We're quite good at that! ___ Devel mailing list Devel@openvz.org https://open

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-27 Thread Michal Hocko
On Thu 27-09-12 01:24:40, Glauber Costa wrote: [...] > About use cases, I've already responded: my containers use case is kmem > limited. There are people like Michal that specifically asked for > user-only semantics to be preserved. Yes, because we have many users (basically almost all) who care

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Tejun Heo
Hello, On Thu, Sep 27, 2012 at 03:20:27AM +0400, Glauber Costa wrote: > > One of the things wrong with that is that it exposes the limitation of > > the current implementation as interface to userland, which is never a > > good idea. In addition, how is userland supposed to know which > > workloa

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Glauber Costa
On 09/27/2012 03:08 AM, Tejun Heo wrote: > Hello, Glauber. > > On Thu, Sep 27, 2012 at 02:54:11AM +0400, Glauber Costa wrote: >> I don't. Much has been said in the past about the problem of sharing. A >> lot of the kernel objects are shared by nature, this is pretty much >> unavoidable. The answer

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Tejun Heo
Hello, Glauber. On Thu, Sep 27, 2012 at 02:54:11AM +0400, Glauber Costa wrote: > I don't. Much has been said in the past about the problem of sharing. A > lot of the kernel objects are shared by nature, this is pretty much > unavoidable. The answer we have been giving to this inquiry, is that the

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Glauber Costa
On 09/27/2012 02:42 AM, Tejun Heo wrote: > Hello, Glauber. > > On Thu, Sep 27, 2012 at 02:29:06AM +0400, Glauber Costa wrote: >> And then what? If you want a different behavior you need to go kill all >> your services that are using memcg so you can get the behavior you want? >> And if they happen

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Glauber Costa
On 09/27/2012 02:11 AM, Johannes Weiner wrote: > On Thu, Sep 27, 2012 at 12:02:14AM +0400, Glauber Costa wrote: >> On 09/26/2012 11:56 PM, Tejun Heo wrote: >>> Hello, >>> >>> On Wed, Sep 26, 2012 at 11:46:37PM +0400, Glauber Costa wrote: Besides not being part of cgroup core, and respecting ve

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Tejun Heo
Hello, Glauber. On Thu, Sep 27, 2012 at 02:29:06AM +0400, Glauber Costa wrote: > And then what? If you want a different behavior you need to go kill all > your services that are using memcg so you can get the behavior you want? > And if they happen to be making a specific flag choice by design, yo

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Glauber Costa
On 09/27/2012 02:10 AM, Tejun Heo wrote: > Hello, Glauber. > > On Thu, Sep 27, 2012 at 01:24:40AM +0400, Glauber Costa wrote: >> "kmem_accounted" is not a switch. It is an internal representation only. >> The semantics, that we discussed exhaustively in San Diego, is that a >> group that is not li

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Johannes Weiner
On Thu, Sep 27, 2012 at 12:02:14AM +0400, Glauber Costa wrote: > On 09/26/2012 11:56 PM, Tejun Heo wrote: > > Hello, > > > > On Wed, Sep 26, 2012 at 11:46:37PM +0400, Glauber Costa wrote: > >> Besides not being part of cgroup core, and respecting very much both > >> cgroups' and basic sanity prope

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Tejun Heo
Hello, Glauber. On Thu, Sep 27, 2012 at 01:24:40AM +0400, Glauber Costa wrote: > "kmem_accounted" is not a switch. It is an internal representation only. > The semantics, that we discussed exhaustively in San Diego, is that a > group that is not limited is not accounted. This is simple and consist

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Glauber Costa
On 09/27/2012 12:16 AM, Tejun Heo wrote: > On Thu, Sep 27, 2012 at 12:02:14AM +0400, Glauber Costa wrote: >> But think in terms of functionality: This thing here is a lot more >> similar to swap than use_hierarchy. Would you argue that memsw should be >> per-root ? > > I'm fairly sure you can make

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Tejun Heo
On Thu, Sep 27, 2012 at 12:02:14AM +0400, Glauber Costa wrote: > But think in terms of functionality: This thing here is a lot more > similar to swap than use_hierarchy. Would you argue that memsw should be > per-root ? I'm fairly sure you can make about the same argument about use_hierarchy. The

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Glauber Costa
On 09/26/2012 11:56 PM, Tejun Heo wrote: > Hello, > > On Wed, Sep 26, 2012 at 11:46:37PM +0400, Glauber Costa wrote: >> Besides not being part of cgroup core, and respecting very much both >> cgroups' and basic sanity properties, kmem is an actual feature that >> some people want, and some people

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Tejun Heo
Hello, On Wed, Sep 26, 2012 at 11:46:37PM +0400, Glauber Costa wrote: > Besides not being part of cgroup core, and respecting very much both > cgroups' and basic sanity properties, kmem is an actual feature that > some people want, and some people don't. There is no reason to believe > that applic

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Glauber Costa
On 09/26/2012 11:34 PM, Tejun Heo wrote: > Hello, > > On Wed, Sep 26, 2012 at 10:56:09PM +0400, Glauber Costa wrote: >> For me, it is the other way around: it makes perfect sense to have a >> per-subtree selection of features where it doesn't hurt us, provided it >> is hierarchical. For the mere f

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Tejun Heo
Hello, On Wed, Sep 26, 2012 at 10:56:09PM +0400, Glauber Costa wrote: > For me, it is the other way around: it makes perfect sense to have a > per-subtree selection of features where it doesn't hurt us, provided it > is hierarchical. For the mere fact that not every application is > interested in

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Glauber Costa
On 09/26/2012 10:01 PM, Tejun Heo wrote: > Hello, > > On Wed, Sep 26, 2012 at 09:53:09PM +0400, Glauber Costa wrote: >> I understand your trauma about over flexibility, and you know I share of >> it. But I don't think there is any need to cap it here. Given kmem >> accounted is perfectly hierarchi

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Tejun Heo
Hello, On Wed, Sep 26, 2012 at 09:53:09PM +0400, Glauber Costa wrote: > I understand your trauma about over flexibility, and you know I share of > it. But I don't think there is any need to cap it here. Given kmem > accounted is perfectly hierarchical, and there seem to be plenty of > people who o

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Glauber Costa
On 09/26/2012 09:44 PM, Tejun Heo wrote: > Hello, Glauber. > > On Wed, Sep 26, 2012 at 10:36 AM, Glauber Costa wrote: >> This was discussed multiple times. Our interest is to preserve existing >> deployed setup, that were tuned in a world where kmem didn't exist. >> Because we also feed kmem to t

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Tejun Heo
Hello, Glauber. On Wed, Sep 26, 2012 at 10:36 AM, Glauber Costa wrote: > This was discussed multiple times. Our interest is to preserve existing > deployed setup, that were tuned in a world where kmem didn't exist. > Because we also feed kmem to the user counter, this may very well > disrupt thei

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Glauber Costa
On 09/26/2012 08:36 PM, Tejun Heo wrote: > Hello, Michal, Glauber. > > On Wed, Sep 26, 2012 at 04:03:47PM +0200, Michal Hocko wrote: >> Haven't we already discussed that a new memcg should inherit kmem_accounted >> from its parent for use_hierarchy? >> Say we have >> root >> | >> A (kmem_accounted

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Glauber Costa
On 09/26/2012 08:01 PM, Michal Hocko wrote: > On Wed 26-09-12 18:33:10, Glauber Costa wrote: >> On 09/26/2012 06:03 PM, Michal Hocko wrote: >>> On Tue 18-09-12 18:04:01, Glauber Costa wrote: > [...] @@ -4961,6 +5015,12 @@ mem_cgroup_create(struct cgroup *cont) int cpu;

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Tejun Heo
Hello, Michal, Glauber. On Wed, Sep 26, 2012 at 04:03:47PM +0200, Michal Hocko wrote: > Haven't we already discussed that a new memcg should inherit kmem_accounted > from its parent for use_hierarchy? > Say we have > root > | > A (kmem_accounted = 1, use_hierachy = 1) > \ > B (kmem_accounted =

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Michal Hocko
On Wed 26-09-12 18:33:10, Glauber Costa wrote: > On 09/26/2012 06:03 PM, Michal Hocko wrote: > > On Tue 18-09-12 18:04:01, Glauber Costa wrote: [...] > >> @@ -4961,6 +5015,12 @@ mem_cgroup_create(struct cgroup *cont) > >>int cpu; > >>enable_swap_cgroup(); > >>par

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Glauber Costa
On 09/26/2012 06:03 PM, Michal Hocko wrote: > On Tue 18-09-12 18:04:01, Glauber Costa wrote: >> This patch adds the basic infrastructure for the accounting of the slab >> caches. To control that, the following files are created: >> >> * memory.kmem.usage_in_bytes >> * memory.kmem.limit_in_bytes >

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-26 Thread Michal Hocko
On Tue 18-09-12 18:04:01, Glauber Costa wrote: > This patch adds the basic infrastructure for the accounting of the slab > caches. To control that, the following files are created: > > * memory.kmem.usage_in_bytes > * memory.kmem.limit_in_bytes > * memory.kmem.failcnt > * memory.kmem.max_usage

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-24 Thread Glauber Costa
>> + >> +#ifdef CONFIG_MEMCG_KMEM >> +WARN_ON(cgroup_add_cftypes(&mem_cgroup_subsys, >> + kmem_cgroup_files)); >> +#endif >> + > > Why not just make it part of mem_cgroup_files[]? > > Thanks. > Done. __

[Devel] Re: [PATCH v3 04/13] kmem accounting basic infrastructure

2012-09-21 Thread Tejun Heo
On Tue, Sep 18, 2012 at 06:04:01PM +0400, Glauber Costa wrote: > #ifdef CONFIG_MEMCG_KMEM > +static struct cftype kmem_cgroup_files[] = { > + { > + .name = "kmem.limit_in_bytes", > + .private = MEMFILE_PRIVATE(_KMEM, RES_LIMIT), > + .write_string = mem_cgrou