From: Boris Brezillon <boris.brezillon@collabora.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Joerg Roedel <joro@8bytes.org>,
iommu@lists.linux.dev, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
linux-arm-kernel@lists.infradead.org,
Rob Clark <robdclark@gmail.com>,
Gaurav Kohli <quic_gkohli@quicinc.com>,
Steven Price <steven.price@arm.com>
Subject: Re: [PATCH v2 0/2] iommu: Allow passing custom allocators to pgtable drivers
Date: Mon, 20 Nov 2023 16:14:18 +0100 [thread overview]
Message-ID: <20231120161418.5eca178e@collabora.com> (raw)
In-Reply-To: <20231120144604.GD10140@ziepe.ca>
On Mon, 20 Nov 2023 10:46:04 -0400
Jason Gunthorpe <jgg@ziepe.ca> wrote:
> On Mon, Nov 20, 2023 at 03:38:38PM +0100, Boris Brezillon wrote:
>
> > > At LPC there was quite a lot if interest in improving the io page
> > > table stuff to work better. Based on that I'm even more against adding
> > > an external allocator at this time. :\
> >
> > I'm sure this has been discussed with the IOMMU maintainers, but I'd
> > really like to hear it from them if you don't mind. Especially since,
> > as I mentioned, the custom allocator idea comes from Robin, not me...
>
> It is a community effort - this is my opinion. We now understand this
> io page table area needs a lot of work to meet all the new needs. I'm
> against hacking it up like this and making that work harder.
Consider it a hack if you like, but the thing is pretty self-contained,
and I doubt it will get to a point where things become unmaintainable
before you get the generic caching system working. Not to mention
Gaurav's use case, which can't really be solved with your caching
solution.
>
> > v1, was a sign this was good to go. If the final call is to reject the
> > custom allocator approach, and there's no updates on your generic
> > solution in the next couple weeks, I'll probably copy the pgtable code
> > in panthor so I can implement my own stuff, and later switch back to
> > the generic io-pgtable implementation when things have settled down.
>
> That's horrible, DRM should refuse that too,
Most GPU drivers have their own MMU/pgtable logic, partly because they
are the only users, and also because most of them delegate the page
table updates to the GPU (page tables leave in VRAM). I've actually
been recommended to go for this approach when I submitted the first
version of the driver, but after further discussions with Robin and
Rob we agreed this was probably not a good idea (because the code
exists already, and having a second implementation is never a good
thing, and also because what's needed for discrete GPUs with VRAM
doesn't necessarily apply to GPUs that share the memory with the rest
of the system).
> yet I expect you will
> probably end up merging like that.
>
> I would not expect a resolution in a few weeks.
OOC, what's the time frame?
>
> > Nothing against you or your solution (I actually commit to move to the
> > new approach when it's ready), but we have different priorities, and I
> > can't really delay the driver merging by several months unless there's
> > a very good reason to do it.
>
> Welcome to Linux, nothing runs fast :(
I've maintained a subsystem for a few years, so I know what it means
to contribute upstream and ask or being asked to extend the core to do
something the right way. I'm generally patient and try to follow
maintainers' recommendations, but there's some point where waiting is
no more an option, and you have to be more pragmatic, because there's
always a better way of doing things, and perfection is often the enemy
of good...
WARNING: multiple messages have this Message-ID (diff)
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Joerg Roedel <joro@8bytes.org>,
iommu@lists.linux.dev, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
linux-arm-kernel@lists.infradead.org,
Rob Clark <robdclark@gmail.com>,
Gaurav Kohli <quic_gkohli@quicinc.com>,
Steven Price <steven.price@arm.com>
Subject: Re: [PATCH v2 0/2] iommu: Allow passing custom allocators to pgtable drivers
Date: Mon, 20 Nov 2023 16:14:18 +0100 [thread overview]
Message-ID: <20231120161418.5eca178e@collabora.com> (raw)
In-Reply-To: <20231120144604.GD10140@ziepe.ca>
On Mon, 20 Nov 2023 10:46:04 -0400
Jason Gunthorpe <jgg@ziepe.ca> wrote:
> On Mon, Nov 20, 2023 at 03:38:38PM +0100, Boris Brezillon wrote:
>
> > > At LPC there was quite a lot if interest in improving the io page
> > > table stuff to work better. Based on that I'm even more against adding
> > > an external allocator at this time. :\
> >
> > I'm sure this has been discussed with the IOMMU maintainers, but I'd
> > really like to hear it from them if you don't mind. Especially since,
> > as I mentioned, the custom allocator idea comes from Robin, not me...
>
> It is a community effort - this is my opinion. We now understand this
> io page table area needs a lot of work to meet all the new needs. I'm
> against hacking it up like this and making that work harder.
Consider it a hack if you like, but the thing is pretty self-contained,
and I doubt it will get to a point where things become unmaintainable
before you get the generic caching system working. Not to mention
Gaurav's use case, which can't really be solved with your caching
solution.
>
> > v1, was a sign this was good to go. If the final call is to reject the
> > custom allocator approach, and there's no updates on your generic
> > solution in the next couple weeks, I'll probably copy the pgtable code
> > in panthor so I can implement my own stuff, and later switch back to
> > the generic io-pgtable implementation when things have settled down.
>
> That's horrible, DRM should refuse that too,
Most GPU drivers have their own MMU/pgtable logic, partly because they
are the only users, and also because most of them delegate the page
table updates to the GPU (page tables leave in VRAM). I've actually
been recommended to go for this approach when I submitted the first
version of the driver, but after further discussions with Robin and
Rob we agreed this was probably not a good idea (because the code
exists already, and having a second implementation is never a good
thing, and also because what's needed for discrete GPUs with VRAM
doesn't necessarily apply to GPUs that share the memory with the rest
of the system).
> yet I expect you will
> probably end up merging like that.
>
> I would not expect a resolution in a few weeks.
OOC, what's the time frame?
>
> > Nothing against you or your solution (I actually commit to move to the
> > new approach when it's ready), but we have different priorities, and I
> > can't really delay the driver merging by several months unless there's
> > a very good reason to do it.
>
> Welcome to Linux, nothing runs fast :(
I've maintained a subsystem for a few years, so I know what it means
to contribute upstream and ask or being asked to extend the core to do
something the right way. I'm generally patient and try to follow
maintainers' recommendations, but there's some point where waiting is
no more an option, and you have to be more pragmatic, because there's
always a better way of doing things, and perfection is often the enemy
of good...
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-11-20 15:14 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-10 9:43 [PATCH v2 0/2] iommu: Allow passing custom allocators to pgtable drivers Boris Brezillon
2023-11-10 9:43 ` Boris Brezillon
2023-11-10 9:43 ` [PATCH v2 1/2] " Boris Brezillon
2023-11-10 9:43 ` Boris Brezillon
2023-11-22 13:08 ` Robin Murphy
2023-11-22 13:08 ` Robin Murphy
2023-11-10 9:43 ` [PATCH v2 2/2] iommu: Extend LPAE page table format to support custom allocators Boris Brezillon
2023-11-10 9:43 ` Boris Brezillon
2023-11-22 14:24 ` Robin Murphy
2023-11-22 14:24 ` Robin Murphy
2023-11-10 10:47 ` [PATCH v2 0/2] iommu: Allow passing custom allocators to pgtable drivers Gaurav Kohli
2023-11-10 10:47 ` Gaurav Kohli
2023-11-10 15:14 ` Jason Gunthorpe
2023-11-10 15:14 ` Jason Gunthorpe
2023-11-10 15:48 ` Boris Brezillon
2023-11-10 15:48 ` Boris Brezillon
2023-11-10 16:12 ` Jason Gunthorpe
2023-11-10 16:12 ` Jason Gunthorpe
2023-11-10 19:16 ` Boris Brezillon
2023-11-10 19:16 ` Boris Brezillon
2023-11-10 19:42 ` Jason Gunthorpe
2023-11-10 19:42 ` Jason Gunthorpe
2023-11-13 9:11 ` Boris Brezillon
2023-11-13 9:11 ` Boris Brezillon
2023-11-14 16:27 ` Jason Gunthorpe
2023-11-14 16:27 ` Jason Gunthorpe
2023-11-20 14:04 ` Jason Gunthorpe
2023-11-20 14:04 ` Jason Gunthorpe
2023-11-20 14:38 ` Boris Brezillon
2023-11-20 14:38 ` Boris Brezillon
2023-11-20 14:46 ` Jason Gunthorpe
2023-11-20 14:46 ` Jason Gunthorpe
2023-11-20 15:14 ` Boris Brezillon [this message]
2023-11-20 15:14 ` Boris Brezillon
2023-11-20 15:45 ` Jason Gunthorpe
2023-11-20 15:45 ` Jason Gunthorpe
2023-11-22 17:23 ` Robin Murphy
2023-11-22 17:23 ` Robin Murphy
2023-11-22 17:50 ` Jason Gunthorpe
2023-11-22 17:50 ` Jason Gunthorpe
2023-11-23 8:51 ` Boris Brezillon
2023-11-23 8:51 ` Boris Brezillon
2023-11-23 13:48 ` Jason Gunthorpe
2023-11-23 13:48 ` Jason Gunthorpe
2023-11-23 16:49 ` Robin Murphy
2023-11-23 16:49 ` Robin Murphy
2023-11-23 16:59 ` Jason Gunthorpe
2023-11-23 16:59 ` Jason Gunthorpe
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=20231120161418.5eca178e@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=quic_gkohli@quicinc.com \
--cc=robdclark@gmail.com \
--cc=robin.murphy@arm.com \
--cc=steven.price@arm.com \
--cc=will@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.