linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Akira Tsukamoto <akira.tsukamoto@gmail.com>
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: Mon, 19 Jul 2021 16:49:11 +0200	[thread overview]
Message-ID: <CAMuHMdVMi8zfmSiZ0vnvCcsZQua_LKXpNAQVmRUdBKxNay=f-w@mail.gmail.com> (raw)
In-Reply-To: <5e1b5d90-5a1e-5e9f-7b92-6c53b8589c2a@gmail.com>

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!

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

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):

    /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

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

  parent reply	other threads:[~2021-07-19 14:49 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 [this message]
2021-07-19 15:22     ` Akira Tsukamoto
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='CAMuHMdVMi8zfmSiZ0vnvCcsZQua_LKXpNAQVmRUdBKxNay=f-w@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=akira.tsukamoto@gmail.com \
    --cc=aou@eecs.berkeley.edu \
    --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).