Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A01A030CDA5 for ; Sat, 30 Aug 2025 02:18:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756520322; cv=none; b=qLCfbrqd5habvQufosRpshz6JkMWFiF/+0k3pdL1RhaPcs5mbP9GH7oRqvFvRrGgUqDxAwSQf/VKCThaCfdWhqK69RbwNiWYB2dKYv49lk47vsjeMQy9HUPkdwAnQ8lhPEASJqV0rKe7Kz4p+06PSQ45N602hB1UiWoKI31pdbg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756520322; c=relaxed/simple; bh=l537mO/COp4WjDTlH55oOLtqTRPUvyZZv5YzLsam+XY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Bu4AJnzuRusmGRLaceqTVOz6Y86XdtYD1wcu06HwakD/0IwjVt4meIG+pUfahsrOEuiSlmd8ETfx5iNcC6C3P7phO0ZAp0VR9vcriOCef4JpllpqmAG8bMzf80+cmF6APZLakZT2eEKgVqvaGnQY+wxfXgNiZLhTa0x3TCujQDY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BZO4fymv; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BZO4fymv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1756520319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=DfGmeYuogDgqtgmLLzzTyFT2WUbSxG87WkGoP1dy79k=; b=BZO4fymvb+yaoI6Lts6g7TMevNipNKqGBLfmscFBAyj6pv8voMyDLIScKXmZNwExGhVAUg ccY81SIU83Jlu2mRGkfdW4JV3x4N9b4hIirPZUqsDwr5eXHEhohWCZ/lbtfQfbJhhp6T6C Te6boa8ucHZtsKOXxJiiM59gg1tepdM= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-292-vewYtIZCNluH9UjbU3mNkw-1; Fri, 29 Aug 2025 22:18:35 -0400 X-MC-Unique: vewYtIZCNluH9UjbU3mNkw-1 X-Mimecast-MFC-AGG-ID: vewYtIZCNluH9UjbU3mNkw_1756520314 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C63C51956087; Sat, 30 Aug 2025 02:18:33 +0000 (UTC) Received: from localhost (unknown [10.72.116.21]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 893D030001BB; Sat, 30 Aug 2025 02:18:31 +0000 (UTC) From: Ming Lei To: Jens Axboe , linux-block@vger.kernel.org Cc: Hannes Reinecke , Yu Kuai , Ming Lei Subject: [PATCH V2 0/5] blk-mq: Replace tags->lock with SRCU for tag iterators Date: Sat, 30 Aug 2025 10:18:18 +0800 Message-ID: <20250830021825.2859325-1-ming.lei@redhat.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Hello Jens, Replace the spinlock in blk_mq_find_and_get_req() with an SRCU read lock around the tag iterators. Avoids scsi_host_busy() lockup during scsi host blocked in case of big cpu cores & deep queue depth. Also the big tags lock isn't needed when reading disk sysfs attribute 'inflight' any more. Take the following approach: - clearing rq reference in tags->rqs[] and deferring freeing scheduler requests in SRCU callback - replace tags->lock with srcu read lock in tags iterator. V2: - rebase on for-6.18/block - add review tags Thanks, Ming Ming Lei (5): blk-mq: Move flush queue allocation into blk_mq_init_hctx() blk-mq: Pass tag_set to blk_mq_free_rq_map/tags blk-mq: Defer freeing of tags page_list to SRCU callback blk-mq: Defer freeing flush queue to SRCU callback blk-mq: Replace tags->lock with SRCU for tag iterators block/blk-mq-sysfs.c | 1 - block/blk-mq-tag.c | 38 +++++++++++++++--- block/blk-mq.c | 87 +++++++++++++++++++++--------------------- block/blk-mq.h | 4 +- block/blk.h | 1 + include/linux/blk-mq.h | 2 + 6 files changed, 80 insertions(+), 53 deletions(-) -- 2.47.0