[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191008050238.GS26530@ZenIV.linux.org.uk>
Date: Tue, 8 Oct 2019 06:02:38 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Guenter Roeck <linux@...ck-us.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [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@...ux-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).
Powered by blists - more mailing lists