From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH] [RFC] fs, proc: don't guard /proc//task//children on CONFIG_CHECKPOINT_RESTORE Date: Thu, 21 May 2015 13:57:03 -0700 Message-ID: <20150521135703.22af370fdd0799101a6a1b91@linux-foundation.org> References: <1432204221-1933-1-git-send-email-alban@endocode.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1432204221-1933-1-git-send-email-alban@endocode.com> Sender: linux-fsdevel-owner@vger.kernel.org To: Alban Crequy Cc: Cyrill Gorcunov , Oleg Nesterov , Kees Cook , Pavel Emelyanov , Serge Hallyn , KAMEZAWA Hiroyuki , linux-api@vger.kernel.org, Alexander Viro , linux-fsdevel@vger.kernel.org, Alban Crequy , Iago Lopez Galeiras List-Id: linux-api@vger.kernel.org On Thu, 21 May 2015 12:30:21 +0200 Alban Crequy wrote: > commit 818411616baf ("fs, proc: introduce > /proc//task//children entry") introduced the children entry > for checkpoint restore and the file is only available on kernels > configured with CONFIG_EXPERT and CONFIG_CHECKPOINT_RESTORE. > > This is available in most distributions (Fedora, Debian, Ubuntu, CoreOS) > because they usually enable CONFIG_EXPERT and CONFIG_CHECKPOINT_RESTORE. > But Arch does not enable CONFIG_EXPERT or CONFIG_CHECKPOINT_RESTORE. > > However, the children proc file is useful outside of checkpoint restore. > I would like to use it in rkt. The rkt process exec() another program it > does not control, and that other program will fork()+exec() a child > process. I would like to find the pid of the child process from an > external tool without iterating in /proc over all processes to find > which one has a parent pid equal to rkt. > > Since the children proc file is useful outside of checkpoint-restore, > I am removing the guard on CONFIG_CHECKPOINT_RESTORE. This will add a lump of code to kernels which don't need it. It's a bit of a pain, but I suppose we should still keep the presence of get_children_pid() configurable. That would be by adding a new CONFIG_PROC_CHILDREN (or similar) and making CONFIG_CHECKPOINT_RESTORE select that.