Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp897948rdh; Fri, 24 Nov 2023 00:05:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyWOAbDUh0SmuTPdHWQOfTH1L1CDTU29HfFtd9pNunCxv+2EDbOQIJbXp38gJYjPl6Y+Qk X-Received: by 2002:a17:903:11d1:b0:1b8:90bd:d157 with SMTP id q17-20020a17090311d100b001b890bdd157mr2421381plh.26.1700813117164; Fri, 24 Nov 2023 00:05:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700813117; cv=none; d=google.com; s=arc-20160816; b=QHhUlHtbw4ZCnXIw3bH+Got6V6wkPfsDLcUbPfAGe8u7lWT1bqYtYO3R6a+2Ws9mpR GJMhxKLq6SXqWNY7z+/G5xclGK/cAQj9VN1Oee01++JzV7zHj4FdEPMmAmXuJuOjRyrX zki0Wt/ngzGVhyd7xXNF6lp3+Z/zcal+GZ90EKgLLG2UalMMCgYjfBRutEBB/GZzZp5O f+uhxzR0YyhwFAU5xFDmb58JXjsDuK61h4wHNvkmajm4AQrcyDSycM0luITXiv1yWaXE 5J5S23IuUxsB93rMBaVtSRAGuk3C30YB1fBkbeyLKQz9e4kyDKJIqcPLIvGu4COQteoo sPAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=G263B7kg2YXnG/A+eyEFKm7BjvT7j+pKkbDP94uj0iU=; fh=1OsC7ljVhdTcf5FTl08sAtO9qsMpveq6AJn+JsIEEss=; b=N3KE5Ks6QqnffhcZPnDrxKyUddPxNT0cWh6UqGI4HC+ZVnNU/zdDB0ELG4s95WQ6lR fCXVTlkaflByduBVdB9335tKfhF1AFnuwlRXTHOKHKucTOLdP1Hr7p+vnxjUgH1pKOTV LGljHGSs9cXXiSyTdAVecLlh1N8Fz8NLlp/v4pkkIn4+Ifc1KrdcjAS/aIZyK+F+LVx8 9qLkmMuGlIQKjhbDWf2TAf55Lva1oIL90DBZ930bIpVz4i8Tk1D8ZoFGMTgzLyUuWNe/ CsQssMlIcGFtl5V4yg50Rgx5I65K7M1PWFliJjnmsaaISWV5sqIMJ7MFE65e1mFYGC7D Z1AQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y2-20020a170902700200b001bb3406a5f7si2730974plk.11.2023.11.24.00.05.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 00:05:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7A6CE821691E; Fri, 24 Nov 2023 00:05:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345002AbjKXIFA (ORCPT + 99 others); Fri, 24 Nov 2023 03:05:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231531AbjKXIEf (ORCPT ); Fri, 24 Nov 2023 03:04:35 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FFF64236; Fri, 24 Nov 2023 00:00:23 -0800 (PST) Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Sc6pm0Jdkz4f3lVd; Fri, 24 Nov 2023 16:00:16 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 59E591A0B58; Fri, 24 Nov 2023 16:00:20 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgDX2xERWGBlUnAqBw--.22901S7; Fri, 24 Nov 2023 16:00:20 +0800 (CST) From: Yu Kuai To: song@kernel.org, yukuai3@huawei.com, xni@redhat.com Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH v2 3/6] md: remove redundant md_wakeup_thread() Date: Fri, 24 Nov 2023 15:59:50 +0800 Message-Id: <20231124075953.1932764-4-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231124075953.1932764-1-yukuai1@huaweicloud.com> References: <20231124075953.1932764-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: cCh0CgDX2xERWGBlUnAqBw--.22901S7 X-Coremail-Antispam: 1UD129KBjvJXoW7CrW3GrW3KFy7Gw4fAF1fZwb_yoW8try7pa y8JF909rWUZa4ayFWDta4DXa45Zw1jqrWqyFW3u3yrJF1ftanxWFyY9F17J3yvya92ya1Y qa18GrW7Za4Igw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9m14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JrWl82xGYIkIc2 x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxGrwCFx2 IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v2 6r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67 AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IY s7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr 0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUd8n5UUUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 24 Nov 2023 00:05:15 -0800 (PST) From: Yu Kuai In md_set_readonly() and do_md_stop(), md_wakeup_thread() will be called while 'reconfig_mutex' is held, however, follow up mddev_unlock() will call md_wakeup_thread() again. Hence remove the redundant md_wakeup_thread(). Signed-off-by: Yu Kuai --- drivers/md/md.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 1d33a39d4f13..b4e21db71454 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -6363,7 +6363,6 @@ static int md_set_readonly(struct mddev *mddev, struct block_device *bdev) if (!test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) { did_freeze = 1; set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); - md_wakeup_thread(mddev->thread); } if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) set_bit(MD_RECOVERY_INTR, &mddev->recovery); @@ -6390,7 +6389,6 @@ static int md_set_readonly(struct mddev *mddev, struct block_device *bdev) if (did_freeze) { clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); - md_wakeup_thread(mddev->thread); } err = -EBUSY; goto out; @@ -6405,7 +6403,6 @@ static int md_set_readonly(struct mddev *mddev, struct block_device *bdev) set_disk_ro(mddev->gendisk, 1); clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); - md_wakeup_thread(mddev->thread); sysfs_notify_dirent_safe(mddev->sysfs_state); err = 0; } @@ -6428,7 +6425,6 @@ static int do_md_stop(struct mddev *mddev, int mode, if (!test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) { did_freeze = 1; set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); - md_wakeup_thread(mddev->thread); } if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) set_bit(MD_RECOVERY_INTR, &mddev->recovery); @@ -6453,7 +6449,6 @@ static int do_md_stop(struct mddev *mddev, int mode, if (did_freeze) { clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); - md_wakeup_thread(mddev->thread); } return -EBUSY; } -- 2.39.2