[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHk-=wgUO5hWJmMT7r8aCzP7DOkg9ADkv6AzZ=SrKLOoKxzD_g@mail.gmail.com>
Date: Wed, 7 Aug 2019 12:16:52 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: Matthew Wilcox <willy@...radead.org>,
Thomas Hellström (VMware)
<thomas@...pmail.org>, 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>,
Steven Price <steven.price@....com>,
Linux-MM <linux-mm@...ck.org>
Subject: Re: drm pull for v5.3-rc1
On Tue, Aug 6, 2019 at 11:40 PM Christoph Hellwig <hch@...radead.org> wrote:
>
> I'm not an all that huge fan of super magic macro loops. But in this
> case I don't see how it could even work, as we get special callbacks
> for huge pages and holes, and people are trying to add a few more ops
> as well.
Yeah, in this case we definitely don't want to make some magic loop walker.
Loops are certainly simpler than callbacks for most cases (and often
faster because you don't have indirect calls which now are getting
quite expensive), but the walker code really does end up having tons
of different cases that you'd have to handle with magic complex
conditionals or switch statements instead.
So the "walk over range using this set of callbacks" is generally the
right interface. If there is some particular case that might be very
simple and the callback model is expensive due to indirect calls for
each page, then such a case should probably use the normal page
walking loops (that we *used* to have everywhere - the "walk_range()"
interface is the "new" model for all the random odd special cases).
Linus
Powered by blists - more mailing lists