Re: [Devel] Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v3)

2007-04-23 Thread Kirill Korotaev
Andrew Morton wrote: > On Wed, 18 Apr 2007 11:13:01 +0400 Pavel Emelianov <[EMAIL PROTECTED]> wrote: > > >>The out_of_memory() function and SysRq-M handler call >>show_mem() to show the current memory usage state. >> >>This is also helpful to see which slabs are the largest >>in the system. >>

Re: [Devel] Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v3)

2007-04-23 Thread Kirill Korotaev
Andrew Morton wrote: On Wed, 18 Apr 2007 11:13:01 +0400 Pavel Emelianov [EMAIL PROTECTED] wrote: The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. This is also helpful to see which slabs are the largest in the system. Thanks Pekka for

Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v3)

2007-04-19 Thread Andrew Morton
On Wed, 18 Apr 2007 11:13:01 +0400 Pavel Emelianov <[EMAIL PROTECTED]> wrote: > The out_of_memory() function and SysRq-M handler call > show_mem() to show the current memory usage state. > > This is also helpful to see which slabs are the largest > in the system. > > Thanks Pekka for good idea

Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v3)

2007-04-19 Thread Andrew Morton
On Wed, 18 Apr 2007 11:13:01 +0400 Pavel Emelianov [EMAIL PROTECTED] wrote: The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. This is also helpful to see which slabs are the largest in the system. Thanks Pekka for good idea of how to

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-18 Thread Eric Dumazet
On Wed, 18 Apr 2007 09:17:19 +0300 (EEST) Pekka J Enberg <[EMAIL PROTECTED]> wrote: > On Tue, 17 Apr 2007, Eric Dumazet wrote: > > This nr_pages should be in struct kmem_list3, not in struct kmem_cache, > > or else you defeat NUMA optimizations if touching a field in kmem_cache > > at

[PATCH] Show slab memory usage on OOM and SysRq-M (v3)

2007-04-18 Thread Pavel Emelianov
The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. This is also helpful to see which slabs are the largest in the system. Thanks Pekka for good idea of how to make it better. The nr_pages is stored on kmem_list3 because: 1. as Eric pointed

Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v2)

2007-04-18 Thread Pavel Emelianov
Pekka Enberg wrote: > On 4/17/07, Pavel Emelianov <[EMAIL PROTECTED]> wrote: >> The out_of_memory() function and SysRq-M handler call >> show_mem() to show the current memory usage state. > > I am still somewhat unhappy about the spinlock, but I don't really What's wrong with the spinlock? It

Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v2)

2007-04-18 Thread Pavel Emelianov
Dave Hansen wrote: > On Tue, 2007-04-17 at 19:34 +0400, Pavel Emelianov wrote: >> +#define SHOW_TOP_SLABS 10 > > Real minor nit on this one: SHOW_TOP_SLABS sounds like a bool. "Should > I show the top slabs?" > > This might be a bit more clear: > > #define TOP_NR_SLABS_TO_SHOW 10 > > or >

Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v2)

2007-04-18 Thread Pekka Enberg
On 4/17/07, Pavel Emelianov <[EMAIL PROTECTED]> wrote: The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. I am still somewhat unhappy about the spinlock, but I don't really have a better suggestion either. Other than that, looks good to me.

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-18 Thread Pekka J Enberg
On Tue, 17 Apr 2007, Eric Dumazet wrote: > This nr_pages should be in struct kmem_list3, not in struct kmem_cache, > or else you defeat NUMA optimizations if touching a field in kmem_cache > at kmem_getpages()/kmem_freepages() time. We already touch ->flags, ->gfpflags, and ->gfporder in

Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v2)

2007-04-18 Thread Pekka J Enberg
On Tue, 2007-04-17 at 19:34 +0400, Pavel Emelianov wrote: > > +#define SHOW_TOP_SLABS 10 On Tue, 17 Apr 2007, Dave Hansen wrote: > Real minor nit on this one: SHOW_TOP_SLABS sounds like a bool. "Should > I show the top slabs?" > > This might be a bit more clear: > > #define

Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v2)

