From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758085AbcG1NKf (ORCPT ); Thu, 28 Jul 2016 09:10:35 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:37309 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757919AbcG1NKU (ORCPT ); Thu, 28 Jul 2016 09:10:20 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: "Michael Kerrisk \(man-pages\)" Cc: Andrew Vagin , Andrey Vagin , Serge Hallyn , "criu\@openvz.org" , Linux API , Linux Containers , LKML , James Bottomley , linux-fsdevel , Alexander Viro References: <1515f5f2-5a49-fcab-61f4-8b627d3ba3e2@gmail.com> <87lh0pg8jx.fsf@x220.int.ebiederm.org> <44ca0e41-dc92-45b1-2a6c-c41a048a072d@gmail.com> <87r3ahepb4.fsf@x220.int.ebiederm.org> <20160726025455.GC26206@outlook.office365.com> <3390535b-0660-757f-aeba-c03d936b3485@gmail.com> <20160726182524.GA328@outlook.office365.com> <20160726203955.GA9415@outlook.office365.com> Date: Thu, 28 Jul 2016 07:56:42 -0500 In-Reply-To: (Michael Kerrisk's message of "Thu, 28 Jul 2016 12:45:12 +0200") Message-ID: <87popxkjjp.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1bSl4V-0007Eq-IG;;;mid=<87popxkjjp.fsf@x220.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=67.3.204.119;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18RMcZXUCCITwn3szU+rLonkvK3RWd1FhQ= X-SA-Exim-Connect-IP: 67.3.204.119 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4437] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa02 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa02 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;"Michael Kerrisk \(man-pages\)" X-Spam-Relay-Country: X-Spam-Timing: total 743 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 4.0 (0.5%), b_tie_ro: 2.9 (0.4%), parse: 1.24 (0.2%), extract_message_metadata: 4.4 (0.6%), get_uri_detail_list: 1.96 (0.3%), tests_pri_-1000: 6 (0.7%), tests_pri_-950: 2.0 (0.3%), tests_pri_-900: 1.64 (0.2%), tests_pri_-400: 31 (4.1%), check_bayes: 29 (3.9%), b_tokenize: 10 (1.4%), b_tok_get_all: 8 (1.1%), b_comp_prob: 3.7 (0.5%), b_tok_touch_all: 2.9 (0.4%), b_finish: 0.87 (0.1%), tests_pri_0: 666 (89.7%), check_dkim_signature: 0.87 (0.1%), check_dkim_adsp: 163 (22.0%), tests_pri_500: 7 (1.0%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 0/5 RFC] Add an interface to discover relationships between namespaces X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Michael Kerrisk (man-pages)" writes: > On 07/26/2016 10:39 PM, Andrew Vagin wrote: >> On Tue, Jul 26, 2016 at 09:17:31PM +0200, Michael Kerrisk (man-pages) wrote: >> If we want to compare two file descriptors of the current process, >> it is one of cases for which kcmp can be used. We can call kcmp to >> compare two namespaces which are opened in other processes. > > Is there really a use case there? I assume we're talking about the > scenario where a process in one namespace opens a /proc/PID/ns/* > file descriptor and passes that FD to another process via a UNIX > domain socket. Is that correct? > > So, supposing that we want to build a map of the relationships > between namespaces using the proposed kcmp() API, and there are > say N namespaces? Does this mena we make (N * (N-1) / 2) calls > to kcmp()? Potentially. The numbers are small enough O(N^2) isn't fatal. Where kcmp shines is that it allows migration to happen. Inode numbers to change (which they very much will today), and still have things work. We can keep it O(Nlog(N)) by taking advantage of not just the equality but the ordering relationship. Although Ugh. One disadvantage of kcmp currently is that the way the ordering relationship is defined the order is not preserved over migration :( Eric