On Tue, 5 Aug 2025 09:41:43 -0300
Daniel Almeida wrote:
> Hi Onur,
>
> > On 5 Aug 2025, at 06:08, Onur Özkan wrote:
> >
> > On Sat, 2 Aug 2025 11:15:07 -0300
> > Daniel Almeida wrote:
> >
> >> Btw, I can also try to implement a proof of co
lid consensus on the API design yet (we had some ideas about Tuple
based approach, but seems like that isn't going to be useful for most
of the ww_mutex users).
[1]: https://github.com/onur-ozkan/linux/commits/673e01a9c309c
> By the way, dri-devel seems to not be on cc? Added them now.
Thanks!
--
Regards,
Onur
> exist warning: srctree/ link to include/linux/drm/drm_ioctl.h does
> not exist warning: srctree/ link to include/linux/drm/drm_file.h does
> not exist warning: srctree/ link to include/linux/drm/drm_device.h
> does not exist
>
> Inspired-by: "Onur Özkan&qu
On Tue, 24 Jun 2025 10:20:48 +0200
"Benno Lossin" wrote:
> On Tue Jun 24, 2025 at 7:34 AM CEST, Onur wrote:
> > Should we handle this in the initial implementation or leave it for
> > follow-up patches after the core abstraction of ww_mutex has landed?
>
t;>
> >> fn append(self, value: T) -> Self::Append {
> >> (self.0, value,)
> >> }
> >> }
> >>
> >> impl Tuple for (T1, T2) {
> >> type Append = (T1, T2, T);
> >>
> >> fn append(self, value: T) -> Self::Append {
> >> (self.0, self.1, value,)
> >> }
> >> }
> >>
> >> /* these can easily be generated by a macro */
> >>
> >> > We also need to take into consideration that the user want to
> >> > drop any lock in the sequence? E.g. the user acquires a, b and
> >> > c, and then drop b, and then acquires d. Which I think is
> >> > possible for ww_mutex.
> >>
> >> Hmm what about adding this to the above idea?:
> >>
> >> impl<'a, Locks> WwActiveCtx<'a, Locks>
> >> where
> >> Locks: Tuple
> >> {
> >> fn custom(self, action: impl FnOnce(Locks) -> L2) ->
> >> WwActiveCtx<'a, L2>; }
> >>
> >> Then you can do:
> >>
> >> let (a, c, d) = ctx.begin()
> >> .lock(a)
> >> .lock(b)
> >> .lock(c)
> >> .custom(|(a, _, c)| (a, c))
> >> .lock(d)
> >> .finish();
> >>
> >
> > Seems reasonable. But we still need to present this to the end user
> > to see how much they like it. For ww_mutex I think the major user
> > is DRM, so add them into Cc list.
>
> Yeah let's see some use-cases :)
Should we handle this in the initial implementation or leave it for
follow-up patches after the core abstraction of ww_mutex has landed?
---
Regards,
Onur