lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090115135223.1789e639.kamezawa.hiroyu@jp.fujitsu.com>
Date:	Thu, 15 Jan 2009 13:52:23 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	balbir@...ux.vnet.ibm.com
Cc:	Daisuke Nishimura <nishimura@....nes.nec.co.jp>,
	LKML <linux-kernel@...r.kernel.org>,
	linux-mm <linux-mm@...ck.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Pavel Emelyanov <xemul@...nvz.org>,
	Li Zefan <lizf@...fujitsu.com>, Paul Menage <menage@...gle.com>
Subject: Re: [RFC][PATCH 5/4] memcg: don't call res_counter_uncharge when
 obsolete

On Thu, 15 Jan 2009 09:47:50 +0530
Balbir Singh <balbir@...ux.vnet.ibm.com> wrote:

> * KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com> [2009-01-15 12:24:16]:
> 
> > On Wed, 14 Jan 2009 19:25:39 +0530
> > Balbir Singh <balbir@...ux.vnet.ibm.com> wrote:
> > 
> > > * Daisuke Nishimura <nishimura@....nes.nec.co.jp> [2009-01-14 17:51:21]:
> > > 
> > > > This is a new one. Please review.
> > > > 
> > > > ===
> > > > From: Daisuke Nishimura <nishimura@....nes.nec.co.jp>
> > > > 
> > > > mem_cgroup_get ensures that the memcg that has been got can be accessed
> > > > even after the directory has been removed, but it doesn't ensure that parents
> > > > of it can be accessed: parents might have been freed already by rmdir.
> > > > 
> > > > This causes a bug in case of use_hierarchy==1, because res_counter_uncharge
> > > > climb up the tree.
> > > > 
> > > > Check if the memcg is obsolete, and don't call res_counter_uncharge when obsole.
> > > > 
> > > > Signed-off-by: Daisuke Nishimura <nishimura@....nes.nec.co.jp>
> > > 
> > > I liked the earlier, EBUSY approach that ensured that parents could
> > > not go away if children exist. IMHO, the code has gotten too complex
> > > and has too many corner cases. Time to revisit it.
> > > 
> > 
> > But I don't like -EBUSY ;)
> > 
> > When rmdir() returns -EBUSY even if there are no (visible) children and tasks,
> > our customer will take kdump and send it to me "please explain this kernel bug"
> > 
> > I'm sure it will happen ;)
> >
> 
> OK, but memory.stat can show why the group is busy and with
> move_to_parent() such issues should not occur right? I'll relook at
> the code. Thanks for your input.
> 
Write a shell script as following ?
==
  TASKS=`cat /xxx/xxx/xxx/tasks`
  if [ -n $TASKS ]; then
	echo "there is alive tasks in group /xxx/xxx/xxx/"
  fi
  
  rmdir /xxx/xxx/xxx/
  CODE=$?
  if [ $CODE = EBUSY ]; then
	investigate why....
  fi
==
I don't want.

I think rmdir() should succeed everywhen "there are no tasks and children".
And that can be done.

With Paul's suggestion, I'll add wait_queue for rmdir of cgroup.

-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