Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2364182ybf; Mon, 2 Mar 2020 07:13:10 -0800 (PST) X-Google-Smtp-Source: APXvYqz14tqEPWgGw0ENPk0Z6BvKGb82m22qdI39Va6lRXr73A87nEpNMd4rJWSOXwkEyNhrTXTw X-Received: by 2002:a9d:5e8b:: with SMTP id f11mr13835410otl.110.1583161989873; Mon, 02 Mar 2020 07:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583161989; cv=none; d=google.com; s=arc-20160816; b=tML3vKCMQvF2NzJfUGNbC13tjEBionoSMYnpSeRzbEb1He/VFVoPuKvCZw7MpVTNWo tx0EF879g3mJjhxbtADlPLjUKCn68nMJQaQIWU6romGtXuhIsrQEU59Dy0q65hvnCKk/ laehhghv73yfpEVSHBtuJUKM6IytPz9IWdUiviTjKrotGCT51hu5DBYAGbJW8khspX+0 qQbCrcOtwsEt+cdz9QILFpLXjRyUoQMj5cOtlJ41zNUHDD+t5FvY8NiPTa/ljJcnSjLQ M4BaTomCLUtNgODV3DbOTpY6KYTYm6rvXxnHzOkFg1Gmn9mhekz61f4A+7vaX5AyBV1M emUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=JM8qiDVf3FT7foBs7e7M/gWL0uo4r9RuZV/GlhvHF5E=; b=CQyquc4KIq7vZXUWrv/CdCXxL+/Alc6gdqHj9Y+JQ0x1RV6i4EgZ+FavUcrbAiV/zT UJfy6NJVkhdEZzTNEohvjfMjf3GLMmyL+3jQL6PeYVl0IpnBOjOJQAVixdfoxAGtDRGj mAO1Q9EQimLl0qwCDxUgMJik5RB+p8Ion5JclBcq7hQVfJYKvhBFG2F+gIWrz5Vvwr+t CsnmCwECAzZZMhfNToQo5iwhIA7HfbVdhpAnRJEr1fm0EwMkzhtL51o/VzIWelq5/DZx 3Cas1xOQzTGCUUy3DE5LjdjSV/FxlN7fR8lNpnK1BteOpGMmzDiaVgLloyNZ/jIXft94 5/nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=RJ3kAcKB; 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 m17si2640514otk.113.2020.03.02.07.12.57; Mon, 02 Mar 2020 07:13:09 -0800 (PST) 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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=RJ3kAcKB; 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 S1727366AbgCBPMq (ORCPT + 99 others); Mon, 2 Mar 2020 10:12:46 -0500 Received: from mail-il1-f193.google.com ([209.85.166.193]:47087 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727195AbgCBPMq (ORCPT ); Mon, 2 Mar 2020 10:12:46 -0500 Received: by mail-il1-f193.google.com with SMTP id e8so4926832ilc.13 for ; Mon, 02 Mar 2020 07:12:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=JM8qiDVf3FT7foBs7e7M/gWL0uo4r9RuZV/GlhvHF5E=; b=RJ3kAcKBZkXKOQ23jTtmHNMnviZkbOHwmdnJQM7EDtr4Ug0obmdJogZPtQ/cXCGFCq pSTmU/F5qbGUS612kjfeOdV1m6rTn73IaD91E7WDIzaH9QZE9xS7ktEWmjk1srPFISNl dI9H3Ma9desXp6Z9LLoLHXb45qednni9M4fv2BGXFbKeCxvpZXTu+BKKT76BFHZcrlcd /UNs++0q6p87N8s/bW/pIzvMeqPt/4+v5lkS+knJCEZcQ3bLufj9Me344alsQK35KHWp tZ+AfknlqtRF9Yxb3HJ4MngCjdxByLCgepY415ZiIGYs2TZfzDvV8jLKbpmISYnIgv2P +9CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JM8qiDVf3FT7foBs7e7M/gWL0uo4r9RuZV/GlhvHF5E=; b=EnEzGs1HqP2Dehggc8m4Ge7qT+VFkbBrFT8LAef+VqgmyBbqrM8ZYMe0mlAeZojSe/ qCDLL3G8PwJDoNpv8PRZ+AbM5jYk9dLv5r7wypDY0lzdt7KAGPE2b560LRk0wVn/6YM3 0lztvg3IIFmHn/JeD7puqT9y6Cq6SrP7juWDSTt4GPZoM7knSMTTAmyZkNyprGiOUkki KDdHP4EFnfgPxUb27jbkB6tanyPaSMa8gQmgIM63nyZtZFPKUM1aOyrpkJgTFTdvYCfU 9HA6liJ4yMsMHLm3jWkRpx0HoKSnQeq7w6hprFwOVS8n9iGxfltY9+BpFc+g5tH2TL/v YqmQ== X-Gm-Message-State: ANhLgQ0pxKSiNUYHNHTYHlACRA3lEC3CdnbfcqxdN7aF+q3DgPhHXUWu 7SD+gsBJKlcrCEpXlznS/1J2aXkk+O0= X-Received: by 2002:a92:de03:: with SMTP id x3mr112262ilm.146.1583161965402; Mon, 02 Mar 2020 07:12:45 -0800 (PST) Received: from [192.168.1.159] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id y4sm1345506iot.42.2020.03.02.07.12.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Mar 2020 07:12:44 -0800 (PST) Subject: Re: [PATCH 9/9] io_uring: pass submission ref to async To: Pavel Begunkov , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org References: <29efa25e63ea86b9b038fff202a5f7423b5482c8.1583078091.git.asml.silence@gmail.com> From: Jens Axboe Message-ID: <902c439f-81ff-7593-e6b4-eee3f217c292@kernel.dk> Date: Mon, 2 Mar 2020 08:12:44 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/2/20 8:08 AM, Pavel Begunkov wrote: > On 3/2/2020 12:39 AM, Pavel Begunkov wrote: >> On 01/03/2020 19:18, Pavel Begunkov wrote: >>> Currenlty, every async work handler accepts a submission reference, >>> which it should put. Also there is a reference grabbed in io_get_work() >>> and dropped in io_put_work(). This patch merge them together. >>> >>> - So, ownership of the submission reference passed to io-wq, and it'll >>> be put in io_put_work(). >>> - io_get_put() doesn't take a ref now and so deleted. >>> - async handlers don't put the submission ref anymore. >>> - make cancellation bits of io-wq to call {get,put}_work() handlers >> >> Hmm, it makes them more like {init,fini}_work() and unbalanced/unpaired. May be >> no a desirable thing. > > Any objections against replacing {get,put}_work() with > io_finilise_work()? It will be called once and only once, and a work > must not go away until it happened. It will be enough for now, but not > sure whether you have some plans for this get/put pinning. I have no further plans there, the get/put work only exist to ensure that the work item stays valid in case of cancelation lookups. -- Jens Axboe