loongarch.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Tao Cui <cuitao@kylinos.cn>
To: Huacai Chen <chenhuacai@kernel.org>, Bibo Mao <maobibo@loongson.cn>
Cc: zhaotianrui@loongson.cn, loongarch@lists.linux.dev, kernel@xen0n.name
Subject: Re: [PATCH] LoongArch/KVM: Simplify _kvm_pte_init with memset64
Date: Wed, 29 Apr 2026 16:23:11 +0800	[thread overview]
Message-ID: <08049275-494f-46e1-8f74-5c5451f1fd17@kylinos.cn> (raw)
In-Reply-To: <CAAhV-H5Hat1rJywzw2CoLZYf=+hXea35zsvT+xyBOxPVk0z0ZA@mail.gmail.com>


>>>
>> what is the benefit of memset64() here? I think that 8x loop unrolling
>> is better from performance side. The page size is 16K or 4K and buffer
>> is large enough, unrolling seems to be better.
> I agree.
> 
> Huacai
>>
>> Regards
>> Bibo Mao
>>

Thanks a lot for your review, Bibo and Huacai.
You are absolutely right. When I looked at the usage of this function, I only intended to make the implementation functionally simpler, but overlooked the performance benefits of the loop unrolling. With PTRS_PER_PTE = 2048, the generic implementation is indeed less performant than the current version with 8-fold loop unrolling.

Thanks.
--
Tao Cui

      reply	other threads:[~2026-04-29  8:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 13:11 [PATCH] LoongArch/KVM: Simplify _kvm_pte_init with memset64 Tao Cui
2026-04-29  7:31 ` Bibo Mao
2026-04-29  7:41   ` Huacai Chen
2026-04-29  8:23     ` Tao Cui [this message]

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=08049275-494f-46e1-8f74-5c5451f1fd17@kylinos.cn \
    --to=cuitao@kylinos.cn \
    --cc=chenhuacai@kernel.org \
    --cc=kernel@xen0n.name \
    --cc=loongarch@lists.linux.dev \
    --cc=maobibo@loongson.cn \
    --cc=zhaotianrui@loongson.cn \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).