All of lore.kernel.org
 help / color / mirror / Atom feed
From: teng sterling <sterlingteng@gmail.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: 陈飞扬 <chris.chenfeiyang@gmail.com>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	tglx@linutronix.de, peterz@infradead.org, luto@kernel.org,
	arnd@arndb.de, "Feiyang Chen" <chenfeiyang@loongson.cn>,
	linux-mips@vger.kernel.org, linux-arch@vger.kernel.org,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Yanteng Si" <siyanteng@loongson.cn>
Subject: Re: [PATCH 1/2] mips: convert syscall to generic entry
Date: Mon, 13 Sep 2021 09:35:19 +0800	[thread overview]
Message-ID: <CAMU9jJo66J_53pjdvH-a4KD_ar6L_MPYnPpT8cp0UhOXp-Gpyg@mail.gmail.com> (raw)
In-Reply-To: <20210908085150.GA5622@alpha.franken.de>

Thomas Bogendoerfer <tsbogend@alpha.franken.de> 于2021年9月8日周三 下午5:36写道:
>
> On Wed, Sep 08, 2021 at 10:08:47AM +0800, 陈飞扬 wrote:
> > On Tue, 7 Sept 2021 at 21:49, Jiaxun Yang <jiaxun.yang@flygoat.com> wrote:
> > >
> > >
> > > 在 2021/9/7 14:16, FreeFlyingSheep 写道:
> > > > From: Feiyang Chen <chenfeiyang@loongson.cn>
> > > >
> > > > Convert mips syscall to use the generic entry infrastructure from
> > > > kernel/entry/*.
> > > >
> > > > There are a few special things on mips:
> > > >
> > > > - There is one type of syscall on mips32 (scall32-o32) and three types
> > > > of syscalls on mips64 (scall64-o32, scall64-n32 and scall64-n64). Now
> > > > convert to C code to handle different types of syscalls.
> > > >
> > > > - For some special syscalls (e.g. fork, clone, clone3 and sysmips),
> > > > save_static_function() wrapper is used to save static registers. Now
> > > > SAVE_STATIC is used in handle_sys before calling do_syscall(), so the
> > > > save_static_function() wrapper can be removed.
> > > >
> > > > - For sigreturn/rt_sigreturn and sysmips, inline assembly is used to
> > > > jump to syscall_exit directly for skipping setting the error flag and
> > > > restoring all registers. Now use regs->regs[27] to mark whether to
> > > > handle the error flag and always restore all registers in handle_sys,
> > > > so these functions can return normally as other architecture.
> > >
> > > Hmm, that would give us overhead of register context on these syscalls.
> > >
> > > I guess it's worthy?
> > >
> >
> > Hi, Jiaxun,
> >
> > Saving and restoring registers against different system calls can be
> > difficult due to the use of generic entry.
> > To avoid a lot of duplicate code, I think the overhead is worth it.
>
> could you please provide numbers for that ? This code still runs
> on low end MIPS CPUs for which overhead might mean a different
> ballpark than some highend Loongson CPUs.
It shows ~2% regression for UnixBench on LOONGSON 3a4000 (a1901).

Thanks,

Yanteng

  parent reply	other threads:[~2021-09-13  1:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07  6:16 [PATCH 0/2] mips: convert to generic entry FreeFlyingSheep
2021-09-07  6:16 ` [PATCH 1/2] mips: convert syscall " FreeFlyingSheep
2021-09-07 13:48   ` Jiaxun Yang
2021-09-08  2:08     ` 陈飞扬
2021-09-08  7:15       ` Huacai Chen
2021-09-08  8:51       ` Thomas Bogendoerfer
2021-09-08 12:41         ` Jiaxun Yang
2021-09-09 12:45           ` Zhou Yanjie
2021-09-13  2:51             ` Zhou Yanjie
2021-09-13  3:06               ` Zhou Yanjie
2021-09-13  5:16             ` H. Nikolaus Schaller
2021-09-13  1:35         ` teng sterling [this message]
2021-09-14  1:30         ` Feiyang Chen
2021-09-07  6:16 ` [PATCH 2/2] mips: convert irq " FreeFlyingSheep
2021-09-08  7:17   ` Huacai Chen

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=CAMU9jJo66J_53pjdvH-a4KD_ar6L_MPYnPpT8cp0UhOXp-Gpyg@mail.gmail.com \
    --to=sterlingteng@gmail.com \
    --cc=arnd@arndb.de \
    --cc=chenfeiyang@loongson.cn \
    --cc=chenhuacai@kernel.org \
    --cc=chris.chenfeiyang@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=siyanteng@loongson.cn \
    --cc=tglx@linutronix.de \
    --cc=tsbogend@alpha.franken.de \
    /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.