From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751301Ab1KKKFB (ORCPT ); Fri, 11 Nov 2011 05:05:01 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:40095 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750783Ab1KKKE7 (ORCPT ); Fri, 11 Nov 2011 05:04:59 -0500 Message-ID: <4EBCF346.6020900@parallels.com> Date: Fri, 11 Nov 2011 14:04:54 +0400 From: Pavel Emelyanov User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Thunderbird/3.1.10 MIME-Version: 1.0 To: Tejun Heo CC: Andrew Morton , Cyrill Gorcunov , Glauber Costa , Nathan Lynch , Linux Kernel Mailing List , Oleg Nesterov , Serge Hallyn , Daniel Lezcano Subject: Re: [PATCH 3/3] pids: Make it possible to clone tasks with given pids References: <4EBC0696.9030103@parallels.com> <4EBC06DB.3090202@parallels.com> <20111110173009.GH27258@google.com> <4EBC0B87.1030305@parallels.com> <20111110174515.GI27258@google.com> In-Reply-To: <20111110174515.GI27258@google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/10/2011 09:45 PM, Tejun Heo wrote: > Hello, > > On Thu, Nov 10, 2011 at 09:36:07PM +0400, Pavel Emelyanov wrote: >>> Hmmm... is it necessary to be able to replicate pids on all >>> namespaces? >> >> Not for us (I mean OpenVZ). But since we should (in theory) be able to >> recreate the nested set of namespaces it would be good if the API allows >> for this from the very beginning. > > I see. > >>> Also, isn't it a bit weird to be able to request PIDs in >>> the namespaces which is beyond the task which requested cloning? >> >> It is, but the last_pid != 0 check will abort this request with EPERM :) >> Do you think some other behavior would be better? > > Right, missed that part. The only suggestion then is that clearing > wants_pid to NULL isn't an optimization but should be part of API - > ie. want_pids is 0 terminated; otherwise, the caller must know at > which ns depth it is. Mm... I don't understand your concern. If the want_pid[n] == 0 at some n value the further pid numbers should be generated, not set. I can NOT set want_pid to NULL here, but keep it point to the n'th array member, but this will make the code go through the get_user() again and again. This want_pid = NULL is just to make the first if (want_pid == NULL) check work. > Thanks. >