All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vasilev Oleg <vasilev.oleg@huawei.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: "peter.maydell@linaro.org" <peter.maydell@linaro.org>,
	Konobeev Vladimir <konobeev.vladimir@huawei.com>,
	Plotnik Nikolay <plotnik.nikolay@huawei.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Andrey Shinkevich <andrey.shinkevich@huawei.com>,
	"Emilio G. Cota" <cota@braap.org>,
	"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
	"Chengen (William, FixNet)" <chengen@huawei.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: Suggestions for TCG performance improvements
Date: Mon, 6 Dec 2021 19:40:24 +0000	[thread overview]
Message-ID: <35631f7cceb141879aa7475ccaf81acb@huawei.com> (raw)
In-Reply-To: 87v905wq6d.fsf@linaro.org

On 12/3/2021 8:32 PM, Alex Bennée wrote:
> Vasilev Oleg <vasilev.oleg@huawei.com> writes:
>
>> On 12/2/2021 7:02 PM, Alex Bennée wrote:
>>
>>> Vasilev Oleg <vasilev.oleg@huawei.com> writes:
...skipped...
>>> I did ponder a debug mode which would keep the last N tables dropped by
>>> tlb_mmu_resize_locked and then measure the differences in the entries
>>> before submitting the free to an rcu tasks.
>>>> The mentioned paper[4] also describes other possible improvements.
>>>> Some of those are already implemented (such as victim TLB and dynamic
>>>> size for TLB), but others are not (e.g. TLB lookup uninlining and
>>>> set-associative TLB layer). Do you think those improvements
>>>> worth trying?
>>> Anything is worth trying but you would need hard numbers. Also its all
>>> too easy to target micro benchmarks which might not show much difference
>>> in real world use. 
>> The  mentioned paper presents some benchmarking, e. g. linux kernel
>> compilation and some other stuff. Do you think those shouldn't be
>> trusted?
> No they are good. To be honest it's the context switches that get you.
> Look at "info jit" between a normal distro and a initramfs shell. Places
> where the kernel is switching between multiple maps means a churn of TLB
> data.
>
> See my other post with a match of "msr ttrb"
Sorry, couldn't find what you are referring to. Could you, please, share
a link?
>>>> Another idea for decreasing occurence of TLB refills is to make TBs key
>>>> in htable independent of physical address. I assume it is only needed
>>>> to distinguish different processes where VAs can be the same.
>>>> Is that assumption correct?
>> This one, what do you think? Can we replace physical address as part
>> of a key in TB htable with some sort of address space identifier?
> Hmm maybe - so a change in ASID wouldn't need a total flush?

No, I think it would need a flush since regular memory accesses need to
be in the correct address space. But, we won't need to access TLB when
looking for the next TB. Also, TLB wouldn't need to be filled with code
pages, only data pages.

Overall, thanks for your feedback on those ideas.

Oleg


...skipped...



WARNING: multiple messages have this Message-ID (diff)
From: Vasilev Oleg via <qemu-devel@nongnu.org>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: "peter.maydell@linaro.org" <peter.maydell@linaro.org>,
	Konobeev Vladimir <konobeev.vladimir@huawei.com>,
	Plotnik Nikolay <plotnik.nikolay@huawei.com>,
	 Richard Henderson <richard.henderson@linaro.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Andrey Shinkevich <andrey.shinkevich@huawei.com>,
	"Emilio G. Cota" <cota@braap.org>,
	"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
	"Chengen (William, FixNet)" <chengen@huawei.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: Suggestions for TCG performance improvements
Date: Mon, 6 Dec 2021 19:40:24 +0000	[thread overview]
Message-ID: <35631f7cceb141879aa7475ccaf81acb@huawei.com> (raw)
In-Reply-To: 87v905wq6d.fsf@linaro.org

On 12/3/2021 8:32 PM, Alex Bennée wrote:
> Vasilev Oleg <vasilev.oleg@huawei.com> writes:
>
>> On 12/2/2021 7:02 PM, Alex Bennée wrote:
>>
>>> Vasilev Oleg <vasilev.oleg@huawei.com> writes:
...skipped...
>>> I did ponder a debug mode which would keep the last N tables dropped by
>>> tlb_mmu_resize_locked and then measure the differences in the entries
>>> before submitting the free to an rcu tasks.
>>>> The mentioned paper[4] also describes other possible improvements.
>>>> Some of those are already implemented (such as victim TLB and dynamic
>>>> size for TLB), but others are not (e.g. TLB lookup uninlining and
>>>> set-associative TLB layer). Do you think those improvements
>>>> worth trying?
>>> Anything is worth trying but you would need hard numbers. Also its all
>>> too easy to target micro benchmarks which might not show much difference
>>> in real world use. 
>> The  mentioned paper presents some benchmarking, e. g. linux kernel
>> compilation and some other stuff. Do you think those shouldn't be
>> trusted?
> No they are good. To be honest it's the context switches that get you.
> Look at "info jit" between a normal distro and a initramfs shell. Places
> where the kernel is switching between multiple maps means a churn of TLB
> data.
>
> See my other post with a match of "msr ttrb"
Sorry, couldn't find what you are referring to. Could you, please, share
a link?
>>>> Another idea for decreasing occurence of TLB refills is to make TBs key
>>>> in htable independent of physical address. I assume it is only needed
>>>> to distinguish different processes where VAs can be the same.
>>>> Is that assumption correct?
>> This one, what do you think? Can we replace physical address as part
>> of a key in TB htable with some sort of address space identifier?
> Hmm maybe - so a change in ASID wouldn't need a total flush?

No, I think it would need a flush since regular memory accesses need to
be in the correct address space. But, we won't need to access TLB when
looking for the next TB. Also, TLB wouldn't need to be filled with code
pages, only data pages.

Overall, thanks for your feedback on those ideas.

Oleg


...skipped...




  reply	other threads:[~2021-12-06 19:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02  9:47 Suggestions for TCG performance improvements Vasilev Oleg
2021-12-02 15:31 ` Alex Bennée
2021-12-02 15:31   ` Alex Bennée
2021-12-03 16:21   ` Vasilev Oleg
2021-12-03 16:21     ` Vasilev Oleg via
2021-12-03 17:27     ` Alex Bennée
2021-12-03 17:27       ` Alex Bennée
2021-12-06 19:40       ` Vasilev Oleg [this message]
2021-12-06 19:40         ` Vasilev Oleg via
2021-12-06 21:09         ` Alex Bennée
2021-12-06 21:09           ` Alex Bennée
2021-12-03  5:21 ` Emilio Cota
2021-12-03  5:21   ` Emilio Cota
2021-12-03  6:30   ` Richard Henderson
2021-12-03  6:30     ` Richard Henderson

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=35631f7cceb141879aa7475ccaf81acb@huawei.com \
    --to=vasilev.oleg@huawei.com \
    --cc=alex.bennee@linaro.org \
    --cc=andrey.shinkevich@huawei.com \
    --cc=chengen@huawei.com \
    --cc=cota@braap.org \
    --cc=konobeev.vladimir@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=plotnik.nikolay@huawei.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.