From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757680Ab2CMREY (ORCPT ); Tue, 13 Mar 2012 13:04:24 -0400 Received: from mail-yx0-f202.google.com ([209.85.213.202]:34545 "EHLO mail-yx0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755432Ab2CMREW (ORCPT ); Tue, 13 Mar 2012 13:04:22 -0400 From: Greg Thelen To: Glauber Costa Cc: KAMEZAWA Hiroyuki , Suleiman Souhlal , , , , , , , , , , , , , , , rientjes@google.com Subject: Re: [PATCH v2 02/13] memcg: Kernel memory accounting infrastructure. References: <1331325556-16447-1-git-send-email-ssouhlal@FreeBSD.org> <1331325556-16447-3-git-send-email-ssouhlal@FreeBSD.org> <4F5C5E54.2020408@parallels.com> <20120313152446.28b0d696.kamezawa.hiroyu@jp.fujitsu.com> <4F5F236A.1070609@parallels.com> Date: Tue, 13 Mar 2012 10:00:58 -0700 In-Reply-To: <4F5F236A.1070609@parallels.com> (Glauber Costa's message of "Tue, 13 Mar 2012 14:37:30 +0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Glauber Costa writes: > 2) For the kernel itself, we are mostly concerned that a malicious container may > pin into memory big amounts of kernel memory which is, ultimately, > unreclaimable. In particular, with overcommit allowed scenarios, you can fill > the whole physical memory (or at least a significant part) with those objects, > well beyond your softlimit allowance, making the creation of further containers > impossible. > With user memory, you can reclaim the cgroup back to its place. With kernel > memory, you can't. In overcommit situations the page allocator starts failing even though memcg page can charge pages. When page allocations fail the oom killer plays a role. Page allocations can fail even without malicious usage of kernel memory (e.g. lots of mlock or anon without swap can fill a machine). I assume that the kernel memory pinned the malicious containers will be freed or at least become reclaimable once the processes in malicious containers are killed (oom or otherwise). We have been making use of the oom killer to save a system from irreconcilable overcommit situations.