[Devel] Re: [PATCH] cgroup: prefer [kv]zalloc over [kv]malloc+memset in memory controller code.

2010-11-01 Thread Minchan Kim
like this. if (some size > limit) ptr = kzalloc_node(...); else { prt = vmalloc_node(...) vmalloced = 1; } if (ptr && vmalloced) memset(prt, ); So if we will add kzalloc_node, we have to add vzalloc_node, too. > >> Can you switch that over as w

[Devel] Re: [PATCH] cgroup: prefer [kv]zalloc over [kv]malloc+memset in memory controller code.

2010-11-01 Thread Minchan Kim
> > Signed-off-by: Jesper Juhl Reviewed-by: Minchan Kim -- Kind regards, Minchan Kim ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers _

[Devel] Re: [PATCH] cgroup: Avoid a memset by using vzalloc

2010-10-30 Thread Minchan Kim
On Sun, Oct 31, 2010 at 6:35 AM, Jesper Juhl wrote: > Hi, > > We can avoid doing a memset in swap_cgroup_swapon() by using vzalloc(). > > > Signed-off-by: Jesper Juhl Reviewed-by: Minchan Kim There are so many placed need vzalloc. Thanks, Jesper. -- Kind re

[Devel] Re: [PATCH v2][memcg+dirtylimit] Fix overwriting global vm dirty limit setting by memcg (Re: [PATCH v3 00/11] memcg: per cgroup dirty page accounting

2010-10-20 Thread Minchan Kim
r. > > This patch limits the return value of vm_dirty_param() considring > global settings. > > Changelog: > - fixed an argument "mem" int to u64 > - fixed to use global available memory to cap memcg's value. > > Signed-off-by: KAMEZAWA Hiroyuki Reviewe

[Devel] Re: [PATCH v3 04/11] memcg: add lock to synchronize page accounting and migration

2010-10-18 Thread Minchan Kim
a 8G anon process. > > Before: >        real    0m0.792s >        user    0m0.000s >        sys     0m0.780s > > After: >        real    0m0.854s >        user    0m0.000s >        sys     0m0.842s > > This score is bad but planned patches for optimization can re

[Devel] Re: [PATCH v2 04/11] memcg: disable softirq in lock_page_cgroup()

2010-10-16 Thread Minchan Kim
p *pc) >  { >        bit_spin_unlock(PCG_LOCK, &pc->flags); > +       local_bh_enable(); >  } > >  #else /* CONFIG_CGROUP_MEM_RES_CTLR */ > -- > 1.7.1 > > Please, see recent Kame's patch. http://lkml.org/lkml/2010/10/15/54 -- Kind regards, Minchan Kim

[Devel] Re: [PATCH] memcg: lock-free clear page writeback (Was Re: [PATCH 04/10] memcg: disable local interrupts in lock_page_cgroup()

2010-10-07 Thread Minchan Kim
t;page); >        /* >         * check events >         */ > > Looks good to me. But let me ask a question. Why do only move_account need this logic? Is deadlock candidate is only this place? How about mem_cgroup_prepare_migration? unmap_and_move lock_page mem_cgroup_prepare_migration lock_page_cgroup ... s

[Devel] Re: [PATCH 10/10] memcg: check memcg dirty limits in page writeback

2010-10-05 Thread Minchan Kim
  /* Ensure that we never return 0 */ >  } > Just a nitpick. You seem to like get_ name. But I think it's a redundant and just makes function name longer without any benefit. In kernel, many place doesn't use get_xxx naming. -- Kind regards, Minchan Kim

[Devel] Re: [PATCH 04/10] memcg: disable local interrupts in lock_page_cgroup()

2010-10-05 Thread Minchan Kim
On Wed, Oct 6, 2010 at 8:26 AM, Greg Thelen wrote: > Minchan Kim writes: > >> On Sun, Oct 03, 2010 at 11:57:59PM -0700, Greg Thelen wrote: >>> If pages are being migrated from a memcg, then updates to that >>> memcg's page statistics are protected by

[Devel] Re: [PATCH 03/10] memcg: create extensible page stat update routines

