Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4574231ybl; Sat, 21 Dec 2019 09:21:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwhyBRBdMkxWQG17HVqMcgvn8Bx9NRj3aaIGJM549bgVOfSiKXxhYWQsl76Mx49A299CN1L X-Received: by 2002:a9d:7b4a:: with SMTP id f10mr22942744oto.4.1576948900508; Sat, 21 Dec 2019 09:21:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576948900; cv=none; d=google.com; s=arc-20160816; b=wKqG0yeyenbzEP+MeYNxyuk4PDfQzHhavCbesR2GPN7rbV0KJ5yHJY7Rfs5W/RbY80 NNQxSi/7leAhgBft08Gq29DFLdkGiKE1dNY24oUgqzE9UAdW29/GDo+HldbFhWxkZTW9 i7dcmkx9rpQq28VqDQnsc472qYkm1+Qf89BEsML3clUzUViEi37giRdKi0rvFEVoYS2T k7XnwZdzRbachxOuGsEJ/c7yh3LKNQ0GCdhh1RXZviuPOdn2w1PXghdfyOgf9ZHf07yF X5C8RB5XfrYD3CyjNxHyMzZV7BiP0BuxCbD7PJOUlL9yAPRzGeCPTf57vhqB5fZx7JMY BlzQ== 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:cc:to:subject:dkim-signature; bh=FFdVAvdSfIfaMK6QeKBxjHAHUu1BybZ/Mc92Cm10RCM=; b=cF7MT6z+u8Q1WtBrCPutYS6r36bPgCUlwYloKTXRZnprWW3un1tdU/VraxeRlJp1r7 vTkbYJxxA+B+z9FChm8TGZzA+NyzlYKpxOEZrtt+sxgeYK1MgLhv+t4QL0opQTVqsl8I YzIDc/O9YvE+3y4Tw2hFAgo5iEwNwsE7c/0H3uejpfIoSEL9VFp1LGvRGvPlMNxws8Qu 5896/D6sjEF1EBeQJCv8S4eooBn5LFnz3+vUjTmzkwpPbaEs4XUJrBfqFY0Pbx850GtP kmTcNIR5nNMe8CO7+FgvKpSAPyCB/Q1fknEeCBFbVQZNsz6Y9N+gf33KVKrOAp+V0vZJ tq3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=qc1zHw+V; 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 k2si7181652otb.272.2019.12.21.09.21.19; Sat, 21 Dec 2019 09:21:40 -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=qc1zHw+V; 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 S1727015AbfLUQic (ORCPT + 99 others); Sat, 21 Dec 2019 11:38:32 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39444 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726107AbfLUQib (ORCPT ); Sat, 21 Dec 2019 11:38:31 -0500 Received: by mail-pl1-f194.google.com with SMTP id g6so2486217plp.6 for ; Sat, 21 Dec 2019 08:38:31 -0800 (PST) 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=FFdVAvdSfIfaMK6QeKBxjHAHUu1BybZ/Mc92Cm10RCM=; b=qc1zHw+VW6fvtAdMa1rHvDqyDHNd7+Q+Y8y+wIrl7sk+MgQnejY+fIYMCUcSeTd7TC KTJhjPoRPafvuFIwNcCRbVP5ljKF+ZjNubeTXRtUYK51TGUAze1oEf3lu8wW3o6G6j5G +T/cnQFh042QJrG0cDWnoXEfqb6fi2LlSGso2e203JfGnk3Byl/lNlgBIZ22xbCSVoOV bws01i7D+G1Ux8T5IxBEYuGLoquSF3r1CONYX1YA2/kfEfK2fuM49aJIknkZYHwSw04z ZJMcMixdpg3Ms3It1fWIkBqo0lWRH9H1S50tulab9b9DycNFGC8bbBzCYPzXF31nByfA VvTg== 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=FFdVAvdSfIfaMK6QeKBxjHAHUu1BybZ/Mc92Cm10RCM=; b=d0o4aZIiC9woWU2kGjRIcwudE6WqEmjPcpSoYD1MnhB3Aj8XL+4D6GGH/E8wK51fav sfbgXKXDipKyTogCkHhVeUcU6shEU2XoTyVjCuLFjBsUGuDxosV3Wmd7kORG8BfYp55u yGmfpqFVt+0TibdhCVfMaX3buqKFJRChWA625o/kVbOcn1OdcLB8Hyz19FrLiEvqibbP 0uHZaYW3YBI8v/H8bhTHcKk5QqW8HU39I6rph8O7Id98nYyHaaPYbDnP+ek+PInX12Ul jmKsm3sFDZXAmm3tBQzHm0wauqeWx6lYjFLRk2+4m9mXD13FfIcI0QieZio1O4xn66i4 zgbw== X-Gm-Message-State: APjAAAWKP2y2OKzscLtW+gmRY+WesgIXt6Hez5U4YpuwxYzOoDTjWxJw yKmDlBEcYpEqmzCyqGKegDADWg== X-Received: by 2002:a17:902:8547:: with SMTP id d7mr22316607plo.44.1576946310927; Sat, 21 Dec 2019 08:38:30 -0800 (PST) Received: from [192.168.1.188] ([66.219.217.145]) by smtp.gmail.com with ESMTPSA id s11sm6925925pfd.157.2019.12.21.08.38.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 21 Dec 2019 08:38:30 -0800 (PST) Subject: Re: [PATCH RFC v2 3/3] io_uring: batch get(ctx->ref) across submits To: Pavel Begunkov , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tejun Heo , Dennis Zhou , Christoph Lameter References: <925d8fe5406779bbfa108caa3d1f9fd16e3434b5.1576944502.git.asml.silence@gmail.com> From: Jens Axboe Message-ID: Date: Sat, 21 Dec 2019 09:38:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 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 12/21/19 9:20 AM, Pavel Begunkov wrote: > On 21/12/2019 19:15, Pavel Begunkov wrote: >> Double account ctx->refs keeping number of taken refs in ctx. As >> io_uring gets per-request ctx->refs during submission, while holding >> ctx->uring_lock, this allows in most of the time to bypass >> percpu_ref_get*() and its overhead. > > Jens, could you please benchmark with this one? Especially for offloaded QD1 > case. I haven't got any difference for nops test and don't have a decent SSD > at hands to test it myself. We could drop it, if there is no benefit. > > This rewrites that @extra_refs from the second one, so I left it for now. Sure, let me run a peak test, qd1 test, qd1+sqpoll test on for-5.6/io_uring, same branch with 1-2, and same branch with 1-3. That should give us a good comparison. One core used for all, and we're going to be core speed bound for the performance in all cases on this setup. So it'll be a good comparison. -- Jens Axboe