From: Feiyang Chen <chris.chenfeiyang@gmail.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: 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,
chenhuacai@kernel.org, Yanteng Si <siyanteng@loongson.cn>,
Zhou Yanjie <zhouyu@wanyeetech.com>,
"H. Nikolaus Schaller" <hns@goldelico.com>
Subject: Re: [PATCH 1/2] mips: convert syscall to generic entry
Date: Tue, 14 Sep 2021 09:30:53 +0800 [thread overview]
Message-ID: <CACWXhK=gud_vk5g7cLA_2P1=57mWfiJxTYpw2EPf=NNgbdR1Tw@mail.gmail.com> (raw)
In-Reply-To: <20210908085150.GA5622@alpha.franken.de>
On Wed, 8 Sept 2021 at 17:28, Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:
>
> 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.
Hi, Thomas, Jiaxun, Yanjie, Nikolaus,
Thank you for your help. The impact on performance seems somewhat
significant, I will make improvements in the v2 of the patchset.
Thanks,
Feiyang
>
> Thomas.
>
> --
> Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
> good idea. [ RFC1925, 2.3 ]
next prev parent reply other threads:[~2021-09-14 1:30 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
2021-09-14 1:30 ` Feiyang Chen [this message]
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='CACWXhK=gud_vk5g7cLA_2P1=57mWfiJxTYpw2EPf=NNgbdR1Tw@mail.gmail.com' \
--to=chris.chenfeiyang@gmail.com \
--cc=arnd@arndb.de \
--cc=chenfeiyang@loongson.cn \
--cc=chenhuacai@kernel.org \
--cc=hns@goldelico.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 \
--cc=zhouyu@wanyeetech.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;
as well as URLs for NNTP newsgroup(s).