2010-10-05 Thread Minchan Kim
On Wed, Oct 6, 2010 at 4:59 AM, Greg Thelen wrote: > Minchan Kim writes: > >> On Sun, Oct 03, 2010 at 11:57:58PM -0700, Greg Thelen wrote: >>> Replace usage of the mem_cgroup_update_file_mapped() memcg >>> statistic update routine with two new routines:

[Devel] Re: [PATCH 05/10] memcg: add dirty page accounting infrastructure

2010-10-05 Thread Minchan Kim
P] += val * PAGE_SIZE; > } > > + val = mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_FILE_DIRTY); > + s->stat[MCS_FILE_DIRTY] += val * PAGE_SIZE; > + val = mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_FILE_WRITEBACK); > + s->stat[MCS_WRITEBACK] +

[Devel] Re: [PATCH 04/10] memcg: disable local interrupts in lock_page_cgroup()

2010-10-05 Thread Minchan Kim
t seems to make code very ugly. 2. So could you solve the problem in your design? I mean you could update page state out of softirq? (I didn't look at the your patches all. Sorry if I am missing something) 3. Normally, we have updated page state without disable irq. Why does memcg ne

[Devel] Re: [PATCH 03/10] memcg: create extensible page stat update routines

2010-10-05 Thread Minchan Kim
APPED, /* # of pages charged as file rss */ > +}; > + mem_cgrou_"write"_page_stat_item? Does "write" make sense to abstract page_state generally? -- Kind regards, Minchan Kim ___ Containers

[Devel] Re: [PATCH 1/2] memcg: dirty pages accounting and limiting infrastructure

2010-02-25 Thread Minchan Kim
On Fri, Feb 26, 2010 at 3:15 PM, KAMEZAWA Hiroyuki wrote: > On Fri, 26 Feb 2010 14:53:39 +0900 > Minchan Kim wrote: > >> On Fri, Feb 26, 2010 at 2:01 PM, KAMEZAWA Hiroyuki >> wrote: >> > Hi, >> > >> > On Fri, 26 Feb 2010 13:50:04 +0900 >> &g

[Devel] Re: [PATCH 1/2] memcg: dirty pages accounting and limiting infrastructure

2010-02-25 Thread Minchan Kim
On Fri, Feb 26, 2010 at 2:01 PM, KAMEZAWA Hiroyuki wrote: > Hi, > > On Fri, 26 Feb 2010 13:50:04 +0900 > Minchan Kim wrote: > >> > Hm ? I don't read the whole thread but can_attach() is called under >> > cgroup_mutex(). So, it doesn't need to use RCU.

[Devel] Re: [PATCH 1/2] memcg: dirty pages accounting and limiting infrastructure

2010-02-25 Thread Minchan Kim
Hi, Kame. On Fri, Feb 26, 2010 at 9:23 AM, KAMEZAWA Hiroyuki wrote: > On Fri, 26 Feb 2010 00:36:15 +0900 > Minchan Kim wrote: > >> Hi >> >> On Tue, Feb 23, 2010 at 8:58 PM, Andrea Righi wrote: >> > On Mon, Feb 22, 2010 at 01:07:32PM -0500, Vivek Goy

[Devel] Re: [PATCH 1/2] memcg: dirty pages accounting and limiting infrastructure

2010-02-25 Thread Minchan Kim
; > +       rcu_read_unlock(); >> > > >> > > The rcu_read_lock() isn't protecting anything here. >> > >> > Right! >> >> Are we not protecting "memcg" pointer using rcu here? > > Vivek, you are right: > >  mem_cgroup_from_t

[Devel] Re: [Question] power management related with cgroup based resource management

2008-10-26 Thread MinChan Kim
essage to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > -- Kinds regards, MinChan Kim ___ Containers mailing list [EMAIL PROTECTED] https://lists.lin

[Devel] Re: [RFC v5][PATCH 7/8] Infrastructure for shared objects

2008-09-17 Thread MinChan Kim
tx: checkpoint context >> + * @ptr: pointer to object >> + * @objref: unique identifier - object reference >> + * @type: object type >> + * @flags: object flags >> + */ >> +int cr_obj_add_ref(struct cr_ctx *ctx, void *pt

[Devel] Re: [RFC v5][PATCH 4/8] Dump memory address space

2008-09-16 Thread MinChan Kim
+ __s16 ldt_entry_size; > + __s16 nldt; > +} __attribute__((aligned(8))); > + > #endif /* __ASM_X86_CKPT_HDR__H */ > diff --git a/include/linux/checkpoint.h b/include/linux/checkpoint.h > index 5e53ae6..d74e64d 100644 > --- a/include/linux/checkpoint.h

