Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp849278rdb; Mon, 29 Jan 2024 23:35:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOaT766Yeuv3DOQeCTakeHOxvZ8Se4Yu3Nmq8QTrQ28N6WTVCU/i4h7IBXWfAl5P3ZkSW6 X-Received: by 2002:a17:906:2ad7:b0:a35:3faf:c8d1 with SMTP id m23-20020a1709062ad700b00a353fafc8d1mr764752eje.22.1706600104533; Mon, 29 Jan 2024 23:35:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706600104; cv=pass; d=google.com; s=arc-20160816; b=wgDqWjE+/Pjy1gTXgmo/vSgX+iIFNdu98PgaOZLwIVqZR9LySj8+TA/1SDgPBHatqt iWobipYH1Ge/k5D35TLNCNojpn6FTJuQSi99A/FlwFa6ktLPCIjHB+NxZf13aYNc4ahH nq5+EJ3Yb6XLMn3TGTDaKv+IKyK/dXQhzA2EZUwozxK/XeUb+qdDR6P1ExXu7klxgJ/h LB7VFtqApqe8Wi9ns819i2GoC+qYsjzu3dG1K/A01VkJZVsdgzJg8LgP1+d2PESWxcfF m8yRDr1aF8luStzgosCfa1cGjO472Pdx3rZUVpOA3BQx8X7JRJl/iRU6dvK4g3bHguZc L1Bg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=KvFsmUoLhgumhnNE9K1k1XmKWMGBeMww/eZ/QAnK7Ag=; fh=NyromVBodcZuksWrMxjVIgEXnxxJCg/ro+FrpwyRxKo=; b=SROXFMQ4VwH4syLK9Rf3MhTOYessA8Z2qluUL0pmftV0tE9iLSKxYg/h/4xF2pMhok 15pE90KuMr2RyMmv1kDvDauPqTm2ENgh4Wq8fjh69XSWqQXIpFenvOPIrFTqdyozL+me ThCE4Nk1teGRaa/caOUsXlq71ujpjVa8AVuihgkcVgX93EC4lDkBLtTJQET2ZS01gF83 /8yOUQxIfLtVUUd/8qITHI0ezDRMbUX7+vVu/oW3bWF8x2MK/ZKmFbKSm33CMkXQBzEh JRNuJiMQY5aoX6MjGBQpfpvKz+UGe5uziGOPokOeuAKY6i6fXUgqVuSsF5hVcuy5o/Hd o0Og== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fUH9ODaA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44049-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44049-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u26-20020a170906069a00b00a35dea0b1e8si1136692ejb.69.2024.01.29.23.35.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 23:35:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44049-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fUH9ODaA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44049-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44049-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4A1EA1F23362 for ; Tue, 30 Jan 2024 07:35:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D470537F8; Tue, 30 Jan 2024 07:34:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fUH9ODaA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44E7050A70; Tue, 30 Jan 2024 07:34:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706600095; cv=none; b=UUNrq/+7OcKYmnGBtap52mjjaLgNfdur8tQH8kEPjPcli9VJveWM8YfcmgHjCAG7lHKzRvPTeCsCDjz1o6I3CrmtpwgbMYeds3jWNj4feKZkBExduVMd5GJ1E2ZBmynPXAOFgvjqg1xAuNe/d90SVOxnOALpCWaqxn57k7K+XQg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706600095; c=relaxed/simple; bh=+IitaL70UEF1t6zrG6EiCU/A4cZoDZjvNxzIBHHtxwU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=pXSNqKsuKUtFd0VGg7YjgQJq046mh8KgwhSxVOt+ePEHfx+QRpnnyKUrc8ZA6nY9kLXpTVqREBa1rW0sLRxzjSRGcYKcIe6pA8VbjwhKpwHDWvktLdbHGf+PRQ0KEglXwr+01yaDfY6bDpjRYlRU0VoAiFmYAvXF3mBhbzIATBg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fUH9ODaA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF28DC433C7; Tue, 30 Jan 2024 07:34:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706600094; bh=+IitaL70UEF1t6zrG6EiCU/A4cZoDZjvNxzIBHHtxwU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fUH9ODaA6KMFHk8ZZMI2XMd6FeBC0koIc9yyrKMr8ds1sD5HpL2o+ni7OhzTgmzxj 4LmTg8+6YLvG2F+KQuzAO8N/LLiVqwgTri5EHIIxiaYiAyzfgQw75nQQAJp16JCGRG QzdkyK3FzH76ZqI+vQY5ZdCjqkMaS26ivTUf4wAYjvWd96OKGsEI8GGI36qVIs8JRg ja87hmrw5++mWUGRZNHzwzbX/EEj4jjdjzyIW3SlIDVJTw1FWOuTbWkyEnVwWtKlES Fxpb7OKsVYqBydClN22VNLGAxNS7sbuBrEEXSh4rhuXlqcLFQfOFlBbXtsO9aezdMD Yg0b3Pf2gtoQg== Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2cf33b909e8so46732271fa.0; Mon, 29 Jan 2024 23:34:54 -0800 (PST) X-Gm-Message-State: AOJu0Ywv6cDDu2/CApvL1DgIW73PlKxUgc+0jmmw+w6OY5pA+VzhVr1a PDxZaaX18u7IbTCAVNCDa9j2sCxPC+zTeio3+1TNv11MkhO5hPoAQa05s7miiS73JghzIfdpKci /Cdv3QL4C0KlUhfDP2lvM+qktxyI= X-Received: by 2002:a05:651c:2db:b0:2ce:fc69:47fd with SMTP id f27-20020a05651c02db00b002cefc6947fdmr281501ljo.16.1706600092822; Mon, 29 Jan 2024 23:34:52 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231228125553.2697765-1-yukuai1@huaweicloud.com> <20231228125553.2697765-4-yukuai1@huaweicloud.com> <864b3e44-ba1b-3bfe-c17e-3e6048fbea01@huaweicloud.com> In-Reply-To: <864b3e44-ba1b-3bfe-c17e-3e6048fbea01@huaweicloud.com> From: Song Liu Date: Mon, 29 Jan 2024 23:34:41 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH -next 3/3] md: use interruptible apis in idle/frozen_sync_thread() To: Yu Kuai Cc: neilb@suse.de, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, yangerkun@huawei.com, "yukuai (C)" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 29, 2024 at 11:04=E2=80=AFPM Yu Kuai = wrote: > > Hi, > > =E5=9C=A8 2024/01/30 14:37, Song Liu =E5=86=99=E9=81=93: > > Hi, > > > > Sorry for the late reply. > > > > The first two patches of the set look good, so I applied them to > > md-tmp-6.9 branch. However, this one needs a respin. > > We are fixing dm-raid regressions, so I'll not send a new version until > that work is done. :) Sure. Fixing the regression is more urgent. > > > > On Thu, Dec 28, 2023 at 4:58=E2=80=AFAM Yu Kuai wrote: > >> > >> From: Yu Kuai [...] > > I found prepare_to_stop_sync_thread very hard to reason. Please try to > > rephrase the comment or refactor the code. Maybe it makes sense to put > > the following logic and its variations to a separate function: > > > > if (prepare_to_stop_sync_thread(mddev, false)) { > > wait_event(resync_wait, sync_thread_stopped(mddev, NUL= L)); > > mddev_lock_nointr(mddev); > > } > > I can do this, but there are 5 callers and only two of them can use the > separate caller. Pehaps something like this? > > void stop_sync_thread(struct mddev *mddev, bool wait_sb) > { > if (prepare_to_stop_sync_thread(mddev, wait_sb)) { > wait_event(resync_wait, ...); > if (!wait_sb) { > mddev_lock_nointr(mddev); > return; > } > } > > if (wait_sb) { > wait_event(sb_wait, ...); > mddev_lock_nointr(mddev); > } > } I don't really like this version either. Let's think more about this after fixing the dm-raid regressions. Thanks, Song > > int stop_sync_thread_interruptible(struct mddev *mddev, bool check_sync_s= eq) > { > ... > }