Ctobay Services | 1 Jan 01:36 2012

Happy Holidays! Year end Specials!Save 40% or more !

To view the message, please use an HTML compatible email viewer!
Greg KH | 3 Jan 21:54 2012

Re: [PATCH 5/6] memcg: fix broken boolen expression

On Mon, Dec 26, 2011 at 08:57:24AM +0200, Kirill A. Shutemov wrote:
> On Mon, Dec 26, 2011 at 03:31:38PM +0900, KAMEZAWA Hiroyuki wrote:
> > On Sat, 24 Dec 2011 05:00:18 +0200
> > "Kirill A. Shutemov" <kirill@...> wrote:
> > 
> > > From: "Kirill A. Shutemov" <kirill@...>
> > > 
> > > action != CPU_DEAD || action != CPU_DEAD_FROZEN is always true.
> > > 
> > > Signed-off-by: Kirill A. Shutemov <kirill@...>
> > 
> > maybe this should go stable..
> 
> CC stable <at> 

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>
Greg KH | 3 Jan 23:29 2012
Picon

[24/67] cgroups: fix a css_set not found bug in cgroup_attach_proc

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mandeep Singh Baines <msb@...>

commit e0197aae59e55c06db172bfbe1a1cdb8c0e1cab3 upstream.

There is a BUG when migrating a PF_EXITING proc. Since css_set_prefetch()
is not called for the PF_EXITING case, find_existing_css_set() will return
NULL inside cgroup_task_migrate() causing a BUG.

This bug is easy to reproduce. Create a zombie and echo its pid to
cgroup.procs.

$ cat zombie.c
\#include <unistd.h>

int main()
{
  if (fork())
      pause();
  return 0;
}
$

We are hitting this bug pretty regularly on ChromeOS.

This bug is already fixed by Tejun Heo's cgroup patchset which is
targetted for the next merge window:
(Continue reading)

Greg KH | 3 Jan 23:33 2012
Picon

[32/75] cgroups: fix a css_set not found bug in cgroup_attach_proc

3.1-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mandeep Singh Baines <msb@...>

commit e0197aae59e55c06db172bfbe1a1cdb8c0e1cab3 upstream.

There is a BUG when migrating a PF_EXITING proc. Since css_set_prefetch()
is not called for the PF_EXITING case, find_existing_css_set() will return
NULL inside cgroup_task_migrate() causing a BUG.

This bug is easy to reproduce. Create a zombie and echo its pid to
cgroup.procs.

$ cat zombie.c
\#include <unistd.h>

int main()
{
  if (fork())
      pause();
  return 0;
}
$

We are hitting this bug pretty regularly on ChromeOS.

This bug is already fixed by Tejun Heo's cgroup patchset which is
targetted for the next merge window:
(Continue reading)

Mandeep Singh Baines | 4 Jan 06:18 2012

[PATCH 3/3] cgroup: remove extra calls to find_existing_css_set

In cgroup_attach_proc, we indirectly call find_existing_css_set 3
times. It is an expensive call so we want to call it a minimum
of times. This patch only calls it once and stores the result so
that it can be used later on when we call cgroup_task_migrate.

This required modifying cgroup_task_migrate to take the new css_set
(which we obtained from find_css_set) as a parameter. The nice side
effect of this is that cgroup_task_migrate is now identical for
cgroup_attach_task and cgroup_attach_proc. It also now returns a
void since it can never fail.

Changes in V4:
* https://lkml.org/lkml/2011/12/22/421 (Li Zefan)
  * Avoid GFP_KERNEL (sleep) in rcu_read_lock by getting css_set in
    a separate loop not under an rcu_read_lock
Changes in V3:
* https://lkml.org/lkml/2011/12/22/13 (Li Zefan)
  * Fixed earlier bug by creating a seperate patch to remove tasklist_lock
Changes in V2:
* https://lkml.org/lkml/2011/12/20/372 (Tejun Heo)
  * Move find_css_set call into loop which creates the flex array
* Author
  * Kill css_set_refs and use group_size instead
  * Fix an off-by-one error in counting css_set refs
  * Add a retval check in out_list_teardown

Signed-off-by: Mandeep Singh Baines <msb@...>
Cc: Tejun Heo <tj@...>
Cc: Li Zefan <lizf@...>
Cc: containers@...
(Continue reading)

Mandeep Singh Baines | 4 Jan 06:18 2012

[PATCH 2/3] cgroup: replace tasklist_lock with rcu_read_lock

We can replace the tasklist_lock in cgroup_attach_proc with an
rcu_read_lock.

Changes in V4:
* https://lkml.org/lkml/2011/12/23/284 (Frederic Weisbecker)
  * Minimize size of rcu_read_lock critical section
  * Add comment
* https://lkml.org/lkml/2011/12/26/136 (Li Zefan)
  * Split into two patches
Changes in V3:
* https://lkml.org/lkml/2011/12/22/419 (Frederic Weisbecker)
  * Add an rcu_read_lock to protect against exit
Changes in V2:
* https://lkml.org/lkml/2011/12/22/86 (Tejun Heo)
  * Use a goto instead of returning -EAGAIN

