From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754512Ab0IWPXA (ORCPT ); Thu, 23 Sep 2010 11:23:00 -0400 Received: from spaceboyz.net ([87.106.131.203]:51704 "EHLO spaceboyz.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751749Ab0IWPW7 (ORCPT ); Thu, 23 Sep 2010 11:22:59 -0400 Date: Thu, 23 Sep 2010 16:54:58 +0200 From: David Lamparter To: Pavel Emelyanov Cc: hadi@cyberus.ca, "Eric W. Biederman" , linux-kernel@vger.kernel.org, Linux Containers , netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Daniel Lezcano , Linus Torvalds , Michael Kerrisk , Ulrich Drepper , Al Viro , David Miller , "Serge E. Hallyn" , Ben Greear , Matt Helsley , Jonathan Corbet , Sukadev Bhattiprolu , Jan Engelhardt , Patrick McHardy Subject: Re: [PATCH 8/8] net: Implement socketat. Message-ID: <20100923145458.GA1160234@jupiter.n2.diac24.net> References: <4C9B162E.7040201@parallels.com> <1285240797.5036.5.camel@bigi> <4C9B3B06.900@parallels.com> <1285242055.5036.9.camel@bigi> <4C9B3F9C.8080506@parallels.com> <1285243881.5036.22.camel@bigi> <4C9B495D.70200@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C9B495D.70200@parallels.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 23, 2010 at 04:34:37PM +0400, Pavel Emelyanov wrote: > On 09/23/2010 04:11 PM, jamal wrote: > > On Thu, 2010-09-23 at 15:53 +0400, Pavel Emelyanov wrote: > > > >> Why does it matter? You told, that the usage scenario was to > >> add routes to container. If I do 2 syscalls instead of 1, is > >> it THAT worse? > >> > > > > Anything to do with socket IO that requires namespace awareness > > applies for usage; it could be tcp/udp/etc socket. If it doesnt > > make any difference performance wise using one scheme vs other > > to write/read heavy messages then i dont see an issue and socketat > > is redundant. > > That's what my point is about - unless we know why would we need it > we don't need it. > > Eric, please clarify, what is the need in creating a socket in foreign > net namespace? Hmm. If you somewhere get the fd to a socket from another namespace, it definitely does work (I'm currently implementing my "socketat" with fd passing through AF_UNIX sockets, so i know it works), so the setns(other...) fd = socket(...) setns(orig...) sequence would certainly work. However, there might be other things happening inbetween like a signal (imagine AIO particularly). While signals are user-controllable (and therefore to be managed/excluded by the user), we need to think if there are other problems with doing this as sequence? If there are no other problematic conditions with this, socketat should probably be moved to a user library. -David