Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1868907lql; Wed, 13 Mar 2024 10:15:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMLwKujFW6UHNOYBUTGebWzOFNV6Ifaicwww634ugPxXfjkhZzORzDjXz/qZCHTxIAgn0iLma9wWStGCYQaJk+4GYezMY8OW0oqO1KCA== X-Google-Smtp-Source: AGHT+IFS3toNwZx3ZMRUUEkgM1ETY72dRvEW8PpRfrfvIQRQP9qcd2MlKNvAZV+tQsSkAbCyUC/D X-Received: by 2002:a50:d613:0:b0:565:dfac:a686 with SMTP id x19-20020a50d613000000b00565dfaca686mr3032367edi.38.1710350132407; Wed, 13 Mar 2024 10:15:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350132; cv=pass; d=google.com; s=arc-20160816; b=ab0Bpq8I4TJTllbIZi0Z0b3pfqxu39MV89bt3WFpAMIybS2oYybjFGNIHnsYHH4U4g z4tf7QAO1M+DSoNK+VI0AItF2g7sItAhSU5a9GI3LbRD6xuLvqeOFhkzVwYJ0Vcl8Sdk RqoCP6LFpJSVzEm7qDpv21B8B/29BJQB+GIABbhm8CUOX870gQ335uD5PbWcUimlHS7C IsmsQQc9KAjBejDwrzVQsaG3F4ex13n9Q+HmZ+71WmjkaAqCWv5qUktOmmud4KnRexrI tRICFpv33hNpQwaZhAGSVusoLX5KRqwqsbBonxxTDMXVYMxa5568W26gKzMDhsH5dmdd +jsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EQJ0jMQO7M4OGb0SLAYC4fV2E/6nW6+DObykswD7QU4=; fh=8l/2G7DZumXf5aZ/lPiBZBWim2HCp1ubNRmT4fEODgE=; b=S4ADnGOmTc+7HcfFUfHtZDO8jOoMAgzZ8An1wclC152W+mpGwzSe1WSH4lTflVuT+B Wn9BcsmPWquqqODOBB7SyqqWGy/X3Ez9wXUrlzlvh4bTCjAM8PWaE9AH91pz9RDCDGE+ 2nYr4KIS4r88K43UuUiQQ8nHV0SBFw4cFEznP8EoXG9gmZB5I7JvuXzCviuWb1J/1hTM A6WJnFgvur2+QOTNndGU5i4HkXTmdUszNQD4j1mEykZqJYdlrnL2yoVguqdrcu0pds13 /LVSUDpLqUnudbZONPWf/X6EgwXfd9h+zhE9Zf/H6i4c7AainZ4CFLFZRQkqNlh0jKVM uvxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c8dPBsWq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101919-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101919-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ek6-20020a056402370600b00568915686bdsi202546edb.491.2024.03.13.10.15.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:15:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101919-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c8dPBsWq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101919-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101919-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 21AD31F30009 for ; Wed, 13 Mar 2024 17:15:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A32E12B15B; Wed, 13 Mar 2024 16:41:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c8dPBsWq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4917412AAE3; Wed, 13 Mar 2024 16:40:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348060; cv=none; b=pj3QwTGy2g7VkwPtM6beNMv+fhcq1r6PXZQZi95BAPClhLg5WyR2wXD6PZ7RhDSDmyyQQx0OvFadsXnRFo0QGo6AI5x0KR0VHw8CqPNdyHyOqsbTUN2kkMbjfcC3l0i5PK267rDurK6nA2piFaJEhZPaftReKNMmS4kBVIqWQXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348060; c=relaxed/simple; bh=8soo9GS6UNsR2dW5H5WpZNode4KvqgLlTEAzK/XQhqc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VOlJhV9HuN3iPjI3CkdoK7V1cynO6z5UfVKIdJxTLMGsOuz9VwnJ8Co27CJx/sOUXZd80Sa0yJCuw4h7+12Obl6C+pDU7aUYe37krxxgP0EgBKkt3lwoSbGl3LPG7RSHHEJAEB8o5GMnCIxwUf5lqLaUynScJZLscarZanUJ0WM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c8dPBsWq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 089AFC433F1; Wed, 13 Mar 2024 16:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348059; bh=8soo9GS6UNsR2dW5H5WpZNode4KvqgLlTEAzK/XQhqc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c8dPBsWqkqIoNqBUAmG1ij2OtTz+dA65iHYMdfCArYnyVmJKJiJp+yai8ZqnPd9eC wu+eZ2cISE5tM28ALvSLkvsRQ+KQxGPHUult+xwp+sm/vNvqrcEBRvz3M5lh9GL2D0 bnfKb2p124e88LrK2PSRsNkanKROhOZaW20CaJcf4YFljUUHUv+A0ysD33xnTzb8Hd 3ei+1BbfFuTzo0/rAdmn5CCvNi//jtJ8sx9tPQpMtmE2R44YF991lKvVS6vuRY53JD /H5usHdI1EEsj4IqEI57bY7oxwMjm/pTzMBb962J6YYjr0xjemodSuueenRy9Fx3dA K28kQH3akgKQw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yu Kuai , Christoph Hellwig , Jens Axboe , Sasha Levin Subject: [PATCH 6.1 51/71] elevator: add new field flags in struct elevator_queue Date: Wed, 13 Mar 2024 12:39:37 -0400 Message-ID: <20240313163957.615276-52-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163957.615276-1-sashal@kernel.org> References: <20240313163957.615276-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.82-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.1.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.1.82-rc1 X-KernelTest-Deadline: 2024-03-15T16:39+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Yu Kuai [ Upstream commit 181d06637451b5348d746039478e71fa53dfbff6 ] There are only one flag to indicate that elevator is registered currently, prepare to add a flag to disable wbt if default elevator is bfq. Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20221019121518.3865235-6-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe Stable-dep-of: f814bdda774c ("blk-wbt: Fix detection of dirty-throttled tasks") Signed-off-by: Sasha Levin --- block/elevator.c | 6 ++---- block/elevator.h | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index 20e70fd3f77f9..9e12706e8d8cb 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -512,7 +512,7 @@ int elv_register_queue(struct request_queue *q, bool uevent) if (uevent) kobject_uevent(&e->kobj, KOBJ_ADD); - e->registered = 1; + set_bit(ELEVATOR_FLAG_REGISTERED, &e->flags); } return error; } @@ -523,11 +523,9 @@ void elv_unregister_queue(struct request_queue *q) lockdep_assert_held(&q->sysfs_lock); - if (e && e->registered) { + if (e && test_and_clear_bit(ELEVATOR_FLAG_REGISTERED, &e->flags)) { kobject_uevent(&e->kobj, KOBJ_REMOVE); kobject_del(&e->kobj); - - e->registered = 0; } } diff --git a/block/elevator.h b/block/elevator.h index 3f0593b3bf9d3..ed574bf3e629e 100644 --- a/block/elevator.h +++ b/block/elevator.h @@ -100,10 +100,12 @@ struct elevator_queue void *elevator_data; struct kobject kobj; struct mutex sysfs_lock; - unsigned int registered:1; + unsigned long flags; DECLARE_HASHTABLE(hash, ELV_HASH_BITS); }; +#define ELEVATOR_FLAG_REGISTERED 0 + /* * block elevator interface */ -- 2.43.0