Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1563241ybz; Thu, 23 Apr 2020 00:59:12 -0700 (PDT) X-Google-Smtp-Source: APiQypIEBMsNqF4yJ53R4U5QZScrslM1Lr5VWZYU6zUe8Uy4mygYhXpZfzNq/Bqe9RCxn7ZVZojA X-Received: by 2002:a17:906:2458:: with SMTP id a24mr1596404ejb.239.1587628752436; Thu, 23 Apr 2020 00:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587628752; cv=none; d=google.com; s=arc-20160816; b=BZzP/i6c5abXnYTTqO5VF93ey+yAZcfS8gWKvE+gqrbkc8/r8jRpViYplGI0fWiT8D Yk9lnl31NPUIqGpL5NsDDNuU5E8AomNa8LQFTroUFbz2kScq+QIn1+0LMebpW6IF6x75 66M7yi9gTcPDAm8uDfYhD7IaOZfI8A2w9J06QrsmBATNUKO58dlzhDoK9Vh2uhSeexZh CK6Prs02UNbTxeHPWKsJmxpYHLRZgjtObzRjIVxWZNiJJlQigAGBhOR25XWlD1oPM2V7 +DXWYxTDnUfze2Fcl0lNoEgOCK0Ezq62NuenxW8uM9ebDZgiQmze3qFLoNWsGKIlTvyF IQ8g== 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=0AZ3LfYwwbdgd8+Gj6pfmGUhFDqMfSzSNioVUGjPTRU=; b=kL1XvT21ecZTbmjfhcwgA+sUODF9rVGdZPqBuUj64PbGSj0az3FmPUdg7B68eAOZj1 Kq9b4snw9lTCOXFrpmW/fOAE0WiJt1ArmMHVkxrm/RyGnW/TygvPZtnMV4EUNEF4kPo8 JPka7lnwl2tsr8RSqYTRAQymoHlWkR4iD/2v+4YlUJkVHaNnxtpg90U7Mo40j2f3oDfd 462xUhq6Un6tzfqwLfwqTIRVl0XA6FS0nra8MQ0nj3ISh/GOrKnUhy85NjF/bBb+CcWl WNNLXpT/NTOEPffgGoi/x18pLkPkOZ6GDSrCmgDde1/VPHpuveaHhQFA7zH+SP0OuIgL 0K5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=VBDSp624; 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 g20si727148edm.43.2020.04.23.00.58.48; Thu, 23 Apr 2020 00:59:12 -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=VBDSp624; 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 S1726324AbgDWH5b (ORCPT + 99 others); Thu, 23 Apr 2020 03:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbgDWH5a (ORCPT ); Thu, 23 Apr 2020 03:57:30 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60F95C03C1AB for ; Thu, 23 Apr 2020 00:57:30 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id n17so3998377ejh.7 for ; Thu, 23 Apr 2020 00:57:30 -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=0AZ3LfYwwbdgd8+Gj6pfmGUhFDqMfSzSNioVUGjPTRU=; b=VBDSp624eeG5DG/gndTNaHMLvSdjtkZwVvqIk0HLfICAWTd3DdqJGCOdF+j3ZkiaF6 OkJMkZajYDgkASdTcGVDQrKBArkOd3uXBgFTNPbyeCHS2d5P8A4O/ddQo/nRm1J/P6HS 8YiyHoRzIG8e5maMV6UFDTwGB3oaF3TD+HG1c= 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=0AZ3LfYwwbdgd8+Gj6pfmGUhFDqMfSzSNioVUGjPTRU=; b=Mpysj5luRhSxJ2gXNohrNPmH0OOJk0n09pe8SLu7tJ3JmXgWXhacS9e3vh9g/0ZDga fcWJvRAKoQi/PZqOgNIl9c2A4mqGKvaFcNUMIG9+RKMk+jT5vJvzCV+xtO89NUq4E6F6 Y6rsVHSRwlpeLNtQ7wX4dk/DijV6i+JGYXeXjAZwt2R3tMpXx+T+b+j+Guo5Xqi17k7C l8SqEBNixPiVk7tlGRNPT/0VpVTwV1QCa0Zk9hW4q7qYpdBW8ehMpIx6P63QsQrFEtPr DSlOZUzaZdaQ6VOsntLaPHpQ3tjMytGDyRGGyEwEUGKMnST30ySNrqunZDUetsGwuzRE mRrw== X-Gm-Message-State: AGi0PuZZOOllzlS0U0y/I3DztEUJ4CidO1zE0d6imX4QJ7ADgca9m3hn vgLQFYc93uWYFlwWMtrJy7R7PP+G7rE2pWegXRbzsA== X-Received: by 2002:a17:906:340a:: with SMTP id c10mr1706242ejb.218.1587628649150; Thu, 23 Apr 2020 00:57:29 -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 09:57:17 +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: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. Thanks, Miklos