From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751417AbbJJDfa (ORCPT ); Fri, 9 Oct 2015 23:35:30 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:35135 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751009AbbJJDf3 (ORCPT ); Fri, 9 Oct 2015 23:35:29 -0400 Subject: Re: pidns: Make pid accounting and pid_max per namespace References: <56179700.3010703@mogujie.com> CC: , LKML To: From: Zefan Li Message-ID: <56188774.1040000@huawei.com> Date: Sat, 10 Oct 2015 11:35:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <56179700.3010703@mogujie.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.236] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/10/9 18:29, Zhang Haoyu wrote: > I started multiple docker containers in centos6.6(linux-2.6.32-504.16.2), > and there's one bad program was running in one container. > This program produced many child threads continuously without free, so more and > more pid numbers were consumed by this program, until hitting the pix_max limit (32768 > default in my system ). > > What's worse is that containers and host share the pid numbers resource, so new program > cannot be produced any more in host and other containers. > > And, I clone the upstream kernel source from > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > This problem is still there, I'm not sure. > > IMO, we should isolate the pid accounting and pid_max between pid namespaces, > and make them per pidns. > Below post had request for making pid_max per pidns. > http://thread.gmane.org/gmane.linux.kernel/1108167/focus=1111210 > Mainline kernel already supports per-cgroup pid limit, which should solve your problem.