linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Akira Tsukamoto <akira.tsukamoto@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Qiu Wenbo <qiuwenbo@kylinos.com.cn>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 1/1] riscv: __asm_copy_to-from_user: Optimize unaligned memory access and pipeline stall
Date: Tue, 20 Jul 2021 00:22:37 +0900	[thread overview]
Message-ID: <97ee158e-0fe8-cd7a-6ee2-35f9018838de@gmail.com> (raw)
In-Reply-To: <CAMuHMdVMi8zfmSiZ0vnvCcsZQua_LKXpNAQVmRUdBKxNay=f-w@mail.gmail.com>

Hi Geert,

On 7/19/2021 11:49 PM, Geert Uytterhoeven wrote:
> Hi Tsukamoto-san,
> 
> On Mon, Jul 19, 2021 at 2:53 PM Akira Tsukamoto
> <akira.tsukamoto@gmail.com> wrote:
>> This patch will reduce cpu usage dramatically in kernel space especially
>> for application which use sys-call with large buffer size, such as
>> network applications. The main reason behind this is that every
>> unaligned memory access will raise exceptions and switch between s-mode
>> and m-mode causing large overhead.
> 
> [...]
> 
>> Signed-off-by: Akira Tsukamoto <akira.tsukamoto@gmail.com>
> 
> Thanks for your patch!

Thanks for trying!

> 
> As v3 is part of v5.14-rc1, all fixes and improvements need to be
> send as incremental patches.

Yeah, I was not paying attention to v5.14-rc1. Will regenerate it 
when I spot the remaining bug on rv32.

> 
> After reverting ca6eaaa210deec0e ("riscv: __asm_copy_to-from_user:
> Optimize unaligned memory access and pipeline stall") and applying
> v4, booting linux-on-litex-vexriscv still fails, but now differently
> (real crash):

This time it looks like under copy instead of overrun copy last time.
The SZREG, LGREG, REG_L and REG_S should been taking care of the 
difference of rv32 and rv64, but probably still forgetting applying
some places.

Akira

> 
>     /bi�����V�F-: applet not found
>     2'�����t: applet not found
>     Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
>     CPU: 0 PID: 1 Comm: init Not tainted
> 5.14.0-rc2-orangecrab-01933-g5c9574869017 #357
>     Call Trace:
>     Unable to handle kernel NULL pointer dereference at virtual address 00000af0
>     Oops [#1]
>     CPU: 0 PID: 1 Comm: init Not tainted
> 5.14.0-rc2-orangecrab-01933-g5c9574869017 #357
>     epc : walk_stackframe+0x11c/0x13c
>      ra : dump_backtrace+0x2c/0x3c
>     epc : c0003970 ra : c00039bc sp : c1835e20
>      gp : c06a7690 tp : c1838000 t0 : 00000000
>      t1 : 00000000 t2 : 00000000 s0 : c1835e50
>      s1 : c05d8180 a0 : 00001000 a1 : 00000000
>      a2 : c04dfd68 a3 : c05d8180 a4 : ab1d4cdc
>      a5 : 00001000 a6 : c067d204 a7 : ffffefff
>      s2 : 00000000 s3 : c05cc9f4 s4 : 00000000
>      s5 : c05d8180 s6 : c04dfd68 s7 : 00000001
>      s8 : 00000000 s9 : 95b6f158 s10: 00000000
>      s11: 00000001 t3 : 00000000 t4 : 00000001
>      t5 : 00000000 t6 : 00000000
>     status: 00000100 badaddr: 00000af0 cause: 0000000d
>     [<c0003970>] walk_stackframe+0x11c/0x13c
>     [<c00039bc>] dump_backtrace+0x2c/0x3c
>     [<c04dfde8>] show_stack+0x44/0x5c
>     [<c04e4c98>] dump_stack_lvl+0x2c/0x40
>     [<c04e4cc8>] dump_stack+0x1c/0x2c
>     [<c04dff3c>] panic+0x13c/0x330
>     [<c000c774>] do_exit+0x830/0x8b8
>     [<c000c888>] do_group_exit+0x40/0xac
>     [<c000c918>] __wake_up_parent+0x0/0x34
>     [<c0002128>] ret_from_syscall+0x0/0x4
>     ---[ end trace d147f0f146982b08 ]---
>     note: init[1] exited with preempt_count 1
>     Fixing recursive fault but reboot is needed!
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 

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

  reply	other threads:[~2021-07-19 15:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 12:51 [PATCH v4 0/1] riscv: improving uaccess with logs from network bench Akira Tsukamoto
2021-07-19 12:53 ` [PATCH v4 1/1] riscv: __asm_copy_to-from_user: Optimize unaligned memory access and pipeline stall Akira Tsukamoto
2021-07-19 13:51   ` Guenter Roeck
2021-07-19 14:00     ` Akira Tsukamoto
2021-07-19 14:24       ` Guenter Roeck
2021-07-19 14:49         ` Akira Tsukamoto
2021-07-19 15:16           ` Guenter Roeck
2021-07-20  6:54             ` Akira Tsukamoto
2021-07-19 14:49   ` Geert Uytterhoeven
2021-07-19 15:22     ` Akira Tsukamoto [this message]
2021-07-19 14:55 ` [PATCH v4 0/1] riscv: improving uaccess with logs from network bench Akira Tsukamoto

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=97ee158e-0fe8-cd7a-6ee2-35f9018838de@gmail.com \
    --to=akira.tsukamoto@gmail.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@roeck-us.net \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=qiuwenbo@kylinos.com.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 NNTP newsgroup(s).