From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sg-1-22.ptr.blmpb.com (sg-1-22.ptr.blmpb.com [118.26.132.22]) (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 7E03D239594 for ; Fri, 16 Jan 2026 07:32:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=118.26.132.22 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768548739; cv=none; b=ccc60LTuXqqaD0Qe10THs46VR2ralYGCIhQyuILEyYndHxhGprauMJxONY7iq8K6U6jxjJzbll9vJJ5pXGKKoV8+TB8+Dsfiiy7Jj+E0jqvuW9NKIG1URZp+ErQFqCL5eDddeg22CdMdXJGxypVqhO8DivmaTucXcQcaE2Gf0+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768548739; c=relaxed/simple; bh=HrZxHqGlspVWStqt/o8ilWNhVPUBqQKhYTIA+Im+TIM=; h=Message-Id:To:In-Reply-To:From:Subject:Date:Mime-Version: Content-Type:References; b=EVoAwwJad0s8+1DENdTnMSHXc4B/mGThWEvVMWZJPiDkAs1Ar/sArPvTJ8eolESFmSztOb7FCc57hhUJvxfqtJK8fTiiQeuXrNDHVAPs9Fg5kfYVvo1/UxbJnBY4zoQmBEQlJ0YS4L4CsFy3k0RaKVphIycJKWw338t0Q+YnmEk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fnnas.com; spf=pass smtp.mailfrom=fnnas.com; dkim=pass (2048-bit key) header.d=fnnas-com.20200927.dkim.feishu.cn header.i=@fnnas-com.20200927.dkim.feishu.cn header.b=2XF8PS09; arc=none smtp.client-ip=118.26.132.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fnnas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fnnas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fnnas-com.20200927.dkim.feishu.cn header.i=@fnnas-com.20200927.dkim.feishu.cn header.b="2XF8PS09" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=fnnas-com.20200927.dkim.feishu.cn; t=1768548724; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=OaWVvZpftbp+J+XN/0wkh2dpu90pXSBFpTSkKrTXlx4=; b=2XF8PS09Ht2CPoloqUuGug8G+ARYNa87I8EXWgLMx8lBnV1CPEHn1fKhWcSyZg2k/arkLx RRwxi4YTX/zyk2bys7sefqMTdXmaFYLqqrjE2bCNPSqQenel1cltfMIn5uowIeRgEzazz8 RUQ6q644IFhjQzuUWiC8b99hJ6k/bhVIku1L3AUCoYPj0rbPiYnkElqG7+nfTDNJjwXoTU FcGkcIbAR8tcY/FqYArPEcd/YQkiT9KZqtGPcAtpT4t3+p8dxx25aROTCBqHQmYGLQsz5y E6XMRypUwraPut1+j7BdYfJgGo5jKYdDijQGd1y9yNB94tmdHs4AZy24zNNC9A== Message-Id: <1cf65d49-995a-462a-b355-cd28c093592c@fnnas.com> X-Original-From: Yu Kuai Content-Transfer-Encoding: quoted-printable X-Lms-Return-Path: To: "Chaohai Chen" , , , , User-Agent: Mozilla Thunderbird In-Reply-To: <20260116061927.1004411-1-wdhh6@aliyun.com> Content-Language: en-US From: "Yu Kuai" Subject: Re: [PATCH] blk-mq-sched: Remove redundant code in blk_mq_sched_mark_restart_hctx(). Date: Fri, 16 Jan 2026 15:32:00 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Received: from [192.168.1.104] ([39.182.0.185]) by smtp.feishu.cn with ESMTPS; Fri, 16 Jan 2026 15:32:01 +0800 References: <20260116061927.1004411-1-wdhh6@aliyun.com> Reply-To: yukuai@fnnas.com Hi, =E5=9C=A8 2026/1/16 14:19, Chaohai Chen =E5=86=99=E9=81=93: > The current purpose of the blk_mq_sched_mark_restart_hctx() function > is to set the BLK_MQ_S_SCHED_RESTART flag in hctx->state. Just remove > the redundant judgement. I don't think this is just redundant. This function is called from IO hot p= ath, and test_bit() should have less performance overhead than set_bit() if the state is already set. > > Signed-off-by: Chaohai Chen > --- > block/blk-mq-sched.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c > index e26898128a7e..2f6c353cb6d0 100644 > --- a/block/blk-mq-sched.c > +++ b/block/blk-mq-sched.c > @@ -21,9 +21,6 @@ > */ > void blk_mq_sched_mark_restart_hctx(struct blk_mq_hw_ctx *hctx) > { > - if (test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state)) > - return; > - > set_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state); > } > EXPORT_SYMBOL_GPL(blk_mq_sched_mark_restart_hctx); --=20 Thansk, Kuai