Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp151859pxu; Wed, 2 Dec 2020 17:58:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYhufTf1PwdnJdSpMgLC0aXWxPGR/ONrQwe435APViwMcc8IM7KXDLIp2j4RHTmYLbIOJH X-Received: by 2002:aa7:cb02:: with SMTP id s2mr817680edt.211.1606960687598; Wed, 02 Dec 2020 17:58:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606960687; cv=none; d=google.com; s=arc-20160816; b=pUqF2hzmtfqdWK2Gpt7S7ShSmDo6U1I9E8JnHcP5+fDqBQvsMxvKER6/FhQn7dq8P6 5gp0qkxQGbA1CxXzMuJw0sv9RWEDBr4e0pjlarcUfezqrCzs+vzPx6ysA8nxewc7sGHb iZrTRWsIMfJ7Y7LYMd6hURLIT5SjzwGusm3HwWG4igb2rNk6h1RZEJzS2Wzyp3pdwtgE L5NU9p6I6h6PEC47EP5rMRPSPCpTc1eQfs1mPnyFn1KUmSNJKzzmMiufTCF+CPRSU58l jem/s2BGhaD2REL9xf1APY3o8lLj7WggvzQs6A0jmHMkdUsh2iM+J2UmoNTRH/LpPmbG xV0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=ubsR/qiIEFFmdKLf5Q808gVWgXuWA3n3kWhdn2997Tg=; b=bwpDtRjRHhWaAcr9xUs12CWywJT/UG+V9Pi4xxJQ81jIHaggFrDP+68tjAL1BzcvrP 1+KylQQkN2bxFsXY0Nen7MTPcFTvi3QPiVpytTlO7rFpH+vFPazA3NjIw/pPS70eyMno aY9tvjMGm3EkvtkYh2G/5pbJb1lWcJ7AVq68Py7cF3Al0gqCM7ZH1p5kPC68ZZ0eLelL btSMtPmzxmYlGYhGNgFtHBOYtRPxC7Xmk9Qx0M/274o1mrTNtyMhDNdZ8vDNqRJuLhoO kjmQy8IawwXlv6HpdwbN2vHFVPOVpJY+8QNEC/QaxEOpgSnVSMXaQepaWWbgK+61qsIS dLcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b=axaL3kQL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ionos.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq1si275719ejc.530.2020.12.02.17.57.44; Wed, 02 Dec 2020 17:58:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b=axaL3kQL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ionos.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726631AbgLCB4T (ORCPT + 99 others); Wed, 2 Dec 2020 20:56:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726314AbgLCB4S (ORCPT ); Wed, 2 Dec 2020 20:56:18 -0500 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB188C061A4D for ; Wed, 2 Dec 2020 17:55:32 -0800 (PST) Received: by mail-pg1-x536.google.com with SMTP id e23so400552pgk.12 for ; Wed, 02 Dec 2020 17:55:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.ionos.com; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=ubsR/qiIEFFmdKLf5Q808gVWgXuWA3n3kWhdn2997Tg=; b=axaL3kQLECQcxzv9hCQ2raEOybn1oj9gkHXYo5XJc682upYH/CE859ApndXH0j40/6 fLSzoXbYP1mFPO7k+SF5drxD86Pl6cUdUj4AaRRS/x+w90G7aJ9CTcafxKcIgmkeR5zQ QWxuelu7EyYcqU4AMayBQEUG9BnguZJu50CLeuSXDseDahnnoHmDIPVpri+hMNT096Y9 +ztPo2/kL6RW+6ohGfTF2JqbcQmdbvnqKMeBwuGl29GTAn0nof2z3+WaIoCO+hF+nCgi 3NJFc8vN/XgIiq9cN7VYOQar8nSlMMlBu7zAW5Kfcmid3mdYr5uNWP/X5tSpj42WqPy1 Jx2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ubsR/qiIEFFmdKLf5Q808gVWgXuWA3n3kWhdn2997Tg=; b=N3CPqvGN5Hc2mFMAgDczqsrMAkvEGItF01C/i16br4FsuGPjnELZ/RX626zC7EFyvr 1DvGsWkMCcF5wnZrTjsX0S2mVcmRKBiL/PdUT4zCZZaDGHjvuzm7zMjxDiNI3n1UTR7I P3+9LQiq7JyihLira6RHs489MphEwgk0HtsbBzVKiJ05pjt6jGGO59RyexWlicrtBNwM MQXtPUSK9Vn1hznUFjuczGB11cRItqyfbEdiPrBicOWRyYk/gujPMN1+6VnnXOWij2ES lt9+SUEMb631J5BJx5HC8oqdJwWogKmuCwiX5YBMUc+nZTYmmLlUymqSVVlNuMyQas0w 8JNw== X-Gm-Message-State: AOAM532clCqRgmqSs/i4X9y+QwDNWHvf3HhqDIzon01ov01a+lhWRZZQ Pkl5RjEbbov3AdcvNTxgkBIDYQ== X-Received: by 2002:a05:6a00:22c9:b029:198:15b2:bbd3 with SMTP id f9-20020a056a0022c9b029019815b2bbd3mr909217pfj.64.1606960531048; Wed, 02 Dec 2020 17:55:31 -0800 (PST) Received: from [10.8.0.104] ([196.245.9.44]) by smtp.gmail.com with ESMTPSA id o9sm149986pjl.11.2020.12.02.17.55.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2020 17:55:30 -0800 (PST) Subject: Re: md_raid: mdX_raid6 looping after sync_action "check" to "idle" transition To: Donald Buczek , Song Liu , linux-raid@vger.kernel.org, Linux Kernel Mailing List , it+raid@molgen.mpg.de References: <95fbd558-5e46-7a6a-43ac-bcc5ae8581db@cloud.ionos.com> <77244d60-1c2d-330e-71e6-4907d4dd65fc@molgen.mpg.de> <7c5438c7-2324-cc50-db4d-512587cb0ec9@molgen.mpg.de> From: Guoqing Jiang Message-ID: Date: Thu, 3 Dec 2020 02:55:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <7c5438c7-2324-cc50-db4d-512587cb0ec9@molgen.mpg.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Donald, On 12/2/20 18:28, Donald Buczek wrote: > Dear Guoqing, > > unfortunately the patch didn't fix the problem (unless I messed it up > with my logging). This is what I used: > >     --- a/drivers/md/md.c >     +++ b/drivers/md/md.c >     @@ -9305,6 +9305,14 @@ void md_check_recovery(struct mddev *mddev) >                             clear_bit(MD_RECOVERY_NEEDED, > &mddev->recovery); >                             goto unlock; >                     } I think you can add the check of RECOVERY_CHECK in above part instead of add a new part. >     +               if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) && >     +                   (!test_bit(MD_RECOVERY_DONE, &mddev->recovery) || >     +                    test_bit(MD_RECOVERY_CHECK, &mddev->recovery))) { >     +                       /* resync/recovery still happening */ >     +                       pr_info("md: XXX BUGFIX applied\n"); >     +                       clear_bit(MD_RECOVERY_NEEDED, > &mddev->recovery); >     +                       goto unlock; >     +               } >                     if (mddev->sync_thread) { >                             md_reap_sync_thread(mddev); >                             goto unlock; > > With pausing and continuing the check four times an hour, I could > trigger the problem after about 48 hours. This time, the other device > (md0) has locked up on `echo idle > > /sys/devices/virtual/block/md0/md/sync_action` , while the check of md1 > is still ongoing: Without the patch, md0 was good while md1 was locked. So the patch switches the status of the two arrays, a little weird ... What is the stack of the process? I guess it is same as the stack of 23333 in your previous mail, but just to confirm. > >     Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] > [multipath] >     md1 : active raid6 sdk[0] sdj[15] sdi[14] sdh[13] sdg[12] sdf[11] > sde[10] sdd[9] sdc[8] sdr[7] sdq[6] sdp[5] sdo[4] sdn[3] sdm[2] sdl[1] >           109394518016 blocks super 1.2 level 6, 512k chunk, algorithm > 2 [16/16] [UUUUUUUUUUUUUUUU] >           [=>...................]  check =  8.5% (666852112/7813894144) > finish=1271.2min speed=93701K/sec >           bitmap: 0/59 pages [0KB], 65536KB chunk >     md0 : active raid6 sds[0] sdah[15] sdag[16] sdaf[13] sdae[12] > sdad[11] sdac[10] sdab[9] sdaa[8] sdz[7] sdy[6] sdx[17] sdw[4] sdv[3] > sdu[2] sdt[1] >           109394518016 blocks super 1.2 level 6, 512k chunk, algorithm > 2 [16/16] [UUUUUUUUUUUUUUUU] >           [>....................]  check =  0.2% (19510348/7813894144) > finish=253779.6min speed=511K/sec >           bitmap: 0/59 pages [0KB], 65536KB chunk > > after 1 minute: > >     Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] > [multipath] >     md1 : active raid6 sdk[0] sdj[15] sdi[14] sdh[13] sdg[12] sdf[11] > sde[10] sdd[9] sdc[8] sdr[7] sdq[6] sdp[5] sdo[4] sdn[3] sdm[2] sdl[1] >           109394518016 blocks super 1.2 level 6, 512k chunk, algorithm > 2 [16/16] [UUUUUUUUUUUUUUUU] >           [=>...................]  check =  8.6% (674914560/7813894144) > finish=941.1min speed=126418K/sec >           bitmap: 0/59 pages [0KB], 65536KB chunk >     md0 : active raid6 sds[0] sdah[15] sdag[16] sdaf[13] sdae[12] > sdad[11] sdac[10] sdab[9] sdaa[8] sdz[7] sdy[6] sdx[17] sdw[4] sdv[3] > sdu[2] sdt[1] >           109394518016 blocks super 1.2 level 6, 512k chunk, algorithm > 2 [16/16] [UUUUUUUUUUUUUUUU] >           [>....................]  check =  0.2% (19510348/7813894144) > finish=256805.0min speed=505K/sec >           bitmap: 0/59 pages [0KB], 65536KB chunk > > A data point, I didn't mention in my previous mail, is that the > mdX_resync thread is not gone when the problem occurs: > >     buczek@done:/scratch/local/linux (v5.10-rc6-mpi)$ ps -Af|fgrep [md >     root       134     2  0 Nov30 ?        00:00:00 [md] >     root      1321     2 27 Nov30 ?        12:57:14 [md0_raid6] >     root      1454     2 26 Nov30 ?        12:37:23 [md1_raid6] >     root      5845     2  0 16:20 ?        00:00:30 [md0_resync] >     root      5855     2 13 16:20 ?        00:14:11 [md1_resync] >     buczek    9880  9072  0 18:05 pts/0    00:00:00 grep -F [md >     buczek@done:/scratch/local/linux (v5.10-rc6-mpi)$ sudo cat > /proc/5845/stack >     [<0>] md_bitmap_cond_end_sync+0x12d/0x170 >     [<0>] raid5_sync_request+0x24b/0x390 >     [<0>] md_do_sync+0xb41/0x1030 >     [<0>] md_thread+0x122/0x160 >     [<0>] kthread+0x118/0x130 >     [<0>] ret_from_fork+0x1f/0x30 > > I guess, md_bitmap_cond_end_sync+0x12d is the > `wait_event(bitmap->mddev->recovery_wait,atomic_read(&bitmap->mddev->recovery_active) > == 0);` in md-bitmap.c. > Could be, if so, then I think md_done_sync was not triggered by the path md0_raid6 -> ... -> handle_stripe. I'd suggest to compare the stacks between md0 and md1 to find the difference. Thanks, Guoqing