From patchwork Wed Oct 20 20:03:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 12573279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CB10C433EF for ; Wed, 20 Oct 2021 20:03:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 18E726128E for ; Wed, 20 Oct 2021 20:03:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 18E726128E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 33A21900003; Wed, 20 Oct 2021 16:03:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E86C6B0078; Wed, 20 Oct 2021 16:03:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FEC1900003; Wed, 20 Oct 2021 16:03:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0116.hostedemail.com [216.40.44.116]) by kanga.kvack.org (Postfix) with ESMTP id 0CE0C6B0075 for ; Wed, 20 Oct 2021 16:03:26 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B67472DEA7 for ; Wed, 20 Oct 2021 20:03:25 +0000 (UTC) X-FDA: 78717890370.31.5D8C3BD Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by imf25.hostedemail.com (Postfix) with ESMTP id 5562DB000180 for ; Wed, 20 Oct 2021 20:03:21 +0000 (UTC) Received: by mail-wr1-f51.google.com with SMTP id u18so654494wrg.5 for ; Wed, 20 Oct 2021 13:03:25 -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=aJs761PIZHA/yQrkxYR0H2JI0nZrSlRKQ+QXU0IoUbA=; b=E5lEyRk0SI0GaN1hNyuOKFhy90A37dGMRYW9dJGiPzvYhS3VJFVFKUSv4mS0bU14tW 1qQpAEhOh2noHu8C0vDRCApJJCPsvI4xF86GD/8FYsK8DgL0YxXp7QCuJoswxcTaFZjA OcQGruxyCuSZZxtwcIX4ezT1hf1XRqqShRQPxP+9PvMQtctoLAe/YA1KIYfw18xC3eqI W1IOCTf5K8NmHAS+Csl7bG0EQYADDVbv+eef8IpmvLByw3kQruusrIvABcjhqe+Ri9gO NPknaHxOPG4zKvyuoLeXMUy2/L4KmYDpXsnI54yG76DTx3kj3zO9mCVkm+vw2BmPP3NY u4Ag== 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=aJs761PIZHA/yQrkxYR0H2JI0nZrSlRKQ+QXU0IoUbA=; b=scEFPtyHMWv5GrQcAI113XnQYMAjTNmFKaFblO7ily9AoinNzIZDVSAV0pa/loS8RE Rtiagt/bL1QpJmAFmk9Tsn6OmNR5DB9JfbcBbC07qyv7envYLYjFUaFWR8IC3vdZvXq5 TrLAjVK4IyfLZ6D01da4qX89CuVu+YH0YQnD3IY95KRtQflGmPcB9ZlFdASMvmdtJTNC OJYEHUL652qZjhM2Nqjia6+P8K4SBopufMx1SSDiXhVjtsAfjdnEgQOa43emtxicQjZk EYfmYCfho4e/YFBR+9o1lOUGxXM/5YQR/XAdG8OWMsYmw8SFoF6iBFWFPYuHrBuHptMW j1FQ== X-Gm-Message-State: AOAM531qvrLKVW3Go7Jh2Lprd5l5VRmWkLoBQEytaZXIsLIBoAV68OCw v/oCtiEnR7BtBAPkCb5YKqg= X-Google-Smtp-Source: ABdhPJy3VWjV7RWxxX3ABRwN4a8zHIkMBYKY2/89GnqyLE2t7QJc80rh8nEK3tGl/iFFYlwSiIV7Fg== X-Received: by 2002:a5d:4b8c:: with SMTP id b12mr1641206wrt.31.1634760204248; Wed, 20 Oct 2021 13:03:24 -0700 (PDT) Received: from 127.0.0.1localhost ([185.69.145.206]) by smtp.gmail.com with ESMTPSA id m14sm3600119wms.25.2021.10.20.13.03.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 13:03:23 -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 0/2] optimise blk_try_enter_queue() Date: Wed, 20 Oct 2021 21:03:17 +0100 Message-Id: X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 5562DB000180 X-Stat-Signature: 68kq3wck1k8jtt89jbdq93z4fxi98myx Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=E5lEyRk0; spf=pass (imf25.hostedemail.com: domain of asml.silence@gmail.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=asml.silence@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1634760201-274054 X-Bogosity: Ham, tests=bogofilter, spamicity=0.004314, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. 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 | 31 +++++++++++++++++++++---------- 2 files changed, 22 insertions(+), 11 deletions(-)