2007-04-18 Thread Pekka J Enberg
On Tue, 2007-04-17 at 19:34 +0400, Pavel Emelianov wrote: +#define SHOW_TOP_SLABS 10 On Tue, 17 Apr 2007, Dave Hansen wrote: Real minor nit on this one: SHOW_TOP_SLABS sounds like a bool. Should I show the top slabs? This might be a bit more clear: #define TOP_NR_SLABS_TO_SHOW 10

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-18 Thread Pekka J Enberg
On Tue, 17 Apr 2007, Eric Dumazet wrote: This nr_pages should be in struct kmem_list3, not in struct kmem_cache, or else you defeat NUMA optimizations if touching a field in kmem_cache at kmem_getpages()/kmem_freepages() time. We already touch -flags, -gfpflags, and -gfporder in

Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v2)

2007-04-18 Thread Pekka Enberg
On 4/17/07, Pavel Emelianov [EMAIL PROTECTED] wrote: The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. I am still somewhat unhappy about the spinlock, but I don't really have a better suggestion either. Other than that, looks good to me.

Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v2)

2007-04-18 Thread Pavel Emelianov
Dave Hansen wrote: On Tue, 2007-04-17 at 19:34 +0400, Pavel Emelianov wrote: +#define SHOW_TOP_SLABS 10 Real minor nit on this one: SHOW_TOP_SLABS sounds like a bool. Should I show the top slabs? This might be a bit more clear: #define TOP_NR_SLABS_TO_SHOW 10 or #define

Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v2)

2007-04-18 Thread Pavel Emelianov
Pekka Enberg wrote: On 4/17/07, Pavel Emelianov [EMAIL PROTECTED] wrote: The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. I am still somewhat unhappy about the spinlock, but I don't really What's wrong with the spinlock? It exists

[PATCH] Show slab memory usage on OOM and SysRq-M (v3)

2007-04-18 Thread Pavel Emelianov
The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. This is also helpful to see which slabs are the largest in the system. Thanks Pekka for good idea of how to make it better. The nr_pages is stored on kmem_list3 because: 1. as Eric pointed

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-18 Thread Eric Dumazet
On Wed, 18 Apr 2007 09:17:19 +0300 (EEST) Pekka J Enberg [EMAIL PROTECTED] wrote: On Tue, 17 Apr 2007, Eric Dumazet wrote: This nr_pages should be in struct kmem_list3, not in struct kmem_cache, or else you defeat NUMA optimizations if touching a field in kmem_cache at

Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v2)

2007-04-17 Thread Dave Hansen
On Tue, 2007-04-17 at 19:34 +0400, Pavel Emelianov wrote: > +#define SHOW_TOP_SLABS 10 Real minor nit on this one: SHOW_TOP_SLABS sounds like a bool. "Should I show the top slabs?" This might be a bit more clear: #define TOP_NR_SLABS_TO_SHOW 10 or #define NR_SLABS_TO_SHOW 10 -- Dave - To

[PATCH] Show slab memory usage on OOM and SysRq-M (v2)

