linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* compositing broken in -next (idr bug)
@ 2013-02-12 21:55 Jiri Slaby
  2013-02-12 21:58 ` Tejun Heo
  2013-02-12 22:03 ` Jiri Slaby
  0 siblings, 2 replies; 6+ messages in thread
From: Jiri Slaby @ 2013-02-12 21:55 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Andrew Morton, David Airlie, dri-devel, LKML

Hi,

this commit in -next causes my KDE to get stuck while starting. I see
only the splash screen. If I disable effects by alt-shift-f12, it continues.

I bisected it to this commit:
commit 430440fce7da4ad52c2af06a04a5132e5d19faaf
Author: Tejun Heo <tj@kernel.org>
Date:   Thu Feb 7 12:31:37 2013 +1100

    drm: convert to idr_alloc()


More concretely to the change in drm_gem_flink_ioctl. If I revert solely
that one, it works again. Maybe I'm blind, but I do not see why...

Well I see a bug in there, but that is not the root cause -- there is a
missing call to idr_preload_end. Of course, that one only leaves
preemption disabled forever.

What I tried with no effect is this:
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -453,7 +453,8 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
        spin_lock(&dev->object_name_lock);
        if (!obj->name) {
                ret = idr_alloc(&dev->object_name_idr, obj, 1, 0,
GFP_NOWAIT);
-               obj->name = ret;
+               if (ret >= 0)
+                       obj->name = ret;
                args->name = (uint64_t) obj->name;
                spin_unlock(&dev->object_name_lock);

@@ -469,6 +470,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
        }

 err:
+       idr_preload_end();
        drm_gem_object_unreference_unlocked(obj);
        return ret;
 }

thanks,
-- 
js
suse labs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: compositing broken in -next (idr bug)
  2013-02-12 21:55 compositing broken in -next (idr bug) Jiri Slaby
@ 2013-02-12 21:58 ` Tejun Heo
  2013-02-12 21:59   ` Jiri Slaby
  2013-02-12 22:03 ` Jiri Slaby
  1 sibling, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2013-02-12 21:58 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: Andrew Morton, David Airlie, dri-devel, LKML

Hello, Jiri.

On Tue, Feb 12, 2013 at 10:55:37PM +0100, Jiri Slaby wrote:
> this commit in -next causes my KDE to get stuck while starting. I see
> only the splash screen. If I disable effects by alt-shift-f12, it continues.
> 
> I bisected it to this commit:
> commit 430440fce7da4ad52c2af06a04a5132e5d19faaf
> Author: Tejun Heo <tj@kernel.org>
> Date:   Thu Feb 7 12:31:37 2013 +1100
> 
>     drm: convert to idr_alloc()
> 
> 
> More concretely to the change in drm_gem_flink_ioctl. If I revert solely
> that one, it works again. Maybe I'm blind, but I do not see why...
> 
> Well I see a bug in there, but that is not the root cause -- there is a
> missing call to idr_preload_end. Of course, that one only leaves
> preemption disabled forever.

Fix for this bug is already queued in -mm.

  http://article.gmane.org/gmane.linux.kernel/1439101/raw

But you're saying that adding the missing idr_preload_end() doesn't
make the problem go away, right?

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: compositing broken in -next (idr bug)
  2013-02-12 21:58 ` Tejun Heo
@ 2013-02-12 21:59   ` Jiri Slaby
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2013-02-12 21:59 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Andrew Morton, David Airlie, dri-devel, LKML

On 02/12/2013 10:58 PM, Tejun Heo wrote:
> Hello, Jiri.
> 
> On Tue, Feb 12, 2013 at 10:55:37PM +0100, Jiri Slaby wrote:
>> this commit in -next causes my KDE to get stuck while starting. I see
>> only the splash screen. If I disable effects by alt-shift-f12, it continues.
>>
>> I bisected it to this commit:
>> commit 430440fce7da4ad52c2af06a04a5132e5d19faaf
>> Author: Tejun Heo <tj@kernel.org>
>> Date:   Thu Feb 7 12:31:37 2013 +1100
>>
>>     drm: convert to idr_alloc()
>>
>>
>> More concretely to the change in drm_gem_flink_ioctl. If I revert solely
>> that one, it works again. Maybe I'm blind, but I do not see why...
>>
>> Well I see a bug in there, but that is not the root cause -- there is a
>> missing call to idr_preload_end. Of course, that one only leaves
>> preemption disabled forever.
> 
> Fix for this bug is already queued in -mm.
> 
>   http://article.gmane.org/gmane.linux.kernel/1439101/raw
> 
> But you're saying that adding the missing idr_preload_end() doesn't
> make the problem go away, right?

Yeah, right. I had to revert the whole hunk...

-- 
js
suse labs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: compositing broken in -next (idr bug)
  2013-02-12 21:55 compositing broken in -next (idr bug) Jiri Slaby
  2013-02-12 21:58 ` Tejun Heo
