From patchwork Tue Nov 7 21:24:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxiao Bi X-Patchwork-Id: 13449302 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 E406DC4332F for ; Tue, 7 Nov 2023 21:24:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343974AbjKGVY5 (ORCPT ); Tue, 7 Nov 2023 16:24:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234348AbjKGVYz (ORCPT ); Tue, 7 Nov 2023 16:24:55 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5F16D79 for ; Tue, 7 Nov 2023 13:24:53 -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 3A7LJfR2029174; Tue, 7 Nov 2023 21:24:42 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=wfli5XOfzlDWPWB6GeF08TdoKhfQ3TBdMxjur9F2rwI=; b=tvqW8uu8ooQCmY2NMB+gwQDpqX9Z4lgFcFMkhqRUBhgHOOSJpbb0hB/KLw6xWnQSvmPu awstdPHDe81Y6LQIEyrzbCSmOIzldwR6Ubof8/U/j+KWBCx8JJNAeroajAzvbv9nisUc lkivUw/Q+jLGb7hIp7bYkdq1PK73GcjJXy11KgCzalgpDU2Wp6YHwESsIH5p4jQ7ZcN9 yxpzXlosGweYf+cIe+xyY2V/hbirTYmTXnS0iO4EGHwf+8zetTLHmwOp2fCRIxFnh8nM HQxKUaqXPEz8YNUSiwSvsiTMPjJyAVouYd65D7/ohs1zisV+yX3Ap/IIUilA2jpaTTKt DQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u7w23008s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 21:24:42 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7LIjIk000336; Tue, 7 Nov 2023 21:24:22 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3u7w1v86tb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 21:24:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qw0lBGgH6FHyhRw/n85DUzOdFBdCe7kGYeU9H1IhsFl/vp431bqJYGnvv5k2ibctjWmReDKMmfVbdZdHwufNS5HTmRsymHgt2NrtxCOpTeiauiwDTLX6E7EQe4RhdZyeZhciThL6O6yI6bj9fJuDBMOmid2eXL0xGx9CIGM9D7T1tI6uuIt4uFnbFNDwswkpq4aD5+LRMJ6MSkD8kzksEWPGuZMebPpbAXKHBDhR1EcS7n0a0ZseajZx4QSjGo4zWv/n8y7OTwJr9W7NTOdG8HRzUV6bUchk7mdIcMyBklyZ4Hcw1QzYqU4H8LDReZxUw98XTQffuDia4noIQA9tng== 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=wfli5XOfzlDWPWB6GeF08TdoKhfQ3TBdMxjur9F2rwI=; b=BPfSYSzD5FQDpf/F7M15ZHpAQXeeEP8cARjXaFthgZK3lC5YU0ktCih6QjLb+nyFF400svRrMMuT4DW5+2+pTL0XsQYu8oAPeFDigVo6Q8xwhx3u//k8uL5xxp0xDNm6+l/NJ3C5ucWUMO0JMTT/wyquRssv9xHrsY8BvLvpim6H1dtwZh69ZvbNkX6Zq2GFprs3g69HVkTELIHdaKyn2qwi0FlbyoB2iUHj4O+m3WB0i1WVkQUtLlY6hMrh4/cAnnnDD1ACL2lcIvxG9iplqAGMoSC9OiYHZ4gAVvVWsQsEDp6JLaZnhZ4EYuPEBk9BCWWCMrQhgf3SGmkPh1aLXA== 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=wfli5XOfzlDWPWB6GeF08TdoKhfQ3TBdMxjur9F2rwI=; b=mV+xN8DbsezLnKHf1BeFDb9LOHwrk348wlgiRfuhnTOQaoy3I8VK4LZHVbvPyt/QS2hKIvZQTIYJdjaZGvehx62EzVzqH5bazdATVapX8BYH4rxY+AV4a3G/H0ZW9NE4XRf2wS1/Jwdpt/YRT6Vok+6vzrtsykPzD/FrhXmFfw4= Received: from SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) by SA1PR10MB6366.namprd10.prod.outlook.com (2603:10b6:806:256::12) 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 21:24:20 +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 21:24:20 +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 V2 1/2] md: bypass block throttle for superblock update Date: Tue, 7 Nov 2023 13:24:11 -0800 Message-Id: <20231107212412.51470-1-junxiao.bi@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) X-ClientProxiedBy: BY5PR03CA0011.namprd03.prod.outlook.com (2603:10b6:a03:1e0::21) To SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB4752:EE_|SA1PR10MB6366:EE_ X-MS-Office365-Filtering-Correlation-Id: 284a43e7-6e78-4ebe-7813-08dbdfd7e7b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aDn/BSZhcxasICip3GYp+Y7pv2yKs4j+56tfMLWx90wiuAqJmtKWVt/bLc3yobVefJVcgPiH9fsKC5XLohYo9omcue2/8UMCmzScKRKB0Cx3pAn26S+SaXJHA53xGM+oe76B48nx2b5xx5sOIu94ExAbPbhlLkBXAdZOrRJuxpV7Ihra53xGZmhrJKsif0yH+UCk/6JHeGMbwVuVBPgRpIb6TBHLrSMf2MBpvLjQUPJts7+/2bKp5noaqsR6Re9R4Y4oAvZVmmNgEAvPs1vu9SHJoh549EwB8sX7fna/HcteK/lhhLyd0U7D2R722nVuYE6UXpNxBf/UjRQmWpzozF5/d6pddzPS+0I0kPBXDVNp5Yxa73xgJMok/kDAYJQMxbbP+Q1XRd4sxMzFRnD1zPbjv6pn02laHrVi8f2kX0BnbEJRTgcqqQrsGbvZdyjWzevZOF6ph9S1QVZTP5X1iF9gWlFLrae0HYQvkw0CknFKIWhsnjpfRQ/m4qXlTEXAeX9swdQip7hOsdUEPI92zI8WujfPgmW+n06UklstB13VxUnFrJQpjImFgcFautXG 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)(136003)(39860400002)(396003)(346002)(376002)(366004)(230922051799003)(1800799009)(451199024)(64100799003)(186009)(2906002)(5660300002)(86362001)(8936002)(316002)(6916009)(66946007)(66556008)(66476007)(4326008)(44832011)(8676002)(36756003)(41300700001)(1076003)(26005)(107886003)(2616005)(83380400001)(6666004)(6512007)(6506007)(38100700002)(478600001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gdJ2LjIIIuRNVebC6YaNW6zBvh7KtAU9SAVprwRvg7jmYrIgI/0+eqB9rPp9sujzEgW5/CCFKlQ77U1tdZn5BowP1GYcjA7NZZcPJ7UW8yCGn+gaR5rNSxHgFaypZ+GfzFrJDgXniD3Z5yWYggyN3UlUPJoExbjIGeHydKdr2YWoB9TyrB5wTb/J5hA4L84WI198ecedz4Or2I0zeeaJ3xN+LODVQ5rn2OeAT0PpeZpsX5JXkM6LTeQXSbE1FFaoNcW/fNQRtVV37TJnSBDidQSbhrYS9we6A0Mydm1WHdF2DiUEVjLP9MMYDgtYG03Qm51iU7C33PFEZ3aj1wLqKjox9jRXAAoz0F3HShtwy8mcZmvB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U24LhOUUPtxy3jZlAkfBzmTIKSnHnQbvmvM6T X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 284a43e7-6e78-4ebe-7813-08dbdfd7e7b3 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4752.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2023 21:24:20.3709 (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: /FXwg2b5pfEkeIX/NmdGv7+WICsP5LocAsZ1URgjNW9VJwfNUcPUEBVQxVpZE/Ew7jYGFBNC8O8IV3u9xm7p+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB6366 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_13,2023-11-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311070177 X-Proofpoint-GUID: rJfst3WGdPzuRJhvDCyfqDN5SeeEKmyj X-Proofpoint-ORIG-GUID: rJfst3WGdPzuRJhvDCyfqDN5SeeEKmyj 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 will be reverted in next 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 Reviewed-by: Yu Kuai --- v2 <- v1: - swap the order of the patch - small tweak of the patch log 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); From patchwork Tue Nov 7 21:24:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxiao Bi X-Patchwork-Id: 13449301 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 3D596C4332F for ; Tue, 7 Nov 2023 21:24:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234720AbjKGVYl (ORCPT ); Tue, 7 Nov 2023 16:24:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234348AbjKGVYj (ORCPT ); Tue, 7 Nov 2023 16:24:39 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCCDFD79 for ; Tue, 7 Nov 2023 13:24:37 -0800 (PST) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7LJxD6022783; Tue, 7 Nov 2023 21:24:24 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=1kvZZe3+PECc/UyF/1LkSORsjNredWh8+SfnQRhmzFI=; b=2sfmgCMWU9KsjZLRoRVS2Q7GBKhlAOLX16sHucYFgfOfBzkjad6yqKT8cqEcl1Ccq6Fe 3VALGf3YesJBmOPekfIY/ooN/S7CLZv043v6Dj3Ccsr/p107FdTrhfYodVJq7sQ7uiGs 5K+YnSpNJ2uevXPpQC5EuCJh10+bzjhqNjnx75JoZAnAiQGcEx6z6C2rGZhmt8J7HqSw X9UXgTqApY4lsd23bd+/PzV/zPWMHizXGuPV0T1yEZOCPVbQ4zTeCwK/iNW8IlOD/bCJ aeg2gwlK7T4wzmMJoOgTDr4Zu0uHw+782/qzjv9MN71DrTK17EzcxWApDCT+o6QxHqmv lA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u7w20007c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 21:24:24 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7LIo9T000483; Tue, 7 Nov 2023 21:24:23 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3u7w1v86tx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 21:24:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ax03AMhQz6s5DOXbBs8WTcF5p3CiouGxUwXlZA2TihAQoCmWatueSLQOH1Ky/R2iSXEKhz4zl2El9s64CDNS/Ny3pbRFLMKmkw0M/QKfnmkvzrobm3fdqRBjn1AyQFx3s4JULcK+xVyAEmh5xDisvOC3p14GKqHGBGTcDCRRJ01mKHRH/GYU1TRdorIkdWRhHxzaO7hn+HQBgFvzSjPWBss72q6SpOKHhjbkTpe50ERvCay/fWxH8JfwR8sIlo6F8zcoxD5mIl3wrV7qbwCr+Z6aM/kWZXIhhnCs9lTecUR1Q5solMnbtZHFnaEJvcMimxEKO1Qw7QmsT9BwQLPQXA== 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=1kvZZe3+PECc/UyF/1LkSORsjNredWh8+SfnQRhmzFI=; b=e2D7TBpjvPKbNfEyjHGCtRaTPXowqWjz5zmmRIOKLC03m9MiKK/ph1VAmrUZlSR7fPKrPCrjjKs+VN0TJTVyBNe2as3Ew6HlGxFqXdj1RcitAkKthUv1gTxtZVa+rUqDCHz8plCd9gTsRHjuiTL/V0UNlGKPam6Daumpcqg2HQIgNjYglVWy0XjeLShm0HyQ8RJFFv+zgDazIaMz/b6QQgn/om1YYP7yc0/RKDIsT5LC1kTHCVJLXPFaEN6sL0P56WV0WwCyCniv0gf7p20c+BEI9C3pW94U27g+QWs5Inn+bU9QDje1GaNpAIlehNzncY2FvIFg2dEIu0g7+NETxQ== 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=1kvZZe3+PECc/UyF/1LkSORsjNredWh8+SfnQRhmzFI=; b=QnKmHGlr0Q1ZHwXDE/qmgLAkVB3fHUbep5gLu4a9FD0PDOw1n7odIbm+Vqixq9nqud0Wce4Te9aWXnqmM/9JFU5ZRH0nAufdpSYyoX6/P5Rixt6hsbr7ZpD6bsvrcCDvYKd37tB4QlQKcQ6ZQ2ZsSwM9kz5VeKae9wWZ62ob+XM= Received: from SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) by SA1PR10MB6366.namprd10.prod.outlook.com (2603:10b6:806:256::12) 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 21:24:21 +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 21:24:21 +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 V2 2/2] Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d" Date: Tue, 7 Nov 2023 13:24:12 -0800 Message-Id: <20231107212412.51470-2-junxiao.bi@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) In-Reply-To: <20231107212412.51470-1-junxiao.bi@oracle.com> References: <20231107212412.51470-1-junxiao.bi@oracle.com> X-ClientProxiedBy: SJ0P220CA0021.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::8) To SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB4752:EE_|SA1PR10MB6366:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a86237d-fb2d-44ea-aea3-08dbdfd7e868 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xNaTgrqua2eULvL1a9yk7iEd+5+we5Bf11ZdLf6LpTaDMGyyI4wcOLqR/bJ4JvBuzgFMCBCmcsReySbdjPZiw8dKxIViDE1LKvzuCoXJhWSLIidfOryFInwbdRtoo3yHgBIhyt1Z0bTk6Jri0DMC3UzHslZeluWft5c2YeuzinU/wPyBf4oLcG6sBfyEZC2YD6mfHe6whYJzf/9J1PTvPSZOPjdGXvs8G96YioPGfmO9f3U7bc5vEI49JOsp/W/GfUX4qwvk4JBS9rTcvqTXH5VIrO/Nyf1X2ZK8kq5hiklv210wR4jd+fdn/Cl3fryOAg4I4B7mHEe+hIXo4y5HbZmf2XqTc9j/1OFh866dW53Cxa4yROpGgd5SPHS4zmzBjk1fEcgB5wdolymLmBrUNysMoMjiV25FySX7LUV71o68++RXbyLSdTmPwdvwrreed/3C2J0KHc99PhEpTXS/FlNb0wTcR+yANnjVpUoIJn56wUNQks/lhWD49k5c1xKEO016Q+aI96jJ6fKVA+SwwNRIwzhzGf49jh68+hdS3Sc3PTDVlTdn01/izyyWMme7ZLeVzRB7Bu8CHGFe3nJZYtDf4i1crrBvrVTxQ21iwBM= 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)(136003)(39860400002)(396003)(346002)(376002)(366004)(230922051799003)(1800799009)(451199024)(64100799003)(186009)(2906002)(5660300002)(86362001)(8936002)(316002)(6916009)(66946007)(66556008)(66476007)(4326008)(44832011)(8676002)(36756003)(41300700001)(1076003)(26005)(107886003)(2616005)(83380400001)(6666004)(6512007)(6506007)(38100700002)(478600001)(6486002)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6rxgpN9/+R/yJCiawKXS9HjhzxeyWbR4fiMRFm2sQUgkR1hTYl56VTpiFQI7jSYlrZOCjZGeSML7f3OrtPyKRwoOUWeytuJfFsfFOcGyTzFaqQYdtaUF+jWgSZvbriaF2awSS2QgpyBS/j5qME0kQrfzC0YX5h+wd7ZKkZhDCLAqyPo6FlFO76cqY1thOAPL2LGo/ML91SYtWO9VBjxGRRkw883m4F86m1Pw1hRkPYc/sSf44s9yBYLYFFYyi9k5l/ggwH6Eq8Ay2Gp5+hAhf55cKHm9znYucoFWev0iKYShRt21jFF2NbDCyPkP+bu/QTA88dYscQ8nGvdbWc9V+SpeDGGdBJHIVVlCFgnQ25nEJ2RUMnSDjCZAL/OAbiThF9PtQZjBlcPLAVQNI8SfDzQsH+o+kNLktRwMihlEKivREUc6B+UC4409axJs/auvtCZNSJC5BFusMdHqdAdFO0aBH+a3KvLdS41ahhJvXgYu32VU776YB7ol/YlpAuTpuWs9QE/WRNhje1UjPk/okd1W6lw8B4/C5PHZcs6J0ODfsbTpk6PTa1Wxq4sAvUrvYoLh5WFLhXGO4ICiOLyBfbvsHITIjXOXin6dXlccOYM7YXz9eHTrfqHCC9ZWExXAHhXj65wlIsXPfmBQhiOxC7r+UxgK4K3RtPNqDCkCTcVyrFLWUNUoG98IcttPoFrJ7h7Rm57oik5cmZQSjTnZ9O66zO1ZzPqSocgZFOEmQYgqm5vfnHdNh0RG9n+i+hB7DHCPC2BjPAySE7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DnhM9Kl9+PUFs7YARW9WLtuyr6O6wb12gGgHcnr9bYLTL0S2oFnrd+b6e9A1anFXDh/fPbGKXHn/hzqnzYOTFNEb7wZW8tykdva9x0T/QufTTOVLbAVtDWu6JnfA9qLL4w/6VPbJc5/qjij+oCjeu+RyOhYT07aWVqGYSTbPpbECX0BaJrJtA1pHajKsQrLth4Pok1yKIUts7f41vseD/utIyH4+EPSi7RI7oDqcHsEAFwTZAVubrwTux1wbVvvGmdOwxV6V5Cpn/GAPFYXL2aLciLBW+AWiis+wSfiiS16cqIV/Qlv+uY47Q+RYviZGzfRP4hMIIsMYlYkX57iyPkyrZbwDx5sv0EKacgEoumimRUszK4wnirTjGI7MvEqInTjKE4A74mpHR7EPGayGz341vw+H/a1+MfxP55BI3PHhpvJgKVxTqWBGWttvCe7aO+krdU2n0A5Xy6BSOe5Lhu5jU/I8419I4Gwsh7S5TL4ueMy55oQKvr286k4RvvI/jc+5c9j6AwV+dLeuQ/zgvdiRNlKkEU4NL/JNcWj2YbvrHvK/cEbRIa3XIYZcML2X+MkGXa2oBTaAlWJJIeRaH3o6Qffj+Ct14+OeS8AedUysDE25oBK9piVBTpRfQzfswYOAIpux1msWLQHjRT++Xu2NkbxDOWb3h2s+MXewTapSgpjsenP/qKTo4i6OF5+Q X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a86237d-fb2d-44ea-aea3-08dbdfd7e868 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4752.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2023 21:24:21.4983 (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: O6xDKvmHphtUL7vLsn5GA9jgGd1lY4Z0DoZU/qpIqA2UH+OB+jpN7TYPGfi2WaxLYrL2rTsXo+i8sH8aal/X7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB6366 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_13,2023-11-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311070177 X-Proofpoint-ORIG-GUID: MzSjj2qMhrb6vjYrgEuQcdtZ58XPtkpN X-Proofpoint-GUID: MzSjj2qMhrb6vjYrgEuQcdtZ58XPtkpN 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); The issue that reverted commit is fixing is fixed by last patch 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);