Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1620634ybz; Thu, 23 Apr 2020 02:24:15 -0700 (PDT) X-Google-Smtp-Source: APiQypIZOzyzPFkOI8K5KRQ+K8HLuSd7zgN1IXuhIpRlYsvYZKCgFe36jYiurFfUUG55e5CRwNAd X-Received: by 2002:a50:b882:: with SMTP id l2mr1909930ede.350.1587633855345; Thu, 23 Apr 2020 02:24:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587633855; cv=none; d=google.com; s=arc-20160816; b=bj0vFUYxLYe1oOJT2R1Tdk5iSMBo8AGJ3jWZmjDOt0IFSUaAvPMBDR9ETuQYIJaLTH pGYnO20HMY6flU2sascb31jrr/qSbhPcbWGaEaMXhQNvZdkbWgGbifnPEAz8plgwRGXG EgJl1DojKWmF2mqlbpD+1p0pM4rkLlF7bCUQKkHsj7OWiroE1j8LRP8mvdKqn2Hth2XI Vx2qMA113ie1gbDUl2tSzlF1EKSrV2ruy/XLjdZXIOAwobtmBjErGCBNge7FmxGW1IUx dYJRYq5mRi81aElsaMygPfsnnY9vewB6WIXr4WZknslEOzOv+E8Xf7xHOVIKb7wZ871y Ft+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1fKzs9UovWQeHKCRqMzU4+gFyi6CVq0FjzMI1lp7abI=; b=WhbamQSrJ+RH/BF7N+tk2BncfL7t6DOgG1eCud7RmCfi03vElpeJZojgE0EwTtxeiv EnurQeiYm14bHVIORg3A0bQhQKCi9XRNOsHiaj6XaR1binkZvaD6bV1FM7ws+yEVyjKn S6sb5vqRKvZbSoAJoc6Pr2zZuzKd8QyYSgekb61tYTZOMSIljJ38MMdIt6m+CvAOTfyx idD0HgJOV94qB8Es2ANz7mCKkwg7XH2Ojgh6EnUG1iZY9LjDyZ/h61UTV0HHGI0Gnvdp D2F0q5NJEJFFAMPK9ghn4KQYmBuIR/iMhP3NEeR9tggXz/u8755JRu6yMkttpARRYLcL +k6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=hQ4vhmxQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s7si848260ejj.248.2020.04.23.02.23.51; Thu, 23 Apr 2020 02:24:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=hQ4vhmxQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726791AbgDWJU5 (ORCPT + 99 others); Thu, 23 Apr 2020 05:20:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbgDWJU4 (ORCPT ); Thu, 23 Apr 2020 05:20:56 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E65DC03C1AF for ; Thu, 23 Apr 2020 02:20:56 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id r16so3796694edw.5 for ; Thu, 23 Apr 2020 02:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1fKzs9UovWQeHKCRqMzU4+gFyi6CVq0FjzMI1lp7abI=; b=hQ4vhmxQJllZqxQWqkQO6ueXNo7O1v78FH6wjfGEUHMuvcTK6wA2vUqEz3C1aI/LZp aZ/huAfGHLDW01pGzo7FdC9w7bjL2pWg3ZiDRaK0k2Y1gaOTjuaTS0x1FXq7LwBiLaGQ VuG0FvPZjwVmpjBFBtzUrZ5hL1SjFlYUkoES8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1fKzs9UovWQeHKCRqMzU4+gFyi6CVq0FjzMI1lp7abI=; b=fGeewy7QdOQTBE+lLyvNu+CmVLKu8I3j/TczLtSbglLbOvF9/mwphPDesXzJ2UFvlS R8rWO54lpnlvsZrWjeZe4X28biCSMNg5FW8HJfX2pH1Y3UKocxmgkjjUjM/LJzz7fsqM BScXZR/qnmwzw9wvvdbGrg51hO5B6XOXETy4g9HFkR7mj2dmv0EEA1nW8f1ThJtGfTXF lXTPaWseRZI2YGGQNpL083OxFO02jQD33c9DfvMUTb5/On82peRT5plYpd9XsVaC/hDw KaP6pkAe94i6OtPACWAPIZ/VQb1nky1Bp2ep6XgSG+f46ivKZ/2TZnUmM2zdn+VNdbty OP+w== X-Gm-Message-State: AGi0PuZqsUz7JTom8ncyNyl7VM6e92BztgqpnVtOV4GOx2Y+nYwKl1mF 9jh2oKixSbzkxRmh5PrTTce4Fg5TUXtCTsopRtoBvg== X-Received: by 2002:aa7:c312:: with SMTP id l18mr1973720edq.161.1587633655321; Thu, 23 Apr 2020 02:20:55 -0700 (PDT) MIME-Version: 1.0 References: <9873b8bd7d14ff8cd2a5782b434b39f076679eeb.1587531463.git.josh@joshtriplett.org> <20200423004807.GC161058@localhost> <20200423044226.GH161058@localhost> <20200423073310.GA169998@localhost> In-Reply-To: From: Miklos Szeredi Date: Thu, 23 Apr 2020 11:20:44 +0200 Message-ID: Subject: Re: [PATCH v5 2/3] fs: openat2: Extend open_how to allow userspace-selected fds To: Josh Triplett Cc: Michael Kerrisk , io-uring@vger.kernel.org, "linux-fsdevel@vger.kernel.org" , lkml , Alexander Viro , Arnd Bergmann , Jens Axboe , Aleksa Sarai , linux-man , Linux API Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 23, 2020 at 9:57 AM Miklos Szeredi wrote: > > On Thu, Apr 23, 2020 at 9:45 AM Miklos Szeredi wrote: > > > > I would prefer to not introduce that limitation in the first place, and > > > instead open normal file descriptors. > > > > > > > The point of O_SPECIFIC_FD is to be able to perform short > > > > sequences of open/dosomething/close without having to block and having > > > > to issue separate syscalls. > > > > > > "close" is not a required component. It's entirely possible to use > > > io_uring to open a file descriptor, do various things with it, and then > > > leave it open for subsequent usage via either other io_uring chains or > > > standalone syscalls. > > > > If this use case arraises, we could add an op to dup/move a private > > descriptor to a public one. io_uring can return values, right? > > > > Still not convinced... > > Oh, and we haven't even touched on the biggest advantage of a private > fd table: not having to dirty a cacheline on fdget/fdput due to the > possibility of concurrent close() in a MT application. > > I believe this is a sticking point in some big enterprise apps and it > may even be a driving force for io_uring. https://lwn.net/Articles/787473/ And an interesting (very old) article referenced from above, that gives yet a new angle on fd allocation issues: https://lwn.net/Articles/236843/ A private fd space would be perfect for libraries such as glibc. Thanks, Miklos