Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp636315rwr; Thu, 20 Apr 2023 04:34:58 -0700 (PDT) X-Google-Smtp-Source: AKy350ZJfrr3+CR0Y5PD7Tv9snz3YG/dqqZnFrcbUrrPwY+Lh4J7AZ/G+4ur46Ikv1BBUxSujA7y X-Received: by 2002:a17:902:bb0f:b0:1a6:a375:cb49 with SMTP id im15-20020a170902bb0f00b001a6a375cb49mr1076877plb.39.1681990498159; Thu, 20 Apr 2023 04:34:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681990498; cv=none; d=google.com; s=arc-20160816; b=wAvosQQSwKtBkR+IiEvg3PjbIFbtsDFY6k+YcPzTIIqLx9h6IAKkO06piHqlSQJEHt B7BVwjDSSiaHlEf+EVr/ftK5Tt50WYfgrxxfTa+IiC6X6ZWhMMD94gTEU1xoCw89WPho OMHWaeA+yZ1ayqc7yZpHUQC3mYjosKtcK8p68o1BDjbA/xsJqFv6jWzDwzEMU+Ktkgwa eg7wklcWXUQuFHq1fc8TsPaz9PXdeDiLZEgxKS9rvsk7oJ/iEH1gp7zBwqD9O0H9Sk+q KpSWnQn+0M40kl+IGM2wNDFA4mZKbCLTn/2u6IPgRcLMTgjfWTq+DVUt+erh0j0x9iI2 B9Sg== 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=p/yz7JfnBH3rqtPEht6WH6kwXZ7aCjXMn0qv0NqZEgc=; b=jb8BxyBHnCMoZigPBMl7OhHtgL7+O+cibMWdc0lWu8QbltqAiORoDdbSi2HNBcex5r HZDLFSxqMjw0ohG+KWKm3pq9EOg+/JzzP4yM+L41e7XQ9m/70HUfZAaG024knrQBZsh1 w2tWUVZE8kILFJvzKnw7uGiUuNDcOiQ1i9Q43lShtlhAX6LPjnwswKvisJH4basAYV+K ZK1soZgSPSmNJRgOzc8WH6WXDLMLa+Ah2bbME0tr1sCKfsQaZWbzpClYcnYNoop3TUzK NkZIG6Lzyh36DjFncd1U8rbCdsjHrXhau9Vq0Bo7o2OpcpkYdeniO6zDVI68c5HsS2Jx Xbtw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jw20-20020a170903279400b001a63bb1497dsi1555671plb.376.2023.04.20.04.34.45; Thu, 20 Apr 2023 04:34:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234053AbjDTLcF (ORCPT + 99 others); Thu, 20 Apr 2023 07:32:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234042AbjDTLbo (ORCPT ); Thu, 20 Apr 2023 07:31:44 -0400 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED587272C; Thu, 20 Apr 2023 04:31:21 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4Q2Fpq1Q3Lz4f3rg0; Thu, 20 Apr 2023 19:31:15 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP4 (Coremail) with SMTP id gCh0CgCnD7OAIkFkVY8hHw--.17021S11; Thu, 20 Apr 2023 19:31:16 +0800 (CST) From: Yu Kuai To: song@kernel.org, neilb@suse.de, akpm@osdl.org Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH -next 7/8] md/raid1{,0}: Revert "md/raid1{,0}: fix deadlock in bitmap_unplug." Date: Thu, 20 Apr 2023 19:29:45 +0800 Message-Id: <20230420112946.2869956-8-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420112946.2869956-1-yukuai1@huaweicloud.com> References: <20230420112946.2869956-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgCnD7OAIkFkVY8hHw--.17021S11 X-Coremail-Antispam: 1UD129KBjvJXoW7tF1DXr4fJF4UGry8Cr15urg_yoW8WFWkp3 90gayavrWUWrWUZ3yDua1DuFyFg3WqgFW2kF95Z395WFyYqFy3W3y5JFWxWryDZFW3Ja47 Zry5K39rJF4YyaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9K14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2 z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F 4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq 3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7 IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4U M4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxGrw CFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE 14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2 IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE42xK8VAv wI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14 v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfUOBTYUUUUU X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, MAY_BE_FORGED,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 From: Yu Kuai This reverts commit 874807a83139abc094f939e93623c5623573d543. Because the deadlock won't exist after commit a214b949d8e3 ("blk-mq: only flush requests from the plug in blk_mq_submit_bio"). And bitmap io is handled asynchronously now, the deadlock won't be triggered anymore. By the way, for performance considerations, plugged bio should not be handled asynchronously. Signed-off-by: Yu Kuai --- drivers/md/raid1.c | 2 +- drivers/md/raid10.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 7389e599f34e..91e1dbc48228 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1164,7 +1164,7 @@ static void raid1_unplug(struct blk_plug_cb *cb, bool from_schedule) struct r1conf *conf = mddev->private; struct bio *bio; - if (from_schedule || current->bio_list) { + if (from_schedule) { spin_lock_irq(&conf->device_lock); bio_list_merge(&conf->pending_bio_list, &plug->pending); spin_unlock_irq(&conf->device_lock); diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 9f307ff5d4f6..d92b1efe9eee 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1101,7 +1101,7 @@ static void raid10_unplug(struct blk_plug_cb *cb, bool from_schedule) struct r10conf *conf = mddev->private; struct bio *bio; - if (from_schedule || current->bio_list) { + if (from_schedule) { spin_lock_irq(&conf->device_lock); bio_list_merge(&conf->pending_bio_list, &plug->pending); spin_unlock_irq(&conf->device_lock); -- 2.39.2