[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wghASUU7QmoibQK7XS09na7rDRrjSrWPwkGz=qLnGp_Xw@mail.gmail.com>
Date: Mon, 15 Jul 2019 15:17:42 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Thomas Hellström (VMware)
<thomas@...pmail.org>
Cc: Dave Airlie <airlied@...il.com>,
Thomas Hellstrom <thellstrom@...are.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
LKML <linux-kernel@...r.kernel.org>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Jerome Glisse <jglisse@...hat.com>,
Jason Gunthorpe <jgg@...lanox.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: drm pull for v5.3-rc1
On Mon, Jul 15, 2019 at 1:07 PM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> The mm_walk struct is indeed a bit similar, and is in fact a bit
> problematic exactly because it mixes function pointers with non-const
> data.
This made me look at how nasty that would be to fix.
Not too bad.
The attached patch does add more lines than it removes, but in most
cases it's actually a clear improvement.
It results in:
- smaller stackframes and less runtime initialization: the bulk of
the 'mm_walk' structure was the ops pointers, and if we split them out
and make them const, we can just initialize them statically, and the
stack footprint now becomes just a single word.
- the function pointers are now nicely in a const data section
in addition to the whole "don't mix variable data with constants, and
don't put function pointers on the stack" thing.
Of course, I haven't _tested_ the end result, but since it compiles it
must be perfect, right? Not that I tested all of the build either,
since several of the mm_walk users were for other architectures.
I'm not sure this is really worth it, but I'm throwing the patch out
there in case somebody wants to look.
Andrew, comments? I don't think we have anybody who is in charge of
mm_walk outside of you...
Linus
View attachment "patch.diff" of type "text/x-patch" (21678 bytes)
Powered by blists - more mailing lists