From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EE94C2D0A8 for ; Sat, 26 Sep 2020 10:53:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 506CE238E5 for ; Sat, 26 Sep 2020 10:53:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="LEko5i44" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726311AbgIZKxS (ORCPT ); Sat, 26 Sep 2020 06:53:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725208AbgIZKxR (ORCPT ); Sat, 26 Sep 2020 06:53:17 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AB76C0613CE for ; Sat, 26 Sep 2020 03:53:17 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id mn7so811643pjb.5 for ; Sat, 26 Sep 2020 03:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tHCYM+BiDqwtlNHehOh/PBH/KXQt1NJlXqit8LBZ04A=; b=LEko5i44A1vrMDGEEcBhEBlk7Oxr/ePiUfSH21KLjWHVBjIpE/IvLkbuEPpanjF5VO 3w7sx2w3yJhzIaffxslZ1PGfo6/L+HH/dcmvNPKC+KIaOkVk++8CnIXhwkVOAeK3tpKK egIbzK2RSBcoXu3KnmOUb49R61isNC3hgLwiWe+Pt6pw6/+5+P/SC5DxXxu3Vy2fK9Lc BbCmIESN9Xe/PrSGH73ketBLfFWWSxQc52y+YJEvihiveFvCHZgapwFP/XB+nMocR5kx pygTM9kuwS5MdpCTMYeIPw873zSazW4dCc6ziHEbplDrZbpnOpTR0Cj87kxqGTKhRXaS J5dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tHCYM+BiDqwtlNHehOh/PBH/KXQt1NJlXqit8LBZ04A=; b=eaRP297B0iphrROPK+IFmIPJ5tWPmOzzn7qFmQT+fgapy9YzqHEuF6RJIwEsGAQ9nj ZeZEgxYzP2Gwl14Sn7mevkCXT43YiA/7NOWr/MSz1NDSTH6+8aqFeoSFB8j+Lpp8nd2J XHyi5TlbUGWKNoONOy/6DIPWYLvE5ZAHOwFmXsAtJjI2sdRw6S6kHEr2/0HWW4+FUC6s U4Aqv2ZuQaXy6/+0ishmlIE5r72NEAFSMIEPTTfVTaxFkvw7TYvGzE8Dp1aBIYaSrDSH QO3dGWwAPZG0/koM9NzuijYDtANgI7acQSiVZWKLxkXwi62o1009tBarZqaNWpAsxb/+ Y0aQ== X-Gm-Message-State: AOAM53372yqyqlwg8E4whn99c+aPNLCfR5fzR5FFn8a2ITzjQOuIIcxW 9TIuluGec6sKNY6JokGPYwMsLVFM1tTl08JC X-Google-Smtp-Source: ABdhPJxsAsc19eKxKbQexQBXyLiF14clWxi8LjdBvNCUEznn8gLOujngqvqhpNQSnUlZJha2JV8qMg== X-Received: by 2002:a17:90a:d3cd:: with SMTP id d13mr1728730pjw.70.1601117597038; Sat, 26 Sep 2020 03:53:17 -0700 (PDT) Received: from [192.168.1.134] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id e10sm4826460pgb.45.2020.09.26.03.53.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Sep 2020 03:53:16 -0700 (PDT) Subject: Re: SQPOLL fd close(2) question To: Josef , io-uring Cc: norman@apache.org References: <9f1ac2d3-6491-bd5a-99ea-8274a8a19e2b@kernel.dk> From: Jens Axboe Message-ID: <46cda4dd-2f7e-67df-1757-3e7f087adf8d@kernel.dk> Date: Sat, 26 Sep 2020 04:53:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On 9/25/20 5:40 PM, Josef wrote: >> If you have a file registered, that holds a reference to it. So when >> you then otherwise close it in the app, it's similar to having done >> a dup() on it and just closing the original. So yes, this is known and >> expected, I'm afraid. > > Thanks for clarification, the only way to delete the file registered > reference is to use io_uring_unregister_files right? Correct, that's the only way to trigger the final fput() that'll close the socket (for real). > I don't think that we can support SQPOLL for 5.8/5.9, but at least for 5.10+ :) It'll be a lot more generically useful once we have non-registered file support, so I'd probably just ignore it for now for your use case. -- Jens Axboe