Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4341518ybp; Mon, 14 Oct 2019 03:09:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzId3otgrH+w2MGTXKFN+kts3+t1W+yTXRoJlUyj0DJnmGvpeXVyRwW5XcExmjTskq11hMb X-Received: by 2002:a17:906:2cd2:: with SMTP id r18mr27751734ejr.282.1571047745306; Mon, 14 Oct 2019 03:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571047745; cv=none; d=google.com; s=arc-20160816; b=p0gL0ZB+JY9JpBuqNe5xZrfOGlAdmFVXVw7ZVPzbWKLLJVL9tXaEsRQt+GjzqNz//n ag/rl1j7mJ4oJXQ9cHM8hDQu1KvbfrfIOQCL1Wo8xrQnPgdMbBAASfNKm4Ntu5QtK9rl YssIjnPEgebA8lSEINpY/hJPfeW2pH0LIKw9cdxuxyKSFMACjB/U4g3h28/SAE1m7N1D iHTqsMCSsyvHAbEVKSdKNir2ElqiNEzR8XsOFYQJtEKgzMgBwfH2ftjKok9QJ/d4OqMP xATcOzAyk+fhWaZVK/Q0+3Yx2MsCWDA+cKzJxdFwwi47ToWv0/LJPdoYs2G0WNiMAaHE A4ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=SxI6NTYZ3y5ovZLTmVDcYdWv5wIuiAZHrAzrgILQvCs=; b=YoKY/qONHR4Dp9q+XpmBq+v+oONcLQ/b2pNDbBvpbkNMd1y5KLDzDW4gMi+ItYO9iq 9l/IfUeXsV+eJPyR5zBQs+5o2owOhQh8waRf4PTXS9WikZt+iQkXVyiF33a8+X7V70EZ FXeycwb7Oi7HnUIjb6OyUDpOad82vk1bTB3m0r0x+CAsC6NCIdhMXYPd52aL+vawm+XS Wcgcvm9r+e6MPnj9XapzUJj8zGin/Mz3CbnjKbDj7p+7w2xUgvCianolLQA+gv/B50Qa RJ8mzzFc6dywiLUnbaiwAKJGV2IggceA1lsONjdVjH5DKuLLfaaSZK2WfzRyWATPmOAF zI6w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j46si12792064eda.9.2019.10.14.03.08.42; Mon, 14 Oct 2019 03:09:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731234AbfJNKIg (ORCPT + 99 others); Mon, 14 Oct 2019 06:08:36 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:33409 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730880AbfJNKIf (ORCPT ); Mon, 14 Oct 2019 06:08:35 -0400 Received: from [212.86.36.32] (helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iJxH8-000093-VJ; Mon, 14 Oct 2019 10:08:27 +0000 Date: Mon, 14 Oct 2019 12:08:26 +0200 From: Christian Brauner To: "Michael Kerrisk (man-pages)" Cc: Aleksa Sarai , Linux Kernel , Oleg Nesterov , Florian Weimer , "libc-alpha@sourceware.org" , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Shuah Khan , Andrew Morton , Michal Hocko , Elena Reshetova , Thomas Gleixner , Roman Gushchin , Andrea Arcangeli , Al Viro , "Dmitry V. Levin" , linux-kselftest@vger.kernel.org Subject: Re: [PATCH 1/2] clone3: add CLONE3_CLEAR_SIGHAND Message-ID: <20191014100824.sc4aqfktbn6go736@wittgenstein> References: <20191010133518.5420-1-christian.brauner@ubuntu.com> <20191011221208.5eglbazksfigliob@yavin.dot.cyphar.com> <20191012074840.4to7lh4zbt4wup74@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 12, 2019 at 01:46:54PM +0200, Michael Kerrisk (man-pages) wrote: > On 10/12/19 9:48 AM, Christian Brauner wrote: > > On Sat, Oct 12, 2019 at 08:53:34AM +0200, Michael Kerrisk (man-pages) wrote: > >> Hello Aleksa, > >> > >> On Sat, 12 Oct 2019 at 00:12, Aleksa Sarai wrote: > >>> > >>> On 2019-10-11, Michael Kerrisk wrote: > >>>> Why CLONE3_CLEAR_SIGHAND rather than just CLONE_CLEAR_SIGHAND? > > > > I don't care much how we name this apart from the "_CLEAR_SIGHAND" > > suffix. But see for a little rationale below. > > > >>> > >>> There are no more flag bits left for the classic clone()/clone2() (the > >>> last one was used up by CLONE_PIDFD) -- thus this flag is clone3()-only. > >> > >> Yes, I understand that. But, I'm not sure that the "3" in the prefix > >> is necessary. "CLONE_" still seems better to me. > >> > >> Consider this: sometime in the near future we will probably have time > >> namespaces. The new flag for those namespaces will only be usable with > >> clone3(). It should NOT be called CLONE3_NEWTIME, but rather > >> CLONE_NEWTIME (or similar), because that same flag will presumably > >> also be used in other APIs such as unshare() and setns(). (Hmm -- I > > > > There are some noteable differences though. CLONE_NEWTIME takes the > > CSIGNAL bit which is in the range of a 32bit integer and thus useable by > > unshare() too. The same does not hold for CLONE{3}_CLEAR_SIGHAND. You > > can't pass it to unshare(). unshare() also just deals with > > namespace-relevant stuff so CLONE{3}_CLEAR_SIGHAND doesn't make much > > sense there. > > Sure, but going forward there's very likely to be more CLONE flags > for whatever reason, and some will be usable just in clone3() > while others will be more widely used (in other APIs such as > unshare() and setns()). Using two different prefixes for these > flags (CLONE_/CLONE3_) would be just confusing. AFAICS, the CLONE3_ I do agree with that part. And as I said in my previous mail, I don't care about the prefix. > prefix really provides no advantage, but does have the potential to > cause confusion down the track for the aforementioned reasons. > (Furthermore... Shudder! What if there's a clone4() one day. I > know you might say: "won't happen, we got things right this time", > but API history suggests that "right" now not infrequently becomes > "oops" later.) I do recommend CLONE_ for all the flags... I do love your trust in our ability to design syscalls (//Cc Aleksa ;)). :) > > >> wonder if we are going to need a new unshare2() or some such...) > > > > We still have one 32bit bit left (CLONE_DETACHED) which we can't reuse > > with clone()/clone2() but we can reuse with clone3(). We can simply > > earmark it for namespace-related stuff and thus still have one bit left > > for unshare() before we have to go for unshare2() (If we have to go > > there at all since I'm not sure how much more namespaces we can come up > > with.). > > I'm sure there'll be more namespaces... Let's hope not. :) Anyway, no real reason to do unshare2() any time soon. :) Christian