lkml.org 
[lkml]   [2019]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Convert filldir[64]() from __put_user() to unsafe_put_user()
On Mon, Oct 07, 2019 at 09:14:51PM -0700, Linus Torvalds wrote:
> On Mon, Oct 7, 2019 at 9:09 PM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > Try the attached patch, and then count the number of "rorx"
> > instructions in the kernel. Hint: not many. On my personal config,
> > this triggers 15 times in the whole kernel build (not counting
> > modules).
>
> So here's a serious patch that doesn't just mark things for counting -
> it just removes the cases entirely.
>
> Doesn't this look nice:
>
> 2 files changed, 2 insertions(+), 133 deletions(-)
>
> and it is one less thing to worry about when doing further cleanup.
>
> Seriously, if any of those __copy_{to,from}_user() constant cases were
> a big deal, we can turn them into get_user/put_user calls. But only
> after they show up as an actual performance issue.

Makes sense. I'm not arguing against doing that. Moreover, I suspect
that other architectures will be similar, at least once the
sigframe-related code for given architecture is dealt with. But that's
more of a "let's look at that later" thing (hopefully with maintainers
of architectures getting involved).

\
 
 \ /
  Last update: 2019-10-08 07:03    [W:0.071 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site