2007-04-17 Thread Pavel Emelianov
The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. This is also helpful to see which slabs are the largest in the system. Thanks Pekka for good idea of how to make it better. The nr_pages is stored on kmem_list3 because: 1. as Eric pointed

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-17 Thread Eric Dumazet
On Tue, 17 Apr 2007 16:22:48 +0300 "Pekka Enberg" <[EMAIL PROTECTED]> wrote: > Hi, > > On 4/17/07, Pavel Emelianov <[EMAIL PROTECTED]> wrote: > > +static unsigned long get_cache_size(struct kmem_cache *cachep) > > +{ > > + unsigned long slabs; > > + struct kmem_list3 *l3; > > +

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-17 Thread Pekka J Enberg
Hi Pavel, At some point in time, I wrote: > > So, now we have two locks protecting cache_chain? Please explain why > > you can't use the mutex. On Tue, 17 Apr 2007, Pavel Emelianov wrote: > Because OOM can actually happen with this mutex locked. For example > kmem_cache_create() locks it and

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-17 Thread Pavel Emelianov
Pekka J Enberg wrote: > Hi Pavel, > > At some point in time, I wrote: >>> So, now we have two locks protecting cache_chain? Please explain why >>> you can't use the mutex. > > On Tue, 17 Apr 2007, Pavel Emelianov wrote: >> Because OOM can actually happen with this mutex locked. For example >>

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-17 Thread Pavel Emelianov
Pekka Enberg wrote: > Hi, > > On 4/17/07, Pavel Emelianov <[EMAIL PROTECTED]> wrote: >> The out_of_memory() function and SysRq-M handler call >> show_mem() to show the current memory usage state. >> >> This is also helpful to see which slabs are the largest >> in the system. > > Makes sense.

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-17 Thread Pekka Enberg
Hi, On 4/17/07, Pavel Emelianov <[EMAIL PROTECTED]> wrote: The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. This is also helpful to see which slabs are the largest in the system. Makes sense. On 4/17/07, Pavel Emelianov <[EMAIL

[PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-17 Thread Pavel Emelianov
The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. This is also helpful to see which slabs are the largest in the system. Signed-off-by: Pavel Emelianov <[EMAIL PROTECTED]> Signed-off-by: Kirill Korotaev <[EMAIL PROTECTED]> --- diff --git

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-17 Thread Pavel Emelianov
Pekka Enberg wrote: Hi, On 4/17/07, Pavel Emelianov [EMAIL PROTECTED] wrote: The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. This is also helpful to see which slabs are the largest in the system. Makes sense. Thanks! :) On

[PATCH] Show slab memory usage on OOM and SysRq-M (v2)

2007-04-17 Thread Pavel Emelianov
The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. This is also helpful to see which slabs are the largest in the system. Thanks Pekka for good idea of how to make it better. The nr_pages is stored on kmem_list3 because: 1. as Eric pointed

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-17 Thread Pekka Enberg
Hi, On 4/17/07, Pavel Emelianov [EMAIL PROTECTED] wrote: The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. This is also helpful to see which slabs are the largest in the system. Makes sense. On 4/17/07, Pavel Emelianov [EMAIL PROTECTED]

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-17 Thread Eric Dumazet
On Tue, 17 Apr 2007 16:22:48 +0300 Pekka Enberg [EMAIL PROTECTED] wrote: Hi, On 4/17/07, Pavel Emelianov [EMAIL PROTECTED] wrote: +static unsigned long get_cache_size(struct kmem_cache *cachep) +{ + unsigned long slabs; + struct kmem_list3 *l3; + struct list_head

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-17 Thread Pavel Emelianov
Pekka J Enberg wrote: Hi Pavel, At some point in time, I wrote: So, now we have two locks protecting cache_chain? Please explain why you can't use the mutex. On Tue, 17 Apr 2007, Pavel Emelianov wrote: Because OOM can actually happen with this mutex locked. For example

[PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-17 Thread Pavel Emelianov
The out_of_memory() function and SysRq-M handler call show_mem() to show the current memory usage state. This is also helpful to see which slabs are the largest in the system. Signed-off-by: Pavel Emelianov [EMAIL PROTECTED] Signed-off-by: Kirill Korotaev [EMAIL PROTECTED] --- diff --git

Re: [PATCH] Show slab memory usage on OOM and SysRq-M

2007-04-17 Thread Pekka J Enberg
Hi Pavel, At some point in time, I wrote: So, now we have two locks protecting cache_chain? Please explain why you can't use the mutex. On Tue, 17 Apr 2007, Pavel Emelianov wrote: Because OOM can actually happen with this mutex locked. For example kmem_cache_create() locks it and calls

Re: [PATCH] Show slab memory usage on OOM and SysRq-M (v2)

2007-04-17 Thread Dave Hansen
On Tue, 2007-04-17 at 19:34 +0400, Pavel Emelianov wrote: +#define SHOW_TOP_SLABS 10 Real minor nit on this one: SHOW_TOP_SLABS sounds like a bool. Should I show the top slabs? This might be a bit more clear: #define TOP_NR_SLABS_TO_SHOW 10 or #define NR_SLABS_TO_SHOW 10 -- Dave - To