Received: by 10.213.65.68 with SMTP id h4csp468158imn; Wed, 4 Apr 2018 01:30:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx49C9EMTJ26sHXAr+ctoVmQpKDRXbL2pqj9OzBg485WBN9PvYvPtliy6lj+3BjcrLPk2uxbC X-Received: by 2002:a17:902:1006:: with SMTP id b6-v6mr17750512pla.252.1522830604480; Wed, 04 Apr 2018 01:30:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522830604; cv=none; d=google.com; s=arc-20160816; b=vkwPS3Uuv8mjtqQ/nK8YbX5CO+iaTHvnQ7BBgRmvwKVCbm17jBi+zW77w7mY8T8MAQ s9MJvRmByVcnKYTQd/o7OtWw3vcADK3MLCILYr9XQ0cTThp8AKTfV/QAlc1H4Vs+9ZzQ IbKY3XAUkvWY5/u55E1ZKufuk1qJ2T4mKjCSDK/JsQXIZOveXvpMehWGxXanQcVRhS2B /ZlXXQP3WQNbxrQrXhQLiqnVvD1ffK5F9p81L/8LwoXbZOTctGZiGumvM5QOo+VQN8zn rpmqbDqHBpUcjrJVaXVCJZghYzSR4/3WvquDhWk/eQ4/cX8pxWSec2pubfgABcHCpa8b rLlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=NKGrYwAYF3pqEA5N/baroJSh9FT7yMFjquZ3EnUTE1Y=; b=eyP2vIQpY35gZbHSfpNtkGV9z34KfPmUQ/SwzH0xEHg4kiOEX/QxdhzyrXIW9Yh9HK 0CXVfEN2AGGQqmbJPoIT+0V8hsxAurZAAVJiVuwl9WGB0SRkbexjvdfUrA68XZ4QuQJo oTT/K94g+pRavZKWLKXqQaNtnajw0sSzBeev6eVMCuPxVXksKZbYjm0csAD1Z8YHnRAl CduolCKj4Q4rUrGjoNn1EOFgnAz7SsfUkOi+fy5onPQjl5/k6FHM4rtxY4K2PYNMDVgB pZrXIXmegdzScPBWopqYQqasAT1BJ26q3Ku3rZgjHQI6LkiI1VSwhHZYBigdLXizlzWO qNIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=NO30PeCC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l23si3306857pgn.696.2018.04.04.01.29.50; Wed, 04 Apr 2018 01:30:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=NO30PeCC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751392AbeDDI2j (ORCPT + 99 others); Wed, 4 Apr 2018 04:28:39 -0400 Received: from forwardcorp1g.cmail.yandex.net ([87.250.241.190]:43441 "EHLO forwardcorp1g.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751314AbeDDI2h (ORCPT ); Wed, 4 Apr 2018 04:28:37 -0400 Received: from smtpcorp1p.mail.yandex.net (smtpcorp1p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b6:10]) by forwardcorp1g.cmail.yandex.net (Yandex) with ESMTP id 0696E21746; Wed, 4 Apr 2018 11:28:34 +0300 (MSK) Received: from smtpcorp1p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtpcorp1p.mail.yandex.net (Yandex) with ESMTP id 04C536E40925; Wed, 4 Apr 2018 11:28:34 +0300 (MSK) Received: from unknown (unknown [2a02:6b8:0:40c:1d16:36aa:f3f9:c229]) by smtpcorp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id GVRtM2AHUR-SXdKUSNZ; Wed, 04 Apr 2018 11:28:34 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1522830514; bh=NKGrYwAYF3pqEA5N/baroJSh9FT7yMFjquZ3EnUTE1Y=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=NO30PeCCIjEC+3KEUGLbjoxYMkcHzrl5m0f+lAraCkOefrVuCxi3iQsTlrlZ0WyZP yGumNYDEIkEBBSZ0XujNSkNXJRBFc+UmPegeCdlghDDMkPU6QBWn+xSPobBxYERnXC dEQ4C/TOtiMPFokzxN7MTtuUrR7u622PXPxasCPA= Authentication-Results: smtpcorp1p.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: Re: [RESEND PATCH V4] pidns: introduce syscall translate_pid To: Nagarathnam Muthusamy , Andrew Morton Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, ebiederm@xmission.com, serge.hallyn@ubuntu.com, oleg@redhat.com, luto@amacapital.net, jannh@google.com, prakash.sangappa@oracle.com References: <1522706249-11578-1-git-send-email-nagarathnam.muthusamy@oracle.com> <20180403143838.614ecc083835d07d409a699c@linux-foundation.org> <678f275b-8d78-9b0f-177f-5ff5c9c55657@oracle.com> <20180403145248.fb4cd8c5ccd270ca77fd18f3@linux-foundation.org> <6a117d9a-f005-e1ae-5632-25e5c61dcb8f@oracle.com> From: Konstantin Khlebnikov Message-ID: <0f0a03df-9171-fc29-194b-77d1792b5698@yandex-team.ru> Date: Wed, 4 Apr 2018 11:28:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <6a117d9a-f005-e1ae-5632-25e5c61dcb8f@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04.04.2018 00:51, Nagarathnam Muthusamy wrote: > > > On 04/03/2018 02:52 PM, Andrew Morton wrote: >> On Tue, 3 Apr 2018 14:45:28 -0700 Nagarathnam Muthusamy wrote: >> >>>> This changelog doesn't explain what the value is to our users.  I >>>> assume it is a performance optimization because "backward translation >>>> requires scanning all tasks"?  If so, please show us real-world >>>> examples of the performance benefit from this patch, and please go to >>>> great lengths to explain to us why this optimisation is needed by our >>>> users. >>> One of the usecase by Oracle database involves multiple levels of >>> nested pid namespaces and we require pid translation between the >>> levels. Discussions on the particular usecase, why any of the existing >>> methods was not usable happened in the following thread. >>> >>> https://patchwork.kernel.org/patch/10276785/ >>> >>> At the end, it was agreed that this patch along with flocks will solve the >>> issue. >> Nobody who reads this patch's changelog will know any of this.  Please >> let's get all this information into the proper place. > Sure! Will resend the patch with updated change log. I have v5 version of this proposal in work. I've redesigned interface to be more convenient for cases where strict race-protection isn't required and pid-ns could be referenced pid. It has 5 arguments rather than 3 because types of references are defined explicitly rather than magic like -1, >0, <0. This more verbose but protects against errors like passing -1 from failed previous syscall as argument. kind of translate_pid(pid, TRANSLATE_PID_FD_PIDNS, ns_fd, TRANSLATE_PID_CURRENT_PIDNS, 0) I'll send it today with including more detailed motivation for patch.