[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3d8859bc-80d6-08b0-fd40-8874df4d3419@linux.dev>
Date: Fri, 2 Sep 2022 17:42:42 +0800
From: Guoqing Jiang <guoqing.jiang@...ux.dev>
To: Yu Kuai <yukuai1@...weicloud.com>, song@...nel.org
Cc: linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org,
yukuai3@...wei.com, yi.zhang@...wei.com
Subject: Re: [PATCH -next 2/3] md/raid10: convert resync_lock to use seqlock
Hi,
On 8/29/22 9:15 PM, Yu Kuai wrote:
> +static bool wait_barrier_nolock(struct r10conf *conf)
> +{
> + unsigned int seq = raw_read_seqcount(&conf->resync_lock.seqcount);
> +
> + if (seq & 1)
> + return false;
> +
> + if (READ_ONCE(conf->barrier))
> + return false;
> +
> + atomic_inc(&conf->nr_pending);
> + if (!read_seqcount_retry(&conf->resync_lock.seqcount, seq))
I think 'seq' is usually get from read_seqcount_begin.
> + return true;
> +
> + atomic_dec(&conf->nr_pending);
> + return false;
> +
Thanks,
Guoqing
Powered by blists - more mailing lists