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]
Date:	Wed, 7 Apr 2010 17:11:13 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	Heiko Carstens <heiko.carstens@...ibm.com>
Cc:	Balbir Singh <balbir@...ux.vnet.ibm.com>,
	Rik van Riel <riel@...hat.com>,
	Larry Woodman <lwoodman@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"nishimura@....nes.nec.co.jp" <nishimura@....nes.nec.co.jp>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Subject: Re: RFC [Patch] Remove
 "please try 'cgroup_disable=memory' option if you don't want memory cgroups"
 printk at boot time.

On Wed, 7 Apr 2010 10:00:14 +0200
Heiko Carstens <heiko.carstens@...ibm.com> wrote:

> On Thu, Apr 01, 2010 at 10:23:10AM +0530, Balbir Singh wrote:
> > * KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com> [2010-04-01 10:48:59]:
> > I've seen this issue come up on multiple machines, I think the printk
> > is useful. However, we might need to change the panic() to a big fat
> > warning and disable the memcg controller if we fail to allocate memory
> > in page_cgroup_init_flatmem(). 
> 
> Probably a stupid question: but isn't it possible to allocate the huge
> amounts of memory only if somebody activates memcg during runtime?

Activation can occur only at boot but page_cgroup allocation happens at
memory hotplug.

> And then allocate everything using vmalloc?
No.

> But that probably doesn't work, since you need to record everything
> from the boot of the system, I would guess?

The story was..

1. at first, page_cgroup was allocated on demand. but we need to have
   page->page_cgroup pointer. Then, we pay 8bytes per page even if we
   disable memory cgroup.
   All page behavior was tracked since boot time.

2. Fedora maintaienr said "we never enable memcg if you contiue to use
   page->page_cgroup pointer, 8bytes per page costs!".
   Then, we decieded to allocate page_cgroup at boot time, and allocate
   all at once at boot time. This makes memcg runtime robust. And we
   got rid of page->page_cgroup pointer.
   cgroup_disable=memory user have no waste of memory now.

> Just wondering because we do everything to not even waste a single bit
> in struct page and all of a sudden on the enterprise distros we allocate
> (by default!) 40 additional bytes per page.

3. Then, I added warning when I wrote a patch to allocate page_cgroup at boot.
   It's easy to avoid extra 40bytes.
   For enterprise, I have no concern. Enterprise admin tend to be careful and
   check all default value when he use a new kernel.
   That message was for desktop guys using desktop distro.

   Disabling memory cgroup at default may be a choice. But no one send such kind
   of patch until now.

Thanks,
-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