From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from r3-24.sinamail.sina.com.cn (r3-24.sinamail.sina.com.cn [202.108.3.24]) (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 41C6D1DA62E for ; Wed, 11 Feb 2026 00:21:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.108.3.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770769295; cv=none; b=YQdd+4n2OX95ZzL4dSEYeLupPGHP6byPUk9/4i9sGYz0MpEPtNTK0H8Pt6x3XLFTwriQ6V5icioC4hUH4XDjwXrc/2E5uJU/QGPVKfAFk52ol4tFjjHkS/es2PDJoMQg6iD6R9fLOyXlQgG5ztaY0TvdEq62S7tk+wotdrVTe/Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770769295; c=relaxed/simple; bh=ju5P6MSCRAendyS2SYVIhbA3tQky8z9n3jLbBjeZ/zU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I8vPoSzJmo5BSRJqcPcKNZVFjUi9re+Vh7NTlPpFSPOHtI5kEJpikJv8nFQv2Tcjjj8T+8qlvghCWPWOJniLu8sFQpsmLeSEk3gowXL5YXaV3IhZbuDtf/Ss8Iz9fMqetcb2jJ5Icb8gnMHIvP1KQ5LY5s00KKMUCQsNnIezSKU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b=WU4HnFUe; arc=none smtp.client-ip=202.108.3.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b="WU4HnFUe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1770769291; bh=RW2u9FblXw/99dFsoyPShyFu+/Svaln1D1IAhqA6bAw=; h=From:Subject:Date:Message-ID; b=WU4HnFUeTxdIM4b7647ME3AtlCkUQi3DfnSmmrEsIpT9JzQptYB0p6daakHEByX7t bunc1TnPUlI+ivb54I8zx9rKbXyVGzATL9JcOks1raoIeSDyMpMtFtZMgf/TlWobQg wTUJmEB/iJGNpmCUzHFAevAEywrmV2ju9ZqFlDm0= X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([114.249.62.144]) by sina.com (10.54.253.31) with ESMTP id 698BCAF50000053A; Wed, 11 Feb 2026 08:19:03 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 9897336816036 X-SMAIL-UIID: 1BFCAC35E8DD46D0B5890F59211E6431-20260211-081903-1 From: Hillf Danton To: "Ionut Nechita (Wind River)" Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, bigeasy@linutronix.de Subject: Re: [PATCH v2 0/1] block/blk-mq: fix RT kernel regression with dedicated quiesce_sync_lock Date: Wed, 11 Feb 2026 08:18:49 +0800 Message-ID: <20260211001851.2821-1-hdanton@sina.com> In-Reply-To: <20260210204943.21709-3-ionut.nechita@windriver.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Tue, 10 Feb 2026 22:49:44 +0200 Ionut Nechita (Wind River) wrote: > Hi Jens, > > This is v2 of the fix for the RT kernel performance regression caused by > commit 679b1874eba7 ("block: fix ordering between checking > QUEUE_FLAG_QUIESCED request adding"). > > Changes since v1 (RESEND, Jan 9): > - Rebased on top of axboe/for-7.0/block > - No code changes > > The problem: on PREEMPT_RT kernels, the spinlock_t queue_lock added in > blk_mq_run_hw_queue() converts to a sleeping rt_mutex, causing all IRQ > threads (one per MSI-X vector) to serialize. On megaraid_sas with 8 > MSI-X vectors, throughput drops from 640 MB/s to 153 MB/s. > > The fix introduces a dedicated raw_spinlock_t quiesce_sync_lock that > does not convert to rt_mutex on RT kernels. The critical section is > provably short (only flag and counter checks), making raw_spinlock safe. > > Test results on RT kernel (megaraid_sas with 8 MSI-X vectors): > - Before: 153 MB/s, 6-8 IRQ threads in D-state > - After: 640 MB/s, 0 IRQ threads blocked > Because the top waiter is allowed to spin on rtmutex owner, the D-state irq threads are expected. OTOH raw spinlock offers nothing for top waiter, which is the extra price for resuming the throughput.