[Devel] Re: [RFC v5][PATCH 6/8] Checkpoint/restart: initial documentation

2008-09-16 Thread MinChan Kim
ash table > + - Better use of standard kmalloc/kfree > + > +[2008-Aug-09] v2: > + - Added utsname->{release,version,machine} to checkpoint header > + - Pad header structures to 64 bits to ensure compatibility > + - Address comments from LKML and linux-containers mailing list > + > +[2008-Jul-29] v1: > +In this incarnation, CR only works on single task. The address space > +may consist of only private, simple VMAs - anonymous or file-mapped. > +Both checkpoint and restart will ignore the first argument (pid/crid) > +and instead act on themselves. > -- > 1.5.4.3 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > -- Kinds regards, MinChan Kim ___ Containers mailing list [EMAIL PROTECTED] https://lists.linux-foundation.org/mailman/listinfo/containers ___ Devel mailing list Devel@openvz.org https://openvz.org/mailman/listinfo/devel

[Devel] Re: [RFC v4][PATCH 6/9] Checkpoint/restart: initial documentation

2008-09-11 Thread MinChan Kim
nd clean-ups > +* Use standard hlist_... for hash table > +* Better use of standard kmalloc/kfree > + > +[2008-Aug-09] v2: > +* Added utsname->{release,version,machine} to checkpoint header > +* Pad header structures to 64 bits to ensure compatibility > +* Add

[Devel] Re: [RFC v4][PATCH 8/9] File descriprtors (dump)

2008-09-11 Thread MinChan Kim
64-bit aligned: use padding for structure members, and use > - * __attribute__ ((aligned (8))) for the entire structure. > + * __attribute__((aligned(8))) for the entire structure. > */ > > /* records: generic header */ > @@ -42,6 +42,10 @@ enum { >CR_HDR_VMA

[Devel] Re: [RFC v4][PATCH 2/9] General infrastructure for checkpoint restart

2008-09-11 Thread MinChan Kim
Hi, Oren. On Thu, Sep 11, 2008 at 3:36 AM, Oren Laadan <[EMAIL PROTECTED]> wrote: > > > MinChan Kim wrote: >> On Tue, Sep 9, 2008 at 4:42 PM, Oren Laadan <[EMAIL PROTECTED]> wrote: > > [...] > >>> +struct cr_ctx *cr_ctx_alloc(pid_t pid, int fd, u

[Devel] Re: [RFC v4][PATCH 4/9] Memory management (dump)

2008-09-11 Thread MinChan Kim
one more thing. On Wed, Sep 10, 2008 at 4:51 PM, MinChan Kim <[EMAIL PROTECTED]> wrote: > On Tue, Sep 9, 2008 at 4:42 PM, Oren Laadan <[EMAIL PROTECTED]> wrote: >> For each VMA, there is a 'struct cr_vma'; if the VMA is file-mapped, >> it will be followed

[Devel] Re: [RFC v4][PATCH 2/9] General infrastructure for checkpoint restart

2008-09-11 Thread MinChan Kim
if /* _CHECKPOINT_CKPT_H_ */ > diff --git a/include/linux/ckpt_hdr.h b/include/linux/ckpt_hdr.h > new file mode 100644 > index 000..dd05ecc > --- /dev/null > +++ b/include/linux/ckpt_hdr.h > @@ -0,0 +1,84 @@ > +#ifndef _CHECKPOINT_CKPT_HDR_H_ > +#define _CHECKPOINT_CKPT_HDR_

[Devel] Re: [RFC v4][PATCH 4/9] Memory management (dump)

2008-09-11 Thread MinChan Kim
8))); > > +struct cr_hdr_mm_context { > + __s16 ldt_entry_size; > + __s16 nldt; > +} __attribute__((aligned(8))); > + > #endif /* __ASM_X86_CKPT_HDR__H */ > diff --git a/include/linux/ckpt.h b/include/linux/ckpt.h > index 91f4998..5c62a90 100644 > --- a/inc