@ 2013-02-12 22:03 ` Jiri Slaby
  2013-02-12 22:08   ` Jiri Slaby
  1 sibling, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2013-02-12 22:03 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Andrew Morton, David Airlie, dri-devel, LKML

On 02/12/2013 10:55 PM, Jiri Slaby wrote:
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -453,7 +453,8 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
>         spin_lock(&dev->object_name_lock);
>         if (!obj->name) {
>                 ret = idr_alloc(&dev->object_name_idr, obj, 1, 0,
> GFP_NOWAIT);
> -               obj->name = ret;
> +               if (ret >= 0)
> +                       obj->name = ret;
>                 args->name = (uint64_t) obj->name;
>                 spin_unlock(&dev->object_name_lock);
> 
> @@ -469,6 +470,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
>         }
> 
>  err:
> +       idr_preload_end();
>         drm_gem_object_unreference_unlocked(obj);
>         return ret;

Oh my, maybe: return ret < 0 ? ret : 0... Let's try.

-- 
js
suse labs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: compositing broken in -next (idr bug)
  2013-02-12 22:03 ` Jiri Slaby
@ 2013-02-12 22:08   ` Jiri Slaby
  2013-02-12 22:13     ` Tejun Heo
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2013-02-12 22:08 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Andrew Morton, David Airlie, dri-devel, LKML

On 02/12/2013 11:03 PM, Jiri Slaby wrote:
> On 02/12/2013 10:55 PM, Jiri Slaby wrote:
>> --- a/drivers/gpu/drm/drm_gem.c
>> +++ b/drivers/gpu/drm/drm_gem.c
>> @@ -453,7 +453,8 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
>>         spin_lock(&dev->object_name_lock);
>>         if (!obj->name) {
>>                 ret = idr_alloc(&dev->object_name_idr, obj, 1, 0,
>> GFP_NOWAIT);
>> -               obj->name = ret;
>> +               if (ret >= 0)
>> +                       obj->name = ret;
>>                 args->name = (uint64_t) obj->name;
>>                 spin_unlock(&dev->object_name_lock);
>>
>> @@ -469,6 +470,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
>>         }
>>
>>  err:
>> +       idr_preload_end();
>>         drm_gem_object_unreference_unlocked(obj);
>>         return ret;
> 
> Oh my, maybe: return ret < 0 ? ret : 0... Let's try.

Bull's eye.

--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -459,6 +459,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,

                if (ret < 0)
                        goto err;
+               ret = 0;

                /* Allocate a reference for the name table.  */
                drm_gem_object_reference(obj);

-- 
js
suse labs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: compositing broken in -next (idr bug)
  2013-02-12 22:08   ` Jiri Slaby
@ 2013-02-12 22:13     ` Tejun Heo
  0 siblings, 0 replies; 6+ messages in thread
From: Tejun Heo @ 2013-02-12 22:13 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: Andrew Morton, David Airlie, dri-devel, LKML

Hello, Jiri.

On Tue, Feb 12, 2013 at 11:08:41PM +0100, Jiri Slaby wrote:
> > Oh my, maybe: return ret < 0 ? ret : 0... Let's try.
> 
> Bull's eye.

Aieee....

> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -459,6 +459,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
> 
>                 if (ret < 0)
>                         goto err;
> +               ret = 0;
> 
>                 /* Allocate a reference for the name table.  */
>                 drm_gem_object_reference(obj);

Care to write up a proper patch w/ SOB?

Thanks!

-- 
tejun

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-12 22:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-12 21:55 compositing broken in -next (idr bug) Jiri Slaby
2013-02-12 21:58 ` Tejun Heo
2013-02-12 21:59   ` Jiri Slaby
2013-02-12 22:03 ` Jiri Slaby
2013-02-12 22:08   ` Jiri Slaby
2013-02-12 22:13     ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).