Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp19981ybh; Mon, 20 Jul 2020 09:21:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRC1OeW4wHzaFvq/SKuZhujTg6VKO8k16Tt+tIOxum7mMD0gvc5p7dx6CeK51frLXNsn/Q X-Received: by 2002:a17:906:c41:: with SMTP id t1mr21395553ejf.18.1595262086883; Mon, 20 Jul 2020 09:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595262086; cv=none; d=google.com; s=arc-20160816; b=E0aeGYIP+i4GrzHauxJgGqA/Y8wzku/0orgvi/XF5Uq1CrJ5+YuNiKF5HQJKY0kr+F M8ZJ3/LM7I9vdis7cpACf9dXoEDfc4nGbHGt6X/YwSxift6WEZyjb5VPwbtVRBseGf0u mmwa1hoXl2fPThvmo6VOMVjYj5GZMaPeusqFj1L4gdHX99QzkcHM3Gm5ZjNDxXI0mbAb i0WlrgtLu9It4z9dfqvxcMi5LQ5Qd7cApSmwIflclojiNr+Mc/5sweUyhpfO+qAkzCSA PZrnkY2TbqHgrTlQyeomFrT0yPe3/y4rvSKPoRm43CNKOZn+3zYx/xj2O2KdM/uEVDT9 IsNg== 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=BYqUr1CXn/LWbIDpCFv95fWgX/X0sTMN+KIEoKgBT9g=; b=p/5xX40DAX640OF3WbCn9zZIfE2sGq3tNactjz5N4QmQtvHuap9hpMP447e1mSh8YJ Pd4+hqLGMil5ogLRc0fxeoP1ME7CwN2oT3Yoe7e4kCdDqT47JZCuA2DEOYk44iduxKvn Z1O7zQaepPDkepzspHCJn/eS3vLJ1C0IMEz0tpZrjNsQnTRoJ5LM/k6fIEogrjScJpgT oKT3klyG1NliCRPP1PXjanQRajyoPRWvTyxZWtctDA2xYxSR9jEB6X+Ix29ip4BnaiIx aK4yc+IVcv9LQHXBlVRJm4aKqfI4hEXxvo2RoYSntL1Cinh8USMkAQpkdvEO96cIMEJB zTew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=BQchVYHn; 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 r9si10666881edm.321.2020.07.20.09.21.03; Mon, 20 Jul 2020 09:21:26 -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=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=BQchVYHn; 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 S2388531AbgGTQTs (ORCPT + 99 others); Mon, 20 Jul 2020 12:19:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387796AbgGTQLY (ORCPT ); Mon, 20 Jul 2020 12:11:24 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FD86C0619D2 for ; Mon, 20 Jul 2020 09:11:24 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id a12so18147055ion.13 for ; Mon, 20 Jul 2020 09:11:24 -0700 (PDT) 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=BYqUr1CXn/LWbIDpCFv95fWgX/X0sTMN+KIEoKgBT9g=; b=BQchVYHnt5hj8+P/O/cuHxnVgddKs3pyZkKWOh5J6SMY22W8AJIRR7krPhr7M7MXnj F/Ud8Kh7hO9fD5nZqhlkBEhQ1vbil0jhOjxHGgwDmlBVPKvjaDigBtOKE8QVJWWma3YK FlHwdEORKOaiKW9zaO6h4COzjoDdLYQxOyblL2GwPQrgn9ZTQ4+XuwbIbmW9g3p8aiDK tpIkINkuVtBf8AMJPqGcpNXTv0WxHFoefO2WZ4PV2+4aGmW2/TCD7g6HAsLmpsY9fyIa hP6f9DGDYQzeYc7FsKqwRQJDyJjZN+mGL4lS3RW7yn9+ECZVrmhW6XzvFHEGYjvXM8YX P6Jg== 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=BYqUr1CXn/LWbIDpCFv95fWgX/X0sTMN+KIEoKgBT9g=; b=T5fEW+qptqUVfdX2okdqNo266ad63KTNIhMKSau8B2tTd4UcGJk2Af+1I8zCQRAP8B fj8/1Ip3eO2DoLLmHpYHk92IuPoOdwqP5xr3GOPN5YdXsR1c4iRrHZAXdmh2pVZxwUOm X8QlGL/8wuzpDKhHaUgJwC9Tb1YTRCxwVYS8fi3eCgvsb1iTJkx79uKawqTOnX7bSozv 7DTmVDXTZyfdQhOoYqf3VsZuXDCcCPz4tSF8NyCGbYEnN64iyT0p5n6nLXfOImRNQiGQ WN7btul667PEnxPgMKCn/hXX+TB2chbKQOz+MVutn+F0EONpFUeXBYFHoiGWPeT7zK6R lx4Q== X-Gm-Message-State: AOAM532sB4jnn8cq6pgRJGbGXNd+csqNZ6/Er32Fy55mR5QUmqWW847N vsBrtvYd3tp7bt0Jya+hkfBgkOCoHvu/OA== X-Received: by 2002:a02:694c:: with SMTP id e73mr27185708jac.17.1595261483087; Mon, 20 Jul 2020 09:11:23 -0700 (PDT) Received: from [192.168.1.58] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id t7sm9034365iol.2.2020.07.20.09.11.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jul 2020 09:11:22 -0700 (PDT) Subject: Re: [PATCH 0/2] task_put batching To: Pavel Begunkov , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org References: <5b20b94d-13f7-66ee-610a-6f37ec8caa8d@gmail.com> From: Jens Axboe Message-ID: <35740763-8123-a0d7-3cc6-593c7fcc63e7@kernel.dk> Date: Mon, 20 Jul 2020 10:11:21 -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: <5b20b94d-13f7-66ee-610a-6f37ec8caa8d@gmail.com> 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 7/20/20 10:06 AM, Pavel Begunkov wrote: > On 20/07/2020 18:49, Jens Axboe wrote: >> On 7/20/20 9:22 AM, Pavel Begunkov wrote: >>> On 18/07/2020 17:37, Jens Axboe wrote: >>>> On 7/18/20 2:32 AM, Pavel Begunkov wrote: >>>>> For my a bit exaggerated test case perf continues to show high CPU >>>>> cosumption by io_dismantle(), and so calling it io_iopoll_complete(). >>>>> Even though the patch doesn't yield throughput increase for my setup, >>>>> probably because the effect is hidden behind polling, but it definitely >>>>> improves relative percentage. And the difference should only grow with >>>>> increasing number of CPUs. Another reason to have this is that atomics >>>>> may affect other parallel tasks (e.g. which doesn't use io_uring) >>>>> >>>>> before: >>>>> io_iopoll_complete: 5.29% >>>>> io_dismantle_req: 2.16% >>>>> >>>>> after: >>>>> io_iopoll_complete: 3.39% >>>>> io_dismantle_req: 0.465% >>>> >>>> Still not seeing a win here, but it's clean and it _should_ work. For >>>> some reason I end up getting the offset in task ref put growing the >>>> fput_many(). Which doesn't (on the surface) make a lot of sense, but >>>> may just mean that we have some weird side effects. >>> >>> It grows because the patch is garbage, the second condition is always false. >>> See the diff. Could you please drop both patches? >> >> Hah, indeed. With this on top, it looks like it should in terms of >> performance and profiles. > > It just shows, that it doesn't really matters for a single-threaded app, > as expected. Worth to throw some contention though. I'll think about > finding some time to get/borrow a multi-threaded one. But it kind of did here, ended up being mostly a wash in terms of perf here as my testing reported. With the incremental applied, it's up a bit over before the task put batching. >> I can just fold this into the existing one, if you'd like. > > Would be nice. I'm going to double-check the counter and re-measure anyway. > BTW, how did you find it? A tool or a proc file would be awesome. For this kind of testing, I just use t/io_uring out of fio. It's probably the lowest overhead kind of tool: # sudo taskset -c 0 t/io_uring -b512 -p1 /dev/nvme2n1 -- Jens Axboe