From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2415530648A for ; Sat, 20 Dec 2025 11:03:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766228590; cv=none; b=X6i/1Krb2YLWTK2YEJ6APWZIQVLTJIem1N2erhydI29R5TCexYLIr98gxm7N9qraV/ISNjObw7gQxMnc++pYTIW1GzNCZMWxsQGiF1CTXUM3qnjEt1fJtt44PqcGFYipldpspucyETdQgsagYF40H4EGO89RqaajIbf4FngM6cE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766228590; c=relaxed/simple; bh=X63UHz0qWW55kaT+C6+HLfCvDytNqyZnVYp33HW2dWQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mxd7PkPxYtgasU/GmWIi8nkm/V8jvRQYbMFRtto+hqHSt9SbfR37aAt3Z2BBDloO34Qp4tIL0oqJ2K+niyjd0qMK2/XRpyFhe9qElid06FJnMBsxX+92SbH+kDSLxPP5qemZs54V1oHWL4VyZBT3a6t1Yk/GqgM7zG4BQPJdquA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lBXcdwyY; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lBXcdwyY" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-7aae5f2633dso2570116b3a.3 for ; Sat, 20 Dec 2025 03:03:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766228588; x=1766833388; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Tdk30fl3+WxdOLA0QiGygI7T24j/N41MKw7RxS8QmMs=; b=lBXcdwyYCwKcK75i24inBsK5xsndNpiDEHKRjHNpudH+6rhqntRPEaJuEYBRBAXu/T 2egFWXdXPoC41WKYYf3zLyko40oMNjEj4rwWMHfiG3qwofVXQHZbRVzBOEcqL7KfXZ/4 1pws1XLs7GQ2UpS3lYKDyoGGcc5WaDY2uCPpiNBz535OFi/dU0JxtLXx3D/gA0BgSvkf ZuDxDn3l1Al5uNrH9P30Gls+SzKo7ezqU3qIlLk8KZlVTAgDBUYeY+RJp9u9c2TpX2wK FwYTymeaZMWFXJnOyU6RfidnD5vved5elcVNWTM+Gq47zncrDGDr/FFKUW2iR2NSrfn3 9/FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766228588; x=1766833388; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Tdk30fl3+WxdOLA0QiGygI7T24j/N41MKw7RxS8QmMs=; b=VDsg+DiQNoFx9zd7qtC5fr8MFcd2s9QYjHphiW0bAHFrCBiSFsHcz9GMeejLrlX8jQ zOCq+t8bDxZ4dE8vJJJk2IL4rCRcrziCnZOTylARKhL1BNe2hfasBKmnTS/IuGJMu3Uz L1VbdgBV82M+KC/22g0HcFyETLdB5p+7w0kN4cBEJ4eREOHo+pxJLm9qkEKiktI4wA2l 1ZZUMLW/aoTy4Qbc4NffIxvNgqDrcwYtZjBevq6C0WjcyjNtnRqBTTsZnWeNxD8z8sOF t6YHs0dGi9nDYhbx82RUcZCFKICf8FR1ATOF8Z9srkovCygh/dxGFzjwdrQ3dmG3GDD+ rxeg== X-Forwarded-Encrypted: i=1; AJvYcCUbGz6agaxebweeKqarLni1lQldhtLlLLDmcqll31V77nExQu9xTfBc5llZB491T6YVqgCvTJqobUix6pY=@vger.kernel.org X-Gm-Message-State: AOJu0YxZXa/HxGzFSMMVQMBLXtehfG2TzDblyWJpLvwR5/SAYXAD+/2o CbbIXNINxYacztq4B3jrEycsntSZK8Kth/NpTecw47+p7xy7dKDNUYDu X-Gm-Gg: AY/fxX7RgZO6j/u997jC6qTYrhgi3SpmUtg94tQ2HJMPfjxJtUyqCFKV9s5awMWo4cm CUxSMu1PZ06/hTwSNVP86dLTFtMqGgM8tvJTSYNqUNd+hDCCRV1bC4k9Ou+nUWqIn6QqYl1OZZ6 +0JbK2AR7QCRrrEO9z7Os6tc2jUhPG/aGjh/XHvmtTaPxsTaNSlbbYV8s+ZXnTlIcIghKrFowf0 xpi6ZIfuu4NavVs5I2V1oCl1/BPQ7pKTwlme4yxMshz6bC92/S6aVmRaHhQiiOfGa6Sq/tUzYTn XmDtkfETk/oQJE36ngdRVqfdgUEiK5LtQQvkHIquCT/jCE6reHAsnkBrw/CCvOWq3yX9BKRt163 Z7z/0xYhjm70gC/lwWFUSGdFLl/HAqA72vdVXeGGC9qv/4Eca4FvfBQG6fT9u/VBpto9BItJyxc YIP3rFQmdKI3i67bvZTax6fmtAwBdQEKW89CLkoX6PMmh8AGC7SHQ= X-Google-Smtp-Source: AGHT+IHEZA0PlL34m7yNPdJr3Fq6Se8nfkRk1RvfpC41M1UWR1oVofl4k9hWmNXMFRfN5WzwylRClA== X-Received: by 2002:a05:6a00:4512:b0:7e8:450c:61c8 with SMTP id d2e1a72fcca58-7ff6667c5a7mr5734984b3a.56.1766228588397; Sat, 20 Dec 2025 03:03:08 -0800 (PST) Received: from ionutnechita-arz2022.localdomain ([2a02:2f0e:c406:a500:4e4:f8f7:202b:9c23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7ff7a84368dsm5015547b3a.2.2025.12.20.03.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Dec 2025 03:03:07 -0800 (PST) From: "Ionut Nechita (WindRiver)" X-Google-Original-From: "Ionut Nechita (WindRiver)" To: axboe@kernel.dk, ming.lei@redhat.com Cc: gregkh@linuxfoundation.org, muchun.song@linux.dev, sashal@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Ionut Nechita Subject: [PATCH 0/2] block/blk-mq: fix RT kernel performance regressions Date: Sat, 20 Dec 2025 13:02:39 +0200 Message-ID: <20251220110241.8435-1-ionut.nechita@windriver.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Ionut Nechita This series addresses two critical performance regressions in the block layer multiqueue (blk-mq) subsystem when running on PREEMPT_RT kernels. On RT kernels, regular spinlocks are converted to sleeping rt_mutex locks, which can cause severe performance degradation in the I/O hot path. This series converts two problematic locking patterns to prevent IRQ threads from sleeping during I/O operations. Testing on MegaRAID 12GSAS controller with 8 MSI-X vectors shows: - v6.6.52-rt (before regression): 640 MB/s sequential read - v6.6.64-rt (regression introduced): 153 MB/s (-76% regression) - v6.6.68-rt with queue_lock fix only: 640 MB/s (performance restored) - v6.6.69-rt with both fixes: expected similar or better performance The first patch replaces queue_lock with memory barriers in the I/O completion hot path, eliminating the contention that caused IRQ threads to sleep. The second patch converts the global blk_mq_cpuhp_lock from mutex to raw_spinlock to prevent sleeping during CPU hotplug operations. Both conversions are safe because the protected code paths only perform fast, non-blocking operations (memory barriers, list/hlist manipulation, flag checks). Ionut Nechita (2): block/blk-mq: fix RT kernel regression with queue_lock in hot path block/blk-mq: convert blk_mq_cpuhp_lock to raw_spinlock for RT block/blk-mq.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) -- 2.52.0