Suggested-by: Frederic Weisbecker <fweisbec@...>
Signed-off-by: Mandeep Singh Baines <msb@...>
Cc: Tejun Heo <tj@...>
Cc: Li Zefan <lizf@...>
Cc: containers@...
Cc: cgroups@...
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>
Cc: Oleg Nesterov <oleg@...>
Cc: Andrew Morton <akpm@...>
Cc: Paul Menage <paul@...>
---
 kernel/cgroup.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

(Continue reading)

Mandeep Singh Baines | 4 Jan 06:18 2012

[PATCH 1/3] cgroup: simplify double-check locking in cgroup_attach_proc

To keep the complexity of the double-check locking in one place,
I moved the thread_group_leader check up into attach_task_by_pid.
This allows us to use a goto instead of returning -EAGAIN.

While at it, converted a couple of returns to gotos and used
rcu for the !pid case also in order to simplify the logic.

Changes in V2:
* https://lkml.org/lkml/2011/12/22/86 (Tejun Heo)
  * Use a goto instead of returning -EAGAIN

Signed-off-by: Mandeep Singh Baines <msb@...>
Cc: Tejun Heo <tj@...>
Cc: Li Zefan <lizf@...>
Cc: Frederic Weisbecker <fweisbec@...>
Cc: containers@...
Cc: cgroups@...
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>
Cc: Oleg Nesterov <oleg@...>
Cc: Andrew Morton <akpm@...>
Cc: Paul Menage <paul@...>
---
 kernel/cgroup.c |   79 ++++++++++++++++++++----------------------------------
 1 files changed, 29 insertions(+), 50 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 1042b3c..09867eb 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
 <at>  <at>  -2104,19 +2104,6  <at>  <at>  int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader)
(Continue reading)

Dan Carpenter | 4 Jan 08:24 2012
Picon

[patch] cgroup: move assignement out of condition in cgroup_attach_proc()

Gcc complains about this: "kernel/cgroup.c:2179:4: warning: suggest
parentheses around assignment used as truth value [-Wparentheses]"

Signed-off-by: Dan Carpenter <dan.carpenter@...>
---
I feel like the original developer may have left the parens out on
deliberately to stop checkpatch.pl complaining about long lines.  I so
much hate the long line warning...

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index cb3c131..6a057fe 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
 <at>  <at>  -2175,9 +2175,12  <at>  <at>  static int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader)
 		oldcg = tc->task->cgroups;

 		/* if we don't already have it in the list get a new one */
-		if (!css_set_check_fetched(cgrp, tc->task, oldcg, &newcg_list))
-			if (retval = css_set_prefetch(cgrp, oldcg, &newcg_list))
+		if (!css_set_check_fetched(cgrp, tc->task, oldcg,
+					&newcg_list)) {
+			retval = css_set_prefetch(cgrp, oldcg, &newcg_list);
+			if (retval)
 				goto out_list_teardown;
+		}
 	}

 	/*
Frederic Weisbecker | 4 Jan 11:38 2012
Picon

Re: [PATCH 2/3] cgroup: replace tasklist_lock with rcu_read_lock

On Tue, Jan 03, 2012 at 09:18:31PM -0800, Mandeep Singh Baines wrote:
> We can replace the tasklist_lock in cgroup_attach_proc with an
> rcu_read_lock.
> 
> Changes in V4:
> * https://lkml.org/lkml/2011/12/23/284 (Frederic Weisbecker)
>   * Minimize size of rcu_read_lock critical section
>   * Add comment
> * https://lkml.org/lkml/2011/12/26/136 (Li Zefan)
>   * Split into two patches
> Changes in V3:
> * https://lkml.org/lkml/2011/12/22/419 (Frederic Weisbecker)
>   * Add an rcu_read_lock to protect against exit
> Changes in V2:
> * https://lkml.org/lkml/2011/12/22/86 (Tejun Heo)
>   * Use a goto instead of returning -EAGAIN
> 
> Suggested-by: Frederic Weisbecker <fweisbec@...>
> Signed-off-by: Mandeep Singh Baines <msb@...>
> Cc: Tejun Heo <tj@...>
> Cc: Li Zefan <lizf@...>
> Cc: containers@...
> Cc: cgroups@...
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>
> Cc: Oleg Nesterov <oleg@...>
> Cc: Andrew Morton <akpm@...>
> Cc: Paul Menage <paul@...>

Acked-by: Frederic Weisbecker <fweisbec@...>

(Continue reading)

Tejun Heo | 4 Jan 16:38 2012

Re: [patch] cgroup: move assignement out of condition in cgroup_attach_proc()

On Wed, Jan 04, 2012 at 10:24:29AM +0300, Dan Carpenter wrote:
> Gcc complains about this: "kernel/cgroup.c:2179:4: warning: suggest
> parentheses around assignment used as truth value [-Wparentheses]"
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@...>

Applied to cgroup/for-3.3.  Li, applied w/o your ack as it's trivial.

Thanks.

--

-- 
tejun

Gmane