diff mbox

dma-buf/fence: fix fence_is_later v2

Message ID 1456169575-3159-1-git-send-email-alexander.deucher@amd.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Deucher Feb. 22, 2016, 7:32 p.m. UTC
From: Christian König <christian.koenig@amd.com>

A fence is never later than itself. This caused a bunch of overhead for AMDGPU.

v2: simplify check as suggested by Michel.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 include/linux/fence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michel Dänzer Feb. 23, 2016, 2:04 a.m. UTC | #1
On 23.02.2016 04:32, Alex Deucher wrote:
> From: Christian König <christian.koenig@amd.com>
> 
> A fence is never later than itself. This caused a bunch of overhead for AMDGPU.
> 
> v2: simplify check as suggested by Michel.
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>
> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  include/linux/fence.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/fence.h b/include/linux/fence.h
> index bb52201..5aa95eb 100644
> --- a/include/linux/fence.h
> +++ b/include/linux/fence.h
> @@ -292,7 +292,7 @@ static inline bool fence_is_later(struct fence *f1, struct fence *f2)
>  	if (WARN_ON(f1->context != f2->context))
>  		return false;
>  
> -	return f1->seqno - f2->seqno < INT_MAX;
> +	return (int)(f1->seqno - f2->seqno) > 0;
>  }
>  
>  /**
> 

According to

 scripts/get_maintainer.pl include/linux/fence.h

this patch should be sent to:

Sumit Semwal <sumit.semwal@linaro.org> (maintainer:DMA BUFFER SHARING FRAMEWORK)
linux-media@vger.kernel.org (open list:DMA BUFFER SHARING FRAMEWORK)
dri-devel@lists.freedesktop.org (open list:DMA BUFFER SHARING FRAMEWORK)
linaro-mm-sig@lists.linaro.org (moderated list:DMA BUFFER SHARING FRAMEWORK)
linux-kernel@vger.kernel.org (open list)

I'd add at least Sumit and the linaro-mm-sig list.
Daniel Vetter Feb. 29, 2016, 3:48 p.m. UTC | #2
On Tue, Feb 23, 2016 at 11:04:57AM +0900, Michel Dänzer wrote:
> On 23.02.2016 04:32, Alex Deucher wrote:
> > From: Christian König <christian.koenig@amd.com>
> > 
> > A fence is never later than itself. This caused a bunch of overhead for AMDGPU.
> > 
> > v2: simplify check as suggested by Michel.
> > 
> > Signed-off-by: Christian König <christian.koenig@amd.com>
> > Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
> > Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> >  include/linux/fence.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/linux/fence.h b/include/linux/fence.h
> > index bb52201..5aa95eb 100644
> > --- a/include/linux/fence.h
> > +++ b/include/linux/fence.h
> > @@ -292,7 +292,7 @@ static inline bool fence_is_later(struct fence *f1, struct fence *f2)
> >  	if (WARN_ON(f1->context != f2->context))
> >  		return false;
> >  
> > -	return f1->seqno - f2->seqno < INT_MAX;
> > +	return (int)(f1->seqno - f2->seqno) > 0;
> >  }
> >  
> >  /**
> > 
> 
> According to
> 
>  scripts/get_maintainer.pl include/linux/fence.h
> 
> this patch should be sent to:
> 
> Sumit Semwal <sumit.semwal@linaro.org> (maintainer:DMA BUFFER SHARING FRAMEWORK)
> linux-media@vger.kernel.org (open list:DMA BUFFER SHARING FRAMEWORK)
> dri-devel@lists.freedesktop.org (open list:DMA BUFFER SHARING FRAMEWORK)
> linaro-mm-sig@lists.linaro.org (moderated list:DMA BUFFER SHARING FRAMEWORK)
> linux-kernel@vger.kernel.org (open list)
> 
> I'd add at least Sumit and the linaro-mm-sig list.

Plus Maarten Lankhorst please, and Gustavo Padovan maybe. Not sure Sumit
is still all that active on dma-buf/fence maintainership ...
-Daniel
Sumit Semwal March 2, 2016, 3:02 a.m. UTC | #3
Hi Daniel,
On 29-Feb-2016 9:18 pm, "Daniel Vetter" <daniel@ffwll.ch> wrote:
>
> On Tue, Feb 23, 2016 at 11:04:57AM +0900, Michel Dänzer wrote:
> > On 23.02.2016 04:32, Alex Deucher wrote:
> > > From: Christian König <christian.koenig@amd.com>
> > >
> > > A fence is never later than itself. This caused a bunch of overhead
for AMDGPU.
> > >
> > > v2: simplify check as suggested by Michel.
> > >
> > > Signed-off-by: Christian König <christian.koenig@amd.com>
> > > Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
> > > Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > > ---
> > >  include/linux/fence.h | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/include/linux/fence.h b/include/linux/fence.h
> > > index bb52201..5aa95eb 100644
> > > --- a/include/linux/fence.h
> > > +++ b/include/linux/fence.h
> > > @@ -292,7 +292,7 @@ static inline bool fence_is_later(struct fence
*f1, struct fence *f2)
> > >     if (WARN_ON(f1->context != f2->context))
> > >             return false;
> > >
> > > -   return f1->seqno - f2->seqno < INT_MAX;
> > > +   return (int)(f1->seqno - f2->seqno) > 0;
> > >  }
> > >
> > >  /**
> > >
> >
> > According to
> >
> >  scripts/get_maintainer.pl include/linux/fence.h
> >
> > this patch should be sent to:
> >
> > Sumit Semwal <sumit.semwal@linaro.org> (maintainer:DMA BUFFER SHARING
FRAMEWORK)
> > linux-media@vger.kernel.org (open list:DMA BUFFER SHARING FRAMEWORK)
> > dri-devel@lists.freedesktop.org (open list:DMA BUFFER SHARING FRAMEWORK)
> > linaro-mm-sig@lists.linaro.org (moderated list:DMA BUFFER SHARING
FRAMEWORK)
> > linux-kernel@vger.kernel.org (open list)
> >
> > I'd add at least Sumit and the linaro-mm-sig list.
>
> Plus Maarten Lankhorst please, and Gustavo Padovan maybe. Not sure Sumit
> is still all that active on dma-buf/fence maintainership ...
Am here very much, though I do apologize I haven't actively provided review
comments on the fence related series. I'll improve on that for sure!

Yes, it is still a good idea to add Maarten for fence stuff in the least.
> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/include/linux/fence.h b/include/linux/fence.h
index bb52201..5aa95eb 100644
--- a/include/linux/fence.h
+++ b/include/linux/fence.h
@@ -292,7 +292,7 @@  static inline bool fence_is_later(struct fence *f1, struct fence *f2)
 	if (WARN_ON(f1->context != f2->context))
 		return false;
 
-	return f1->seqno - f2->seqno < INT_MAX;
+	return (int)(f1->seqno - f2->seqno) > 0;
 }
 
 /**