Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1628590rbb; Mon, 26 Feb 2024 16:28:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVEFmbNSkBk/JRnrS79pLfXuRE+lq/hR9QZmTYzaYyKx4T0z730JXydYKYNAspzWqIzmNeKqgwlXb+7xduosNYf1/4uc4/RjDsjJ/DKpA== X-Google-Smtp-Source: AGHT+IH2Knpem7UXb62rpsYzr1d0rS8P/gCd4SaKYl53vmxjrsO/xyChzMv5xtfqbQcT9YbkpfbU X-Received: by 2002:a05:6a20:9f43:b0:19e:a1ae:944e with SMTP id ml3-20020a056a209f4300b0019ea1ae944emr898222pzb.37.1708993686484; Mon, 26 Feb 2024 16:28:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708993686; cv=pass; d=google.com; s=arc-20160816; b=1D994xZO5MMHCwR4Y/jQ1khjuNUWLkAYm7wIOqUWIJLR14cyTZMFPAvVoH7iUg//eb fmuJB+KE7UGic5qi6rjLHNgkfrRY0wu2T5WwsOXetPvEiYXTKtCmC3vKU4vgpFFk8AW7 3W+cof6sVBjyC0UFUEfEHfktycvDE3PoaCRsHYCrZt3NxZ+u/TtrNsq20PCG6GBufIon B2Gd5CdRz+PMqs6UOWWajSG+8Sp/FUOuTO7aYi4WA0MesPZ4USfv/mjL2fatFHCirh8s Mk8UEQIzl4DUb2hKn9nl2kZyORa7wWcCza1pEgfGKMpE4GB59M7r1T3jsIi7f3a6h0Tx DPxg== 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=C+Zj4ZeRl9xniul0YQKQvDPTEYnuZcbWMVmxB4YKIx4=; fh=Hik3/9F8DEg5HdLfLNo7rsLQ0/65lLWBgHJDoekM/ok=; b=tnYf28S8M7UQ+wHbcsgwqxJygoyFzv3b4SNovFabfJXIdZaEF8LB1fwWwOLca33rE1 sdQVXFEs1JzOAX4HQe1K0b8IvVtknIcm8SRmY+Eb4ap9a+dE3H3u54sP3WdlnsGTgNNm r13PXENw/llUQa2w6FhWTK6RFCRnhVfGTpxYXWPwGXKiW+i/S9HYGd8cqMtlzWH13I7h 5+OwsNhMuHqd3it6wToT1a8FRXDlBLtD6Oox7cEk0dkWNrAmdzByP4nX4f+92/X6Wp4r iUVjFsGeCT2zcoZm5Z9mv1IRZccYKAtw7SmE/VcWrd9id4AlaPDK5X9cLqij/NKLD9H2 vtLw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NkHvVptb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-82465-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82465-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id nn3-20020a17090b38c300b00295e3413670si4607972pjb.131.2024.02.26.16.28.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 16:28:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82465-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NkHvVptb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-82465-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82465-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 361D228487D for ; Tue, 27 Feb 2024 00:28:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DAD96A2A; Tue, 27 Feb 2024 00:27:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NkHvVptb" 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 0218236D; Tue, 27 Feb 2024 00:27:57 +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=1708993678; cv=none; b=k9HMMIhxBglm6IHfeJMATuNJvyuVPEFxNYI3niwZDa0NwgfdZxr7YOLKYBCjsrOheO7wp+IzQUiC3E1FbT01n/1XI8iiKdw1khYegR3wd886FToVtVMzRf4+vR7guMKdEjAVo8zeOmEDINLQn5QYMm8N+fCnSk6CH06K9OevD5k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708993678; c=relaxed/simple; bh=C+Zj4ZeRl9xniul0YQKQvDPTEYnuZcbWMVmxB4YKIx4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Nqta7OdEIvwP8gtxaLFyYsDQ8UGF9gHs/p5+6u3AdnjXsqi0JvRflQBYF4kInrjSAPaa7oiltB1M5e2zlzdKWialhrq3HJV3By43siSxZ7w3Jhdckw9VrY2tOyDon21SXehK/kpqBjMvGI24KdVQaAIK3B6nX5KWFB8hqPbHvdk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NkHvVptb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D53EC433F1; Tue, 27 Feb 2024 00:27:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708993677; bh=C+Zj4ZeRl9xniul0YQKQvDPTEYnuZcbWMVmxB4YKIx4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=NkHvVptbCa+YYCoeu9gbS7T8svI//6e2fW16F86blmbRjli3ub+4RuexZOZ44W/HN 0eWoIQaG0pMogT43b3pXqApDemu88EaqZM3iEzPWHGSE6Uw+Qh9B1ydgXmA4bn7i4o ugn1NR6NMI+YMfjyvFlmOt0QbMnopgrkNnJYGB+Atrsf97Q0tclPhE9QouoK/l12I7 Wgce593jWf3VdRNHrVgIWj9KyHdepJytMeppch5q1Yj/2aJN5BPL6Ox3z3BxIdaZqv MBfK+P6KSwiHlMhSEkhuV4HnGApdkVDNy93RGPSg/MYuFw8uT/t8SDax4bCYYT9ugP KVA4dBDSxArzg== Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-512fe342841so1260271e87.0; Mon, 26 Feb 2024 16:27:57 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVnVM75WUq9Lu2elP/B9k3462xTefJObiMf6FYdW22FfOPpylt6Wg7WLikeQtk5/DKqsxdNQe1pM2tOw6k5QBibKGktmst0tLJDna2LnSBUJ3jGYnXfkDhAy6b8cUhmJqocOKXE3yEqHw== X-Gm-Message-State: AOJu0Yw5i+Cxrkb2U50Gh9kmtnUT/Ryg97cdPSFxIbXY8DRNHZqK0VRb ytjxCsx72Heiq2/leEg8ZrZIT3yhPk16QobGsNjbTeulsky8lWaX8uXXzgUH/kcdYBY5QHudDrj lK07Q7ZSOnSNdBA/BPorLSfMf9Mw= X-Received: by 2002:a05:6512:3b07:b0:512:f6d8:834f with SMTP id f7-20020a0565123b0700b00512f6d8834fmr2470425lfv.8.1708993675689; Mon, 26 Feb 2024 16:27:55 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240222075806.1816400-1-yukuai1@huaweicloud.com> In-Reply-To: <20240222075806.1816400-1-yukuai1@huaweicloud.com> From: Song Liu Date: Mon, 26 Feb 2024 16:27:43 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH md-6.9 00/10] md/raid1: refactor read_balance() and some minor fix To: Yu Kuai Cc: paul.e.luse@linux.intel.com, neilb@suse.com, shli@fb.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com, yangerkun@huawei.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Kuai and Paul, On Thu, Feb 22, 2024 at 12:03=E2=80=AFAM Yu Kuai = wrote: > > From: Yu Kuai > > The orignial idea is that Paul want to optimize raid1 read > performance([1]), however, we think that the orignial code for > read_balance() is quite complex, and we don't want to add more > complexity. Hence we decide to refactor read_balance() first, to make > code cleaner and easier for follow up. > > Before this patchset, read_balance() has many local variables and many > braches, it want to consider all the scenarios in one iteration. The > idea of this patch is to devide them into 4 different steps: > > 1) If resync is in progress, find the first usable disk, patch 5; > Otherwise: > 2) Loop through all disks and skipping slow disks and disks with bad > blocks, choose the best disk, patch 10. If no disk is found: > 3) Look for disks with bad blocks and choose the one with most number of > sectors, patch 8. If no disk is found: > 4) Choose first found slow disk with no bad blocks, or slow disk with > most number of sectors, patch 7. Thanks for your great work in this set. It looks great. Please address feedback from folks and send v2. We can still get this in 6.9 merge window. Thanks, Song