Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp106992pxb; Mon, 8 Feb 2021 16:51:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCo9Tdpf7/Ow6rM3noH4RBHfW/uWTzFxIINJwGnrYo9Tdwxx/CiF5uDQ8N5dT1hVBZDG3O X-Received: by 2002:a17:907:262b:: with SMTP id aq11mr13686471ejc.360.1612831896769; Mon, 08 Feb 2021 16:51:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612831896; cv=none; d=google.com; s=arc-20160816; b=1KDT8XfInDOftKmjpC70NuwdHl1BnKKA6AwubdgbQROy6szdYn/H3jgpnntkI63D/h 4YGfSV5XkkIRfnhGKRej6s2Fgzmwh4N1k3GzW7JIzlzfsIzoxHmLeRK0kVhpsMHzPJBk 14TwihwhoJiEYDFn/YrE97NGR2Jezc+C9Wrhod8UBLvHtAvwmLINKEMM/Us5mj7fiWSY oKcCY+vYqNp7YC+P+nBTP60rzAcoM6UTNTh/zG3B5oV1tGumLD7EPR0UV/Bm5UaWuefv WYJBS5cmHwOmvYFf34w0eE1hsFVR6GDY2jik7r3dw+Vf0hVB7d5bWPMX4VKGWzCGdnfy HjIQ== 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=4YebtuUi/PR5llRiWIYR0zec6xzvQl4vp+Fy366eVCg=; b=zqBGL3gAu1hVKj7nTv9NqqLUBWZHvPQJrBMpFcMLtJMWfg6stFNdSBL4E2Zsnw63dQ Svh+6Ow1TaHC4ymNXKWAMpdecnrn5j25/fCxyXXeUyka9Rnq/MjzHIZ92LgiyAUpDNHX XO8khg4xan3ZrLzZYtolanoQxMpvTV7o57f2xq+7y44FM2NpAkucwkRGk5Ys9qI8MAFi pS5k4oqexc7jVIUcaZc1naInuY/pwZjs8w5akJewhm4Sv6SliHHQMowTbju/8bEg5N2L YuOTQc+0XVrhDELfRqNsg745tjM8XvXoLGVKdtG8fD2LO5bBO6pL01vz63ZxsEycjfsw DkJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b=ViJ7zra8; 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 v5si13288564edc.346.2021.02.08.16.51.12; Mon, 08 Feb 2021 16:51:36 -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=ViJ7zra8; 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 S230329AbhBIAsG (ORCPT + 99 others); Mon, 8 Feb 2021 19:48:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbhBIAsE (ORCPT ); Mon, 8 Feb 2021 19:48:04 -0500 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDF1AC06178A for ; Mon, 8 Feb 2021 16:47:23 -0800 (PST) Received: by mail-ed1-x52e.google.com with SMTP id df22so21491495edb.1 for ; Mon, 08 Feb 2021 16:47:23 -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=4YebtuUi/PR5llRiWIYR0zec6xzvQl4vp+Fy366eVCg=; b=ViJ7zra8GXrMGdHHelVxDi2/PDb+5DOVThdaIkh3cydSjUqec9hN03QNewygoXDgLG jQ0fdBHa4Zso/j/Bf5s+wRCRJWg7ZfiJrOAwDd7z/h9oaFpRsDMhnB2NhkDiRtS6BgOP BnwftwwLYdU8yDfO6ADkvrMxehviTxfOwGW7vJiVqPOFUNLZexGSKaF+8gQQW4HUYZSQ pOTdEeUCr4+J1eSI4/C0DO5zmi4VeAkYUQfldYtnMeUH/x5t5lBkV1Ux2dWV/GzNkNXY KHkM88eI6e4jNRQkkASai4E6CrKXNXZ3xEZvjXqjVhsrVSNBFs59EP6yAEM5mahIUcfZ golw== 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=4YebtuUi/PR5llRiWIYR0zec6xzvQl4vp+Fy366eVCg=; b=cfsmQ1vWb6+F7pcwrJulZLbwl6HqIJDooc1crcprOave0I1ncF3H2B7uwNPpBxMshX u1mnff2qESE+FbNhxT5fQW+eDQwl7MSbkUIOL6l9UWa3Xs9MOi2rzQXp6frjuwxMJfm8 lLx5cRMP8fwFvAThoiMLQiEgNziQ+7fqtzmjVVZZnO9yvAXbbZWZY1qMVPom6+sYtqss 0ye7w7AVOmxMBPv6dMtuCFi3rgnBRm9Pu6z2Jm5nOP047Fbk/BmY6PCndlwd0dAIEF55 P1ugCJml7q/2AnfS5+LFYFh+5liTjxfe8NZZiknyQ4DiU16TEsQJB3D120Tw/wTqYELi MrPw== X-Gm-Message-State: AOAM530uFZitBMQqR50rm0IxQPNrcAZp+YQddfI6L8V2OjOjFPg6Wv5F QUhS/RH2P2xbLJVgf5wIyaMVYQ== X-Received: by 2002:a05:6402:17aa:: with SMTP id j10mr20203634edy.184.1612831642434; Mon, 08 Feb 2021 16:47:22 -0800 (PST) Received: from [0.0.0.0] ([2001:1438:4010:2540:8ad:59ed:fe2a:9dd9]) by smtp.gmail.com with ESMTPSA id ca15sm7060408edb.90.2021.02.08.16.46.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Feb 2021 16:47:21 -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: <37c158cb-f527-34f5-2482-cae138bc8b07@molgen.mpg.de> <55e30408-ac63-965f-769f-18be5fd5885c@molgen.mpg.de> <30576384-682c-c021-ff16-bebed8251365@molgen.mpg.de> <6c7008df-942e-13b1-2e70-a058e96ab0e9@cloud.ionos.com> <12f09162-c92f-8fbb-8382-cba6188bfb29@molgen.mpg.de> <6757d55d-ada8-9b7e-b7fd-2071fe905466@cloud.ionos.com> <93d8d623-8aec-ad91-490c-a414c4926fb2@molgen.mpg.de> <0bb7c8d8-6b96-ce70-c5ee-ba414de10561@cloud.ionos.com> <1cdfceb6-f39b-70e1-3018-ea14dbe257d9@cloud.ionos.com> <7733de01-d1b0-e56f-db6a-137a752f7236@molgen.mpg.de> From: Guoqing Jiang Message-ID: Date: Tue, 9 Feb 2021 01:46:26 +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: <7733de01-d1b0-e56f-db6a-137a752f7236@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 2/8/21 19:41, Donald Buczek wrote: > Dear Guoqing, > > On 08.02.21 15:53, Guoqing Jiang wrote: >> >> >> On 2/8/21 12:38, Donald Buczek wrote: >>>> 5. maybe don't hold reconfig_mutex when try to unregister >>>> sync_thread, like this. >>>> >>>>          /* resync has finished, collect result */ >>>>          mddev_unlock(mddev); >>>>          md_unregister_thread(&mddev->sync_thread); >>>>          mddev_lock(mddev); >>> >>> As above: While we wait for the sync thread to terminate, wouldn't it >>> be a problem, if another user space operation takes the mutex? >> >> I don't think other places can be blocked while hold mutex, otherwise >> these places can cause potential deadlock. Please try above two lines >> change. And perhaps others have better idea. > > Yes, this works. No deadlock after >11000 seconds, > > (Time till deadlock from previous runs/seconds: 1723, 37, 434, 1265, > 3500, 1136, 109, 1892, 1060, 664, 84, 315, 12, 820 ) Great. I will send a formal patch with your reported-by and tested-by. Thanks, Guoqing