mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Ghiti <alex@ghiti.fr>
To: Dennis Zhou <dennis@kernel.org>,
	yunhui cui <cuiyunhui@bytedance.com>,
	Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [External] [PATCH] riscv: Fix wrong size passed to local_flush_tlb_range_asid()
Date: Wed, 24 Jan 2024 09:38:30 +0100	[thread overview]
Message-ID: <cd68cf4e-7a6b-4875-ae1b-0c28a6eacaad@ghiti.fr> (raw)
In-Reply-To: <ZbDICZkatO3/lGf/@snowbird>

Hi Dennis, Yunhui,

On 24/01/2024 09:19, Dennis Zhou wrote:
> Hello,
>
> On Wed, Jan 24, 2024 at 10:44:12AM +0800, yunhui cui wrote:
>> Hi Alexandre,
>>
>> On Tue, Jan 23, 2024 at 9:31 PM Alexandre Ghiti <alexghiti@rivosinc.com> wrote:
>>> local_flush_tlb_range_asid() takes the size as argument, not the end of
>>> the range to flush, so fix this by computing the size from the end and
>>> the start of the range.
>>>
>>> Fixes: 7a92fc8b4d20 ("mm: Introduce flush_cache_vmap_early()")
>>> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
>>> ---
>>>   arch/riscv/mm/tlbflush.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c
>>> index 8d12b26f5ac3..9619965f6501 100644
>>> --- a/arch/riscv/mm/tlbflush.c
>>> +++ b/arch/riscv/mm/tlbflush.c
>>> @@ -68,7 +68,7 @@ static inline void local_flush_tlb_range_asid(unsigned long start,
>>>
>>>   void local_flush_tlb_kernel_range(unsigned long start, unsigned long end)
>>>   {
>>> -       local_flush_tlb_range_asid(start, end, PAGE_SIZE, FLUSH_TLB_NO_ASID);
>>> +       local_flush_tlb_range_asid(start, end - start, PAGE_SIZE, FLUSH_TLB_NO_ASID);
>>>   }
> Well this was a miss during code review.. I'm going to take another look
> tomorrow and then likely pull this into a fixes branch.
>
>> What makes me curious is that this patch has not been tested?
>> BTW, It is best to keep the parameter order of all functions in
>> tlbflush.c consistent: cpumask, start, size, stride, asid.
>>
> I can't speak to the riscv communities testing/regression suites, but
> this would only be caught in a performance regression test.
>
> That being said, Alexandre, can you please lmk what level of testing
> this has gone through?


All my patches go through the same level of testing:

* Build/boot an Ubuntu kernel with and without KASAN + a few simple 
testsuites (libhugetlbfs, riscv kselftests and other)
* Build/boot a simple rootfs on ~40 different rv64 configs
* Build/boot a simple rootfs on ~30 different rv32 configs

And I run LTP/full kselftests/perf testsuite on a weekly basis on every 
rc. All this validation is done on qemu.

The patch is functional, it "simply" flushes the whole TLB instead of a 
few entries, so the only way to catch that would have been a performance 
regression. But given it only runs on qemu, it would have been hard to 
catch any performance regression since that involves the TLB.

@Yunhui: Please let me know how I should validate my patches better.

Thanks,

Alex


> Thanks,
> Dennis
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2024-01-24  8:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 13:27 Alexandre Ghiti
2024-01-24  2:44 ` [External] " yunhui cui
2024-01-24  8:19   ` Dennis Zhou
2024-01-24  8:38     ` Alexandre Ghiti [this message]
2024-01-24  8:41       ` Alexandre Ghiti
2024-01-29  1:43         ` yunhui cui
2024-01-29  9:01 ` Dennis Zhou
2024-01-29  9:04   ` Alexandre Ghiti
2024-01-31 20:34   ` Palmer Dabbelt
2024-02-01  3:45     ` Dennis Zhou
2024-02-09 16:41       ` Palmer Dabbelt

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=cd68cf4e-7a6b-4875-ae1b-0c28a6eacaad@ghiti.fr \
    --to=alex@ghiti.fr \
    --cc=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=cuiyunhui@bytedance.com \
    --cc=dennis@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.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

all inboxes | Powered by JetHome®