From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758074Ab1KKQwm (ORCPT ); Fri, 11 Nov 2011 11:52:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:3554 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756737Ab1KKQwl (ORCPT ); Fri, 11 Nov 2011 11:52:41 -0500 Date: Fri, 11 Nov 2011 17:48:00 +0100 From: Oleg Nesterov To: Pavel Emelyanov Cc: Tejun Heo , Andrew Morton , Cyrill Gorcunov , Glauber Costa , Nathan Lynch , Linux Kernel Mailing List , Serge Hallyn , Daniel Lezcano Subject: Re: [PATCH 3/3] pids: Make it possible to clone tasks with given pids Message-ID: <20111111164800.GA27245@redhat.com> References: <4EBC0696.9030103@parallels.com> <4EBC06DB.3090202@parallels.com> <20111110184654.GA1006@redhat.com> <20111110185603.GA1757@redhat.com> <4EBCF4E7.4090002@parallels.com> <20111111152532.GA22640@redhat.com> <4EBD461E.1000106@parallels.com> <4EBD4A7E.7060102@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EBD4A7E.7060102@parallels.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/11, Pavel Emelyanov wrote: > > First of all - let's imagine that we just want to clone a set of tasks. Then > each of them will have to fork its kids, then report first of them that he's > OK to fork and wait for it to report back, that forking is done. Then do the > same for the rest of them. This is not impossible, but painful. Why we should wait/report? They can do this in parallel, only "set_last_pid + fork" needs the synchronization or "check + retry". > Next - let's consider we have some tasks sharing various resources, e.g. mm-s > or fd-tables. This means, that these tasks should be cloned in the carefully > calculated sequence with CLONE_XXX flags set. In this case the described above > scheme with fork() serialization simply won't work and we'll have to invent > some fancy messaging with "now X fork with Y pid" and "X done with forking, > please go on" messages. Can't understand... Oleg.