linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFC][PATCH 5/8] RSS controller task migration support
@ 2006-11-21 10:01 Patrick.Le-Dot
  2006-11-21 11:06 ` Balbir Singh
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick.Le-Dot @ 2006-11-21 10:01 UTC (permalink / raw)
  To: balbir; +Cc: ckrm-tech, dev, haveblue, linux-kernel, linux-mm, rohitseth

On Fri, 17 Nov 2006 22:04:08 +0530
> ...
> I am not against guarantees, but
> 
> Consider the following scenario, let's say we implement guarantees
> 
> 1. If we account for kernel resources, how do you provide guarantees
>    when you have non-reclaimable resources?

First, the current patch is based only on pages available in the
struct mm.
I doubt that these pages are "non-reclaimable"...

And guarantee should be ignored just because some kernel resources
are marked "non-reclaimable" ?


> 2. If a customer runs a system with swap turned off (which is quite
>    common),

quite common, really ?

>             then anonymous memory becomes irreclaimable. If a group
>    takes more than it's fair share (exceeds its guarantee), you
>    have scenario similar to 1 above.

That seems to be just a subset of the "guarantee+limit" model : if
guarantee is not useful for you, don't use it.

I'm not saying that guarantee should be a magic piece of code working
for everybody.

But we have to propose something for the customers who ask for a
guarantee (ie using a system with swap turned on like me and this is
quite common:-)

Patrick

+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+    Patrick Le Dot
 mailto: P@trick.Le-Dot@bull.net         Centre UNIX de BULL SAS
 Phone : +33 4 76 29 73 20               1, Rue de Provence     BP 208
 Fax   : +33 4 76 29 76 00               38130 ECHIROLLES Cedex FRANCE
 Bull, Architect of an Open World TM
 www.bull.com

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: [RFC][PATCH 5/8] RSS controller task migration support
@ 2006-11-15 11:59 Patrick.Le-Dot
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick.Le-Dot @ 2006-11-15 11:59 UTC (permalink / raw)
  To: balbir; +Cc: ckrm-tech, dev, haveblue, linux-kernel, linux-mm, rohitseth

Hi Balbir,

The get_task_mm()/mmput(mm) usage is not correct.
With CONFIG_DEBUG_SPINLOCK_SLEEP=y :

BUG: sleeping function called from invalid context at kernel/fork.c:390
in_atomic():1, irqs_disabled():0
 [<c0116620>] __might_sleep+0x97/0x9c
 [<c0116a2e>] mmput+0x15/0x8b
 [<c01582f6>] install_arg_page+0x72/0xa9
 [<c01584b1>] setup_arg_pages+0x184/0x1a5
 ...

BUG: sleeping function called from invalid context at kernel/fork.c:390
in_atomic():1, irqs_disabled():0
 [<c0116620>] __might_sleep+0x97/0x9c
 [<c0116a2e>] mmput+0x15/0x8b
 [<c01468ee>] do_no_page+0x255/0x2bd
 [<c0146b8d>] __handle_mm_fault+0xed/0x1ef
 [<c0111884>] do_page_fault+0x247/0x506
 [<c011163d>] do_page_fault+0x0/0x506
 [<c0348f99>] error_code+0x39/0x40


current->mm seems to be enough here.



In patch4, memctlr_dec_rss(page, mm) should be memctlr_dec_rss(page)
to compile correctly.

and in patch0 :
> 4. Disable cpuset's (to simply assignment of tasks to resource groups)
>         cd /container
>         echo 0 > cpuset_enabled

should be :
        echo 0 > cpuacct_enabled

Note : cpuacct_enabled is 0 by default.


Now the big question : to implement guarantee, the LRU needs to know
if a page can be removed from memory or not.
Any ideas to do that without any change in the struct page ?

Patrick

+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+    Patrick Le Dot
 mailto: P@trick.Le-Dot@bull.net         Centre UNIX de BULL SAS
 Phone : +33 4 76 29 73 20               1, Rue de Provence     BP 208
 Fax   : +33 4 76 29 76 00               38130 ECHIROLLES Cedex FRANCE
 Bull, Architect of an Open World TM
 www.bull.com

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [RFC][PATCH 0/8] RSS controller for containers
@ 2006-11-09 19:35 Balbir Singh
  2006-11-09 19:36 ` [RFC][PATCH 5/8] RSS controller task migration support Balbir Singh
  0 siblings, 1 reply; 4+ messages in thread
From: Balbir Singh @ 2006-11-09 19:35 UTC (permalink / raw)
  To: Linux MM
  Cc: dev, ckrm-tech, Linux Kernel Mailing List, haveblue, rohitseth,
	Balbir Singh

Here is set of patches that implements a *simple minded* RSS controller
for containers.  It would be nice to split up the memory controller design
and implementation in phases

1. RSS control
2. Page Cache control (with split clean and dirty accounting/control)
3. mlock() control
4. Kernel accounting and control

The beancounter implementation follows a very similar approach. The split
up makes the design of the controller easier. RSS for example, can be tracked
per mm_struct. Page Cache could be tracked per inode, per thread
or per mm_struct (depending on what form is most suitable).

The definition of RSS was debated on lkml, please see

	http://lkml.org/lkml/2006/10/10/130

This patchset is a proof of concept implementation and the accounting can
be easily adapted to meet the definition of RSS as and when it is re-defined
or revisited. The changes required should be small.

The reclamation logic has been borrowed from Dave Hansen's challenged
memory controller and from shrink_all_memory(). The accounting was inspired
from Rohit Seth's container patches.

The good
--------

No additional pointers required in struct page.
There is also a lot of scope for code reuse in tracking the rss of a process
(this reuse is yet to be exploited).

The not so good
---------------
The patches contain a lot of debugging code.

Applying the patches
--------------------
This patchset has been developed on top of 2.6.19-rc2 with the latest
containers patch applied.

To run and test this patch, additional fixes are required.

Please see
	
	http://lkml.org/lkml/2006/11/6/10
	http://lkml.org/lkml/2006/11/6/245


Series
------
container-res-groups-fix-parsing.patch
container-memctlr-setup.patch
container-memctlr-callbacks.patch
container-memctlr-acct.patch
container-memctlr-task-migration.patch
container-memctlr-shares.patch
container-memctlr-reclaim.patch

Setup
-----
To test the series, here's what you need to do

0. Get the latest containers patches against 2.6.19-rc2
1. Apply all the fixes
2. Apply these patches
3. Build the kernel and mount the container filesystem
	mount -t container container /container

4. Disable cpuset's (to simply assignment of tasks to resource groups)

	cd /container
	echo 0 > cpuset_enabled

5. Add the current task to a new group

	mkdir /container/a
	echo $$ > tasks
	cat memctlr_stats

6. Set limits

	echo "res=memctlr,max_shares=10" > memctlr_shares

7. Spin the system, hang it, revolve it, crash it!!
8. Please provide feedback, both code review and any thing else that
   can be useful for further development

Testing
-------
Kernbench was run on these patches and it did not show any significant
overhead in the tests.


-- 

	Balbir Singh,
	Linux Technology Center,
	IBM Software Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-11-21 23:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-21 10:01 [RFC][PATCH 5/8] RSS controller task migration support Patrick.Le-Dot
2006-11-21 11:06 ` Balbir Singh
  -- strict thread matches above, loose matches on Subject: below --
2006-11-15 11:59 Patrick.Le-Dot
2006-11-09 19:35 [RFC][PATCH 0/8] RSS controller for containers Balbir Singh
2006-11-09 19:36 ` [RFC][PATCH 5/8] RSS controller task migration support Balbir Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox