Home » Mailing lists » Devel » [PATCH] BC: resource beancounters (v2)  
	
		
		
			| Re: [PATCH 5/6] BC: kernel memory accounting (core) [message #5589 is a reply to message #5547] | 
			Thu, 24 August 2006 00:36    | 
		 
		
			
				
				
				
					
						  
						Chandra Seetharaman
						 Messages: 88 Registered: August 2006 
						
					 | 
					Member  | 
					 | 
		 
		 
	 | 
 
	
		On Wed, 2006-08-23 at 15:06 +0400, Kirill Korotaev wrote: 
 
<snip> 
 
> --- ./include/bc/beancounter.h.bckmem	2006-07-28 18:43:52.000000000 +0400 
> +++ ./include/bc/beancounter.h	2006-08-03 16:03:01.000000000 +0400 
> @@ -14,7 +14,9 @@ 
>   *	Resource list. 
>   */ 
>   
> -#define BC_RESOURCES	0 
> +#define BC_KMEMSIZE	0 
> + 
> +#define BC_RESOURCES	1 
 
As suggested before, a clean interface to define these would be better 
>   
>  struct resource_parm { 
>  	/* 
> --- ./include/bc/kmem.h.bckmem	2006-07-28 18:43:52.000000000 +0400 
> +++ ./include/bc/kmem.h	2006-07-31 17:37:05.000000000 +0400 
> @@ -0,0 +1,33 @@ 
> +/* 
> + *  include/bc/kmem.h 
> + * 
> + *  Copyright (C) 2006 OpenVZ. SWsoft Inc 
> + * 
> + */ 
> + 
> +#ifndef __BC_KMEM_H_ 
> +#define __BC_KMEM_H_ 
> + 
> +#include <linux/config.h> 
> + 
> +/* 
> + * BC_KMEMSIZE accounting 
> + */ 
> + 
> +struct mm_struct; 
> +struct page; 
> +struct beancounter; 
> + 
> +#ifdef CONFIG_BEANCOUNTERS 
> +int  bc_page_charge(struct page *page, int order, gfp_t flags); 
> +void bc_page_uncharge(struct page *page, int order); 
> + 
> +int bc_slab_charge(kmem_cache_t *cachep, void *obj, gfp_t flags); 
> +void bc_slab_uncharge(kmem_cache_t *cachep, void *obj); 
> +#else 
> +#define bc_page_charge(pg, o, mask)	(0) 
> +#define bc_page_uncharge(pg, o)		do { } while (0) 
> +#define bc_slab_charge(cachep, o, f)	(0) 
> +#define bc_slab_uncharge(cachep, o)	do { } while (0) 
> +#endif 
> +#endif /* __BC_SLAB_H_ */ 
> --- ./kernel/bc/Makefile.bcsys	2006-07-28 14:08:37.000000000 +0400 
> +++ ./kernel/bc/Makefile	2006-08-01 11:08:39.000000000 +0400 
> @@ -7,3 +7,4 @@ 
>  obj-$(CONFIG_BEANCOUNTERS) += beancounter.o 
>  obj-$(CONFIG_BEANCOUNTERS) += misc.o 
>  obj-$(CONFIG_BEANCOUNTERS) += sys.o 
> +obj-$(CONFIG_BEANCOUNTERS) += kmem.o 
> --- ./kernel/bc/beancounter.c.bckmem	2006-07-28 18:43:52.000000000 +0400 
> +++ ./kernel/bc/beancounter.c	2006-08-03 16:14:17.000000000 +0400 
> @@ -19,6 +19,7 @@ static void init_beancounter_struct(stru 
>  struct beancounter init_bc; 
>   
>  const char *bc_rnames[] = { 
> +	"kmemsize",	/* 0 */ 
>  }; 
 
As suggested before, a clean interface would be a better idea. 
>   
>  #define bc_hash_fun(x) ((((x) >> 8) ^ (x)) & (BC_HASH_SIZE - 1)) 
> @@ -348,6 +378,8 @@ static void init_beancounter_syslimits(s 
>  { 
>  	int k; 
>   
> +	bc->bc_parms[BC_KMEMSIZE].limit = 32 * 1024 * 1024; 
> + 
 
This could be either be a configurable value by/for the controller or 
can be set by the controller through a callout. 
 
>  	for (k = 0; k < BC_RESOURCES; k++) 
>  		bc->bc_parms[k].barrier = bc->bc_parms[k].limit; 
>  } 
 
<snip> 
 
--  
 
 ------------------------------------------------------------ ---------- 
    Chandra Seetharaman               | Be careful what you choose.... 
              - sekharan@us.ibm.com   |      .......you may get it. 
 ------------------------------------------------------------ ----------
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
  
 
	
	  | 
	 | 
	
		[PATCH] BC: resource beancounters (v2)
		By:  dev on Wed, 23 August 2006 10:44  
	 | 
 
	  | 
	 | 
	
		[PATCH 1/6] BC: kconfig
		By:  dev on Wed, 23 August 2006 10:59  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 1/6] BC: kconfig
		
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 1/6] BC: kconfig
		
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 1/6] BC: kconfig
		
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 1/6] BC: kconfig
		By:  dev on Fri, 25 August 2006 11:27  
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 1/6] BC: kconfig
		By:  dev on Fri, 25 August 2006 11:31  
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 1/6] BC: kconfig
		By:  rdunlap on Wed, 23 August 2006 22:29  
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 1/6] BC: kconfig
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 1/6] BC: kconfig
		
	 | 
 
	  | 
	 | 
	
		Re: [ckrm-tech] [PATCH 1/6] BC: kconfig
		By:  dev on Thu, 24 August 2006 11:47  
	 | 
 
	  | 
	 | 
	
		Re: [ckrm-tech] [PATCH 1/6] BC: kconfig
		
	 | 
 
	  | 
	 | 
	
		[PATCH 2/6] BC: beancounters core (API)
		By:  dev on Wed, 23 August 2006 11:00  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		By:  dev on Wed, 23 August 2006 13:25  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		By:  dev on Wed, 23 August 2006 13:46  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		By:  dev on Thu, 24 August 2006 12:03  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		By:  dev on Fri, 25 August 2006 10:51  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 2/6] BC: beancounters core (API)
		
	 | 
 
	  | 
	 | 
	
		[PATCH 3/6] BC: context inheriting and changing
		By:  dev on Wed, 23 August 2006 11:02  
	 | 
 
	  | 
	 | 
	
		[PATCH 4/6] BC: user interface (syscalls)
		By:  dev on Wed, 23 August 2006 11:03  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 4/6] BC: user interface (syscalls)
		By:  dev on Wed, 23 August 2006 13:40  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 4/6] BC: user interface (syscalls)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 4/6] BC: user interface (syscalls)
		By:  Alan Cox on Wed, 23 August 2006 17:08  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 4/6] BC: user interface (syscalls)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 4/6] BC: user interface (syscalls)
		By:  Alan Cox on Thu, 24 August 2006 10:42  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 4/6] BC: user interface (syscalls)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 4/6] BC: user interface (syscalls)
		By:  dev on Fri, 25 August 2006 10:54  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 4/6] BC: user interface (syscalls)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 4/6] BC: user interface (syscalls)
		
	 | 
 
	  | 
	 | 
	
		[PATCH 5/6] BC: kernel memory accounting (core)
		By:  dev on Wed, 23 August 2006 11:04  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 5/6] BC: kernel memory accounting (core)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 5/6] BC: kernel memory accounting (core)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH 5/6] BC: kernel memory accounting (core)
		By:  dev on Fri, 25 August 2006 10:06  
	 | 
 
	  | 
	 | 
	
		[PATCH 6/6] BC: kernel memory accounting (marks)
		By:  dev on Wed, 23 August 2006 11:05  
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 6/6] BC: kernel memory accounting (marks)
		
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 6/6] BC: kernel memory accounting (marks)
		By:  dev on Tue, 29 August 2006 09:52  
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 6/6] BC: kernel memory accounting (marks)
		
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 6/6] BC: kernel memory accounting (marks)
		
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 6/6] BC: kernel memory accounting (marks)
		
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 6/6] BC: kernel memory accounting (marks)
		
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 6/6] BC: kernel memory accounting (marks)
		By:  dev on Tue, 29 August 2006 14:34  
	 | 
 
	  | 
	 | 
	
		Re:  [PATCH 6/6] BC: kernel memory accounting (marks)
		By:  dev on Tue, 29 August 2006 15:53  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		By:  dev on Fri, 25 August 2006 11:47  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		By:  dev on Mon, 28 August 2006 08:27  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: BC: resource beancounters (v2)
		By:  Alan Cox on Sat, 26 August 2006 16:16  
	 | 
 
	  | 
	 | 
	
		Re: BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re:  Re: BC: resource beancounters (v2)
		By:  kir on Mon, 28 August 2006 17:40  
	 | 
 
	  | 
	 | 
	
		Re:  Re: BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re:  Re: BC: resource beancounters (v2)
		By:  Alan Cox on Tue, 29 August 2006 10:15  
	 | 
 
	  | 
	 | 
	
		Re:  Re: BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re:  Re: BC: resource beancounters (v2)
		By:  Alan Cox on Tue, 29 August 2006 18:46  
	 | 
 
	  | 
	 | 
	
		Re:  Re: BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		By:  dev on Tue, 29 August 2006 15:33  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		By:  Alan Cox on Thu, 24 August 2006 10:38  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		By:  Alan Cox on Fri, 25 August 2006 15:36  
	 | 
 
	  | 
	 | 
	
		Re: [PATCH] BC: resource beancounters (v2)
		
	 | 
  
Goto Forum:
 
 Current Time: Tue Nov 04 01:50:44 GMT 2025 
 Total time taken to generate the page: 0.19436 seconds 
 |