From: Yu Kuai <yukuai3@huawei.com>
To: Uros Bizjak <ubizjak@gmail.com>, <linux-raid@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: Song Liu <song@kernel.org>,
"yangerkun@huawei.com" <yangerkun@huawei.com>
Subject: Re: [PATCH] md/raid5-ppl: Use atomic64_inc_return() in ppl_new_iounit()
Date: Tue, 8 Oct 2024 15:07:24 +0800 [thread overview]
Message-ID: <8de92255-dc6f-eb42-3ee5-5d7259c7616d@huawei.com> (raw)
In-Reply-To: <20241007084831.48067-1-ubizjak@gmail.com>
在 2024/10/07 16:48, Uros Bizjak 写道:
> Use atomic64_inc_return(&ref) instead of atomic64_add_return(1, &ref)
> to use optimized implementation and ease register pressure around
> the primitive for targets that implement optimized variant.
>
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> Cc: Song Liu <song@kernel.org>
> Cc: Yu Kuai <yukuai3@huawei.com>
LGTM
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
> ---
> drivers/md/raid5-ppl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c
> index a70cbec12ed0..37c4da5311ca 100644
> --- a/drivers/md/raid5-ppl.c
> +++ b/drivers/md/raid5-ppl.c
> @@ -258,7 +258,7 @@ static struct ppl_io_unit *ppl_new_iounit(struct ppl_log *log,
> memset(pplhdr->reserved, 0xff, PPL_HDR_RESERVED);
> pplhdr->signature = cpu_to_le32(ppl_conf->signature);
>
> - io->seq = atomic64_add_return(1, &ppl_conf->seq);
> + io->seq = atomic64_inc_return(&ppl_conf->seq);
> pplhdr->generation = cpu_to_le64(io->seq);
>
> return io;
>
next prev parent reply other threads:[~2024-10-08 7:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 8:48 [PATCH] md/raid5-ppl: Use atomic64_inc_return() in ppl_new_iounit() Uros Bizjak
2024-10-08 7:07 ` Yu Kuai [this message]
2024-10-08 7:38 ` Artur Paszkiewicz
2024-10-18 16:00 ` Song Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8de92255-dc6f-eb42-3ee5-5d7259c7616d@huawei.com \
--to=yukuai3@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=song@kernel.org \
--cc=ubizjak@gmail.com \
--cc=yangerkun@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox