Re: [RESEND PATCH V4] pidns: introduce syscall translate_pid

From: Konstantin Khlebnikov
Date: Wed Apr 04 2018 - 04:28:44 EST


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 <nagarathnam.muthusamy@xxxxxxxxxx> 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.