From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751290AbdJDQgf (ORCPT ); Wed, 4 Oct 2017 12:36:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46250 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbdJDQgd (ORCPT ); Wed, 4 Oct 2017 12:36:33 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8F85A81E1C Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=oleg@redhat.com Date: Wed, 4 Oct 2017 18:36:31 +0200 From: Oleg Nesterov To: Alexey Dobriyan Cc: akpm@linux-foundation.org, ebiederm@xmission.com, keescook@chromium.org, mm-commits@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: + pid-delete-reserved_pids.patch added to -mm tree Message-ID: <20171004163631.GA17777@redhat.com> References: <59d2c819.FeJw+478bpKqle6W%akpm@linux-foundation.org> <20171003155314.GA9929@redhat.com> <20171003215349.GA7023@avx2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171003215349.GA7023@avx2> User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 04 Oct 2017 16:36:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/04, Alexey Dobriyan wrote: > > On Tue, Oct 03, 2017 at 05:53:15PM +0200, Oleg Nesterov wrote: > > On 10/02, Andrew Morton wrote: > > > > > > From: Alexey Dobriyan > > > Subject: pid: delete RESERVED_PIDS > > > > > > RESERVED_PIDS had a noble goal: to protect root from PID exhaustion since > > > at least ~2.5.40 > > > > I am just curious, where did you find the change which documents this goal? > > Now that you asked, I'm not exactly sure. :-( Please don't tell it is for some > kind of stupid userspace which assumed low numbers are kernel threads. Not necessarily kernel threads, > > > Allow small pids to be allocated after rollover, there is nothing sacred > > > about them. > > > > > > Resource exhaustion should be handled by rlimits and/or kernel memory > > > accounting. > > > > I won't argue, but I always thought that the only purpose of RESERVED_PIDS > > is to make the system/kernek daemons started at boot time more "visible" in > > /usr/bin/ps output. > > They will be first in line naturally: kthreadd + init execute first and > rarely exit. Exactly. But, with your patch, only until ->last_pid overlaps. And while I don't think this can break something, I bet humans will notice this change ;) And in fact, from time to time I thought that perhaps it makes sense to change alloc_pidmap() to check PF_KTHREAD and allocate the new pid from RESERVED_PIDS interval if it is set. So I am not sure this is change is really good but I won't argue. Oleg.