Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp627824pxb; Thu, 21 Oct 2021 06:32:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7GjdcwTJ/43153LyEzGiCTrBDrvTBOBW2H7cmljf/ZSeU50DCAc2xaGcaylbGtynTC9RY X-Received: by 2002:a05:6a00:1346:b0:44d:242a:8151 with SMTP id k6-20020a056a00134600b0044d242a8151mr5959222pfu.62.1634823142245; Thu, 21 Oct 2021 06:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634823142; cv=none; d=google.com; s=arc-20160816; b=MBSlh+4fvrJu/y80/oFNVTORsOSg5CkduUAtSK7m1ZkbaJbWnlSPjvCKTfMOHdiVmm PkX4lL2tWRkVMeTAHdXF9TgH+d+LANyhC97kEpprZDPrIKNlrGlOzR6ItwVRu4IJVFa6 1beDuP4rJXrOlq59C2X7+R8OUHRwERbYVZwzjn1xB6XMWqDQsGGKXO1r+Gpgxd86PTO8 K4Gz2s07fQKUBQ0K/rcvqPDj2T/txyTPDfhBnP1nWpWlzcNYLIX7yFZf0rlwJIepd+5Z OfF5pW/LuCJyQARWzk8VfRUxMqqAcBWYrjYJ0NKvImqkXRp74fvYWqM+s40m1W4KYK51 rlJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=3+0W4a7ajc/42At+/XY3zEOp2xDA6GsLU+vihGYQJjI=; b=Llq/G1rEGrXg08xA0nD4q0gip0DUdee2ngiX6/aqG24OPhitr6DDb46mbEAejHvciX EhJOYFuQj20fgN8sHzy6kuWdNM3wsKG9lC0ZbocIWjDZzFW90bwPMa9smEr9y0gp/5g+ VW9rqByYqr1F96+RBivvdQ9K1kGd3y/VmsIAXh5yUpUogJ070+uuR+5S9oDS11uJcFTr WK6lmncJhdLijyik21n/2J5nk5Cc/E3xeffjN3BDe0+a/KVwvoOt0wnQfkVoMmHnsKSp GcjaMFPXfUQs4jpJR9yYMYZRtsdDhsvKZuheZ3rU0TP+vFmbCJVKYz6DYAiyF3BSyp8U CATg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GM6vEvDi; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si8369482plx.300.2021.10.21.06.32.09; Thu, 21 Oct 2021 06:32:22 -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=@gmail.com header.s=20210112 header.b=GM6vEvDi; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231503AbhJUNdO (ORCPT + 99 others); Thu, 21 Oct 2021 09:33:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231182AbhJUNdN (ORCPT ); Thu, 21 Oct 2021 09:33:13 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CD29C0613B9; Thu, 21 Oct 2021 06:30:57 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id e12so1146779wra.4; Thu, 21 Oct 2021 06:30:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3+0W4a7ajc/42At+/XY3zEOp2xDA6GsLU+vihGYQJjI=; b=GM6vEvDiq18fZTt/3BWPB8rL8xabNUDF7bvLouAZs+L4s+RL1SMqSH2p6migRbiJGj VqqznedHEpvspyDHA+J4EPPv0ZW7dYj9AP057Q6R6N7OxOiHuSK1+ZiPmqlsLct9sZMx Rp3FlH53+Be9eLmc7MAzO2Ar4Vr79mf5Jw18lCAtdczImfnubYQrRbWRar4g8t7rt2ak xKHmh790AB0pGslHQeYVpCn80eW9KCLBWX47FXPkdQ79u8rj1hWSiOM0UFMQc3a6j2Bj sARADMc0d2eyJ8PcgFIFLF8Kdb6KwzIUA9yyuj+SgeAj7OQpNld7/VnK2s3aj4id41gg D4SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3+0W4a7ajc/42At+/XY3zEOp2xDA6GsLU+vihGYQJjI=; b=Oi0gUpvi7YlAEQn+sD/D6RG6o3O4FWAR7E6eO/mcN5jevnZeAJu2OJnt2LFxlHmoff X4zWZtI6Rq0SLafsHnLxYI0G0HrxVnO8dxX9dDF9CHoIxoWCsELJ35jtK2FQhfgx+3vH 4BxFNeJ+AA/rdgsAS/ElqXiEC+83kPMsp8wXcC6QtxhLQhtYI0BFeBHvRSRvc+wzd/fW Z0WeExHCvvgdHm/0L+FhiRij0RpGAYlgmm9/Z4nfY/3Wt5q1xdxuDdBlS/Dp5Rwbx4LU 34QBeE1ymS6CgBkWGvpid1DBxqFUeoCJG2BNe4jH1e8C4H9HwIAAGQo+cGWfzvKivY34 KB0g== X-Gm-Message-State: AOAM530Mv7Z2lllmQubLXkV5tVz2hrMk6/VbNg9Nq55PN365kX9flYTE dxQvqSAJKACMFyXrvdV4SDXHDeZvZ3MdCQ== X-Received: by 2002:adf:ee8b:: with SMTP id b11mr7172855wro.349.1634823055644; Thu, 21 Oct 2021 06:30:55 -0700 (PDT) Received: from 127.0.0.1localhost ([185.69.145.206]) by smtp.gmail.com with ESMTPSA id q188sm1753987wma.1.2021.10.21.06.30.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 06:30:55 -0700 (PDT) From: Pavel Begunkov To: linux-block@vger.kernel.org Cc: Jens Axboe , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Christoph Lameter , Tejun Heo , Dennis Zhou , Pavel Begunkov Subject: [PATCH v2 0/2] optimise blk_try_enter_queue() Date: Thu, 21 Oct 2021 14:30:50 +0100 Message-Id: X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kill extra rcu_read_lock/unlock() pair in blk_try_enter_queue(). Testing with io_uring (high batching) with nullblk: Before: 3.20% io_uring [kernel.vmlinux] [k] __rcu_read_unlock 3.05% io_uring [kernel.vmlinux] [k] __rcu_read_lock After: 2.52% io_uring [kernel.vmlinux] [k] __rcu_read_unlock 2.28% io_uring [kernel.vmlinux] [k] __rcu_read_lock Doesn't necessarily translates into 1.4% perfofrmance improvement but nice to have. v2: rcu_read_lock_held() warning (Tejun) Pavel Begunkov (2): percpu_ref: percpu_ref_tryget_live() version holding RCU block: kill extra rcu lock/unlock in queue enter block/blk-core.c | 2 +- include/linux/percpu-refcount.h | 33 +++++++++++++++++++++++---------- 2 files changed, 24 insertions(+), 11 deletions(-) -- 2.33.1