From patchwork Tue Nov 7 17:57:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxiao Bi X-Patchwork-Id: 13449143 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EE62C4332F for ; Tue, 7 Nov 2023 17:58:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232424AbjKGR6I (ORCPT ); Tue, 7 Nov 2023 12:58:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232233AbjKGR6D (ORCPT ); Tue, 7 Nov 2023 12:58:03 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F60094 for ; Tue, 7 Nov 2023 09:58:01 -0800 (PST) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7GeTLc023619; Tue, 7 Nov 2023 17:57:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=1KLnModKLcSj6pjKtFx5peZ1U44A1F5dnVKXZ0Ib0v8=; b=uz7VCWGqZLuOVuIbsDfaFxcm21gfP4EkeiuCVvhmTo8cCCes7duZ9u9Wbmoq7X65vJ52 JiuFkheqD1GVQeV+5tM9F1Avu+YKH9kQMP+VmQXpV2cw73HhnW7aidrniFOT9VF79CTq Yx1rE5LnEmVRPjV9ohFP0fDH4o9txFCGUFN9fhdw0br5vhzWouts0qkVoHh+UBAWR4PS 9ZgiH5fY02IMaBfuTN6xjQMMP61GrckqHwge4cFmLSX3bqh52tdj3gaqnzfXNiZvvhRj OdqqE4g4A8v34HLBtKDZV0B/S/VaVnT60WPYBjMNY8O/FGkRN61teYUUp1WyUvzrZDMO Fw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u679tngkg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 17:57:41 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7GpBS0026788; Tue, 7 Nov 2023 17:57:40 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u5cd77a9c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 17:57:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f7h/18GWBHImPZ32LFBRYizf/ec1o+TwWQXltYxz4iN+/5UWzLr959Qi7k6fjp125LyQCJWefxjvsnJisP5DCOCF6XEXg8oufNIWE/S9YbYWnfx60DqWG1vEbOGCuCQOo5xYzR1ziD2x2MWrIe7SJQJ/LVV0WHQuvZspfVzXMNlQfxhwbJrYQ5XtQngr/5KvJOUKnIIO7FBTzv2jNUK6hRN+YbNl2f0dx/brIB4or12w/vqf5pwlGyTE2Ol3jS5otfHhMXahfMeFkHnmP4rGQWRthJnyDpDpCkzxaM8lj7nzIwVsQypYgtlJooPsVN+ZYM9qBeQA4Jy6CSHvv+e00w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1KLnModKLcSj6pjKtFx5peZ1U44A1F5dnVKXZ0Ib0v8=; b=B9lCHY8gECsrN1wUf6VnGg06KcFdKk2Z+yfGZ+8OQc9blEhO3SUVE43jgCBrhCQH865CH2g8ULLsqu0DBYJgBynMIl9/PTZPUffhVBIahJxj3GCGB6HaDBR7UTmioWZcjcauW0xIXv4h0UWYCgsYsNDx0ZF+/oktrQGZ+miepbpuTQ2RZcjCNqa3kqVTz+VX3x+OLjCdfUDNjo0bmkxWopVGGB72TkDletY8v8ebgJx4+JuzmEFFXfzFC9luQXTzAqo5y+EDnCsVr0rUdCEu+SNgDxlYgCCRb5FvQLVi+dacFilxwCARu7W/QOSHhOr94QK8YkdSX04C6hFWVDgiGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1KLnModKLcSj6pjKtFx5peZ1U44A1F5dnVKXZ0Ib0v8=; b=hXMLBLLEloq0/y38IbEQWUGHHLU1Kc8Ltb6CCE7vFqJ+0zs9SyMOZXThccZYkvT3sT9Pfkoe6KbGZmcwaPw6Ak3m4ravme/XpxO0d4oEi/5zbgiagjDglJAJgcWk/VnnV3RryZp5oizyUOo7zO88PxUFs3GboqITnmNQ3RZWlbc= Received: from SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) by SN4PR10MB5542.namprd10.prod.outlook.com (2603:10b6:806:1e9::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Tue, 7 Nov 2023 17:57:38 +0000 Received: from SJ0PR10MB4752.namprd10.prod.outlook.com ([fe80::915a:381e:a853:cf7f]) by SJ0PR10MB4752.namprd10.prod.outlook.com ([fe80::915a:381e:a853:cf7f%3]) with mapi id 15.20.6954.028; Tue, 7 Nov 2023 17:57:37 +0000 From: Junxiao Bi To: linux-raid@vger.kernel.org Cc: song@kernel.org, logang@deltatee.com, yukuai1@huaweicloud.com, junxiao.bi@oracle.com Subject: [PATCH 1/2] Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d" Date: Tue, 7 Nov 2023 09:57:35 -0800 Message-Id: <20231107175736.47522-1-junxiao.bi@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) X-ClientProxiedBy: SJ0PR03CA0244.namprd03.prod.outlook.com (2603:10b6:a03:3a0::9) To SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB4752:EE_|SN4PR10MB5542:EE_ X-MS-Office365-Filtering-Correlation-Id: 23689207-148b-4d71-0c64-08dbdfbb073f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LdQziok/uH0mdZYEC5FeajDv7AmY4TDa0QfC5ZAq0JpOQH0gDgTEB37Cs49KcQZhgh7KcEC4ggPatTpK3lfoUHOoK8ukIC9FLG6/waeQ7X5avGneqzzdySjcxSXYFAngKAaPHE5tiUggPwN86TW2+dsmK3ESg7nmEqIL43/GfadWRwGvD06oES7UucUbuefUpT1ojEYnnq96qK5TkEnsnW5tFEvjUOCpV6M3vyb5fK4KKUBARm6EnOBUw2Cn6OtG/x/383DL7v3rYijDhLOf/cmVDblxzl3izG9xOXE0DZ1Cgx4GyAHmrH5fLwJhvvcGndWe6kvdYSz3T4woFft0sL6p/HKHu2fc2jRNSlPqf/POKLe/aBDHAoHYboJqC8Dl0S2OsqdKkBlf7ddRsj8ivzEJTCwXIN/FvkciP8Y6vS3lB2brDeg9uAt/k92cZ/QU0b5VJ7fJxHKcCalk0GyjXb9+miKingCq2KawkPOoog/TfJ3OxcjlR9ijgC2cQLi7l8L+6TgXE8OrplBVZRqvo44VofDWNttIJUlvybjz0xV18kLWCIcdJc9oR3AL8U897Meg58TFjG6XkcHkRTHT6PhQST1Xz7FBLGHuYhdgOYo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4752.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(39860400002)(136003)(346002)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(316002)(66476007)(66556008)(66946007)(6916009)(6506007)(2616005)(6512007)(1076003)(107886003)(26005)(38100700002)(83380400001)(36756003)(86362001)(6486002)(478600001)(5660300002)(41300700001)(8936002)(8676002)(4326008)(44832011)(2906002)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WReNm0mKpAvMV1d7xh2fGPcO6wA7RSXPMsOKGgGCOjDodwHVC1eKNirSxej3fxSeuhqC60AIy8OlBVZlFhJIy9cbAyUdZjnAukGZnVWCcQqWdi8ymZ1VFWqTkU4A/jQzN7nzz96nEJ3Ir0CSCb1i+WvZzoQIsUOYYOUYxerxC3MR1Lu214FP2QSHZfvn8voqUsT7wcIf8advydGtKhrEPiV990CbQcZxsaNePosi+DwQ3N1HrPFJ4xXDIEe8wDVgw4E23LTWjdovVVxi7xRLvXsLrfGv7SkxhESrO//ZoFsoBheAyKuujEkyV4VL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qhCwBmFnRhA1u59TRBCHWEeIgRp2DYewsd4OwzZWOiJbmILg7UsX+2JhZrNEUYxkaFosmQKclbrMt71nnj3CfBGZZYP4yk X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 23689207-148b-4d71-0c64-08dbdfbb073f X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4752.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2023 17:57:37.8996 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vBAEqfaGzXtRkfkQXjc4IFyZbDT0GdhPyqp9VrfL7BMKn0mgAOSLrpSxdkl5mT+mHCR9GKpj2260lE247VmDPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5542 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-07_09,2023-11-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311070148 X-Proofpoint-ORIG-GUID: t_Tcy0h9odaWkL_cNxHLU-5kPgdWClQL X-Proofpoint-GUID: t_Tcy0h9odaWkL_cNxHLU-5kPgdWClQL Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org This reverts commit 5e2cf333b7bd5d3e62595a44d598a254c697cd74. That commit introduced the following race and can cause system hung. md_write_start: raid5d: if (mddev->safemode == 1) mddev->safemode = 0; /* sync_checkers is always 0 when writes_pending is in per-cpu mode */ if (mddev->in_sync || mddev->sync_checkers) { spin_lock(&mddev->lock); if (mddev->in_sync) { mddev->in_sync = 0; set_bit(MD_SB_CHANGE_CLEAN, &mddev->sb_flags); set_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags); >>> running before md_write_start wake up it if (mddev->sb_flags & ~(1 << MD_SB_CHANGE_PENDING)) { spin_unlock_irq(&conf->device_lock); md_check_recovery(mddev); spin_lock_irq(&conf->device_lock); /* * Waiting on MD_SB_CHANGE_PENDING below may deadlock * seeing md_check_recovery() is needed to clear * the flag when using mdmon. */ continue; } wait_event_lock_irq(mddev->sb_wait, >>>>>>>>>>> hung !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags), conf->device_lock); md_wakeup_thread(mddev->thread); did_change = 1; } spin_unlock(&mddev->lock); } ... wait_event(mddev->sb_wait, >>>>>>>>>> hung !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags) || mddev->suspended); Next patch will fix the issue that reverted commit is fixing in a new way. Fixes: 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d") Signed-off-by: Junxiao Bi --- drivers/md/raid5.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index dc031d42f53b..fcc8a44dd4fd 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -36,7 +36,6 @@ */ #include -#include #include #include #include @@ -6820,18 +6819,7 @@ static void raid5d(struct md_thread *thread) spin_unlock_irq(&conf->device_lock); md_check_recovery(mddev); spin_lock_irq(&conf->device_lock); - - /* - * Waiting on MD_SB_CHANGE_PENDING below may deadlock - * seeing md_check_recovery() is needed to clear - * the flag when using mdmon. - */ - continue; } - - wait_event_lock_irq(mddev->sb_wait, - !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags), - conf->device_lock); } pr_debug("%d stripes handled\n", handled); From patchwork Tue Nov 7 17:57:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxiao Bi X-Patchwork-Id: 13449142 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A27FC4332F for ; Tue, 7 Nov 2023 17:58:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232355AbjKGR6C (ORCPT ); Tue, 7 Nov 2023 12:58:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232362AbjKGR6B (ORCPT ); Tue, 7 Nov 2023 12:58:01 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D56388F for ; Tue, 7 Nov 2023 09:57:58 -0800 (PST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7GeWUi007243; Tue, 7 Nov 2023 17:57:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=ZefF1sdElYTvv/+IKpkRGhYbnsbKj3YPa9tpw4M2dwU=; b=Aqxzczt51rGhLsajDMbYGsB9ev0wg2rQ40Y7pp3DhAGm4FK+yvKSK7S1VrJRg646jKob 0DiMcfr5jDVPkS6Kyk/Soek/a5zQHSEwbSPwKeqCJsoAtsuatITAF36tHb7RGC2LyClS 8Th+u8HgguWThvSQJtLSeR4aKwEHMavLSC1chzgjrNHkNra/voa6iB50ruooJ6LsS4Ta 9GjFDLcICoo2cdUNz0dMuVA1v4sI5AkR3A1mVGtgD451WtrXn6bW7xKTF/S6U/g0G9LP CYF7DSDBmBqzJSJCS9Dir8c3RgQ3QHyA+gDFnPf0nMMaNQTOQkJIu0FTc76eS8Wh6Qi0 8A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u5cj2xs47-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 17:57:44 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7HhJ3D038278; Tue, 7 Nov 2023 17:57:42 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3u5cdeb1t2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 17:57:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cbsW6GbhRIaAKoCYMY4TwjEE6+c6um0q+d8FWYFXzpUxVL6c2PRNFCPZzWm3NvUzt4oC83P4CrC/du7oyvN7SHqy8NF1pXYnl6nE+nm9lU5T2PcLGa7YWDdSjSRQKIpO/r1BPSOuc6SoGG4mUV2uO16//yly0wSxsQQG2O6RsbA+QAwmuTH9fe2YaqzrDWXrsUizuIs06Ph6hFYcbFP87XKAmviFI4PmZDKGLDwcXjTt2rWNZrZCCnUyVaYNpmCow2XrkgkJc+re8oF6J5MIZSIAyPI0WuP40/BJADAV0QejmkEZzasGll3+1IPbe7e2hHEijjR9MpxSV6t1YVRgfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZefF1sdElYTvv/+IKpkRGhYbnsbKj3YPa9tpw4M2dwU=; b=BUIhTv0csL3rfT+d1kaW7bn8/Jn6UblmevI22YtJJPPC3ojU5A81thubxYEuOh5KCEWnIijM6HIqsP3++QOPpglGtPDS70/v+4tz4UU8f7pMdXgkERQBIFd3WXP5+HDysbgLZDz3e/B9HdQg3HLL0h8RV9GiKkNeLzEq64mPtS/3nvUqssOZu/F8XWDns08Jad/9pTPg3ckBsyGVTyOF+w1UnMNGlvFH1VsyaKfzDj7hm9eKG8v6nF8Woq6aNj4dIW3seKicj8Y+hL2ktxLm2oNe67guirwbGb5Qu2n6aPuud3TckFJMWwjU1U4tVXN7FHP0Q6v/jPCVSiMGp3N8mA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZefF1sdElYTvv/+IKpkRGhYbnsbKj3YPa9tpw4M2dwU=; b=EGPjx44MbLQrIrwGYjuRMRv274RYCKLvads3Xu0/pqzrM89Tk3F3q74nfs95pGeJX7j3NkZ0Y3RrH2EmNVJGPKjtGNN2CgquD6CvD6j9yV+nwDb+JDaAgluE0we/d7ibuYmw4kUnAHk2NopGhVOo4v7njVfJtviW+9Z31BvBX1I= Received: from SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) by DS0PR10MB6918.namprd10.prod.outlook.com (2603:10b6:8:136::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Tue, 7 Nov 2023 17:57:40 +0000 Received: from SJ0PR10MB4752.namprd10.prod.outlook.com ([fe80::915a:381e:a853:cf7f]) by SJ0PR10MB4752.namprd10.prod.outlook.com ([fe80::915a:381e:a853:cf7f%3]) with mapi id 15.20.6954.028; Tue, 7 Nov 2023 17:57:40 +0000 From: Junxiao Bi To: linux-raid@vger.kernel.org Cc: song@kernel.org, logang@deltatee.com, yukuai1@huaweicloud.com, junxiao.bi@oracle.com Subject: [PATCH 2/2] md: bypass block throttle for superblock update Date: Tue, 7 Nov 2023 09:57:36 -0800 Message-Id: <20231107175736.47522-2-junxiao.bi@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) In-Reply-To: <20231107175736.47522-1-junxiao.bi@oracle.com> References: <20231107175736.47522-1-junxiao.bi@oracle.com> X-ClientProxiedBy: SJ0PR13CA0232.namprd13.prod.outlook.com (2603:10b6:a03:2c1::27) To SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB4752:EE_|DS0PR10MB6918:EE_ X-MS-Office365-Filtering-Correlation-Id: c9bb68d6-3f0c-4eae-8d7b-08dbdfbb089d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GE+ABzEuEwGas57vjrA2PO61lvLpr9gNfg4r+ocTkiopRrJYkvWY/kFpuHHEsCe83T+G+l3Arkdnhpcd1o8Qc00RrN6NJo/kV/NyX91tqMCRrF6t77+0PIScIhbiayTEwU/CP2bwAdNDPzIRJ4lg60q22gDYdvpFwqjQVOoq9e69pZCsnRNJj/it8geu2ehbMBTYATNAKBmEDJXkQMe+b832vNUDhhbmGzELpuXAoR3VUPOpoN81yAJglsAYqyeeiveyTzRnzibg69tnowYhdRr38cjngAUzTvtKb4bnfLIgtGaRdjbI7Totdt+5i5X3DcMlGPs9AtjXrtBPhQ2GyCsTix223FlSQXKaRSV1NO93kDqaE2IHcLhoWYy6/htl9hhyx9PoeIYP8taz8vZxh2ZfARb1+ijMTM5m+TnsxROmjjIDGV4AoNAHFC/X/YdZpCjIrYe5IgGDeENVVb8MA8lNUZuJRA8Oz/pCKAtMnfbkwocVaQ9bmyK77t7NfifLpH9Gd7EXeC4xVmnen+doqvcfCqSSYuByE2l4lgsGlx3D65C22QWlNwXQL0zgolvt X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4752.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(346002)(376002)(136003)(396003)(366004)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(38100700002)(6506007)(41300700001)(6666004)(66946007)(6512007)(4326008)(66556008)(6916009)(2906002)(66476007)(316002)(8936002)(44832011)(8676002)(6486002)(5660300002)(36756003)(478600001)(1076003)(107886003)(2616005)(83380400001)(26005)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sVRsIGyyOg8WSJWZn9FZ6c5PvAGMdW+7ZFz0B0+hzSsFdedXGXhClXgOGI4Aoa2moC2lBw3DCZpbBV3OjnRJRJz4M0PrlkapEo5JovIeia5NWKHTXLLbAarVoTXosFj907tQP2Cjo+MTUlil4lkPnBFcLP6U0haGN3cb32ju2Vrq5zMDpN4myEgX5G9S1ag/Du8g72UhQ1ReZDtTfIjL2ZLfHX6AThK4Kxhk4c4LDrcofkAeTa3P4Aqp64JeCZ0Ptk4JMMcbwhyFSyztbUbu+Cfsh0V8YZTQ5YWY6o1vHKv+AWB2EA6ZnyLU5B9s2ddYCGSSnlUirKLlBzkvzLL35il7Rpk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L0xn5KHYwen99vlkk34QpqNuzoZfbpV3vEXhOVzBFFKS9+dW37075u61sV1JDEypZfQ9yM X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9bb68d6-3f0c-4eae-8d7b-08dbdfbb089d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4752.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2023 17:57:40.0938 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: S+EmymOWJFvISqfNI6ajGJLZIlycTmuY/w6L/CGzWAim54LdAa5q96WPAwZXRONIesR8AWd2W0GlyUerSuEnIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6918 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-07_09,2023-11-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 spamscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311070148 X-Proofpoint-ORIG-GUID: Yez0SrG8ORBPt0nBOOpHTivMBN358PdD X-Proofpoint-GUID: Yez0SrG8ORBPt0nBOOpHTivMBN358PdD Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org commit 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d") introduced a hung bug and got reverted in last patch, since the issue that commit is fixing is due to md superblock write is throttled by wbt, to fix it, we can have superblock write bypass block layer throttle. Fixes: 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d") Suggested-by: Yu Kuai Signed-off-by: Junxiao Bi Reviewed-by: Logan Gunthorpe --- drivers/md/md.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 4ee4593c874a..7a5a22097365 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -1013,9 +1013,10 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, return; bio = bio_alloc_bioset(rdev->meta_bdev ? rdev->meta_bdev : rdev->bdev, - 1, - REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH | REQ_FUA, - GFP_NOIO, &mddev->sync_set); + 1, + REQ_OP_WRITE | REQ_SYNC | REQ_IDLE | REQ_META + | REQ_PREFLUSH | REQ_FUA, + GFP_NOIO, &mddev->sync_set); atomic_inc(&rdev->nr_pending);