public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* bttv hang problem on 2.6.8
@ 2004-10-25 15:03 Lennert Buytenhek
  2004-10-25 15:18 ` Gerd Knorr
  0 siblings, 1 reply; 4+ messages in thread
From: Lennert Buytenhek @ 2004-10-25 15:03 UTC (permalink / raw)
  To: kraxel, linux-kernel

(please CC on replies, I'm not on the list)

Hi,

When there is a background thread doing VIDIOCSYNC in a loop, issuing
VIDIOCSPICT in the current thread on the same file descriptor causes
it to go into uninterruptable sleep and hang.  This is on kernel 2.6.8
using the bttv driver, and appears easily reproducible.

Anyone any ideas?


thanks,
Lennert

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

* Re: bttv hang problem on 2.6.8
  2004-10-25 15:03 bttv hang problem on 2.6.8 Lennert Buytenhek
@ 2004-10-25 15:18 ` Gerd Knorr
  2004-10-25 16:01   ` Lennert Buytenhek
  0 siblings, 1 reply; 4+ messages in thread
From: Gerd Knorr @ 2004-10-25 15:18 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: linux-kernel

On Mon, Oct 25, 2004 at 05:03:49PM +0200, Lennert Buytenhek wrote:
> (please CC on replies, I'm not on the list)
> 
> Hi,
> 
> When there is a background thread doing VIDIOCSYNC in a loop, issuing
> VIDIOCSPICT in the current thread on the same file descriptor causes
> it to go into uninterruptable sleep and hang.  This is on kernel 2.6.8
> using the bttv driver, and appears easily reproducible.

Don't do that.  bttv serializes ioctls with a lock.  Well, not all of
them, but the ones which change the state of the filehandle, and both
VIDIOCSYNC + VIDIOCSPICT fall into that group.  You simply can't run
them in parallel on the same filehandle.

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)

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

* Re: bttv hang problem on 2.6.8
  2004-10-25 15:18 ` Gerd Knorr
@ 2004-10-25 16:01   ` Lennert Buytenhek
  2004-10-25 20:53     ` Gerd Knorr
  0 siblings, 1 reply; 4+ messages in thread
From: Lennert Buytenhek @ 2004-10-25 16:01 UTC (permalink / raw)
  To: Gerd Knorr; +Cc: linux-kernel

On Mon, Oct 25, 2004 at 05:18:41PM +0200, Gerd Knorr wrote:

> > When there is a background thread doing VIDIOCSYNC in a loop, issuing
> > VIDIOCSPICT in the current thread on the same file descriptor causes
> > it to go into uninterruptable sleep and hang.  This is on kernel 2.6.8
> > using the bttv driver, and appears easily reproducible.
> 
> Don't do that.  bttv serializes ioctls with a lock.  Well, not all of
> them, but the ones which change the state of the filehandle, and both
> VIDIOCSYNC + VIDIOCSPICT fall into that group.  You simply can't run
> them in parallel on the same filehandle.

OK, even though it worked fine on 2.4 I'll buy that, but it still
shouldn't result in an unkillable process, should it?


cheers,
Lennert

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

* Re: bttv hang problem on 2.6.8
  2004-10-25 16:01   ` Lennert Buytenhek
@ 2004-10-25 20:53     ` Gerd Knorr
  0 siblings, 0 replies; 4+ messages in thread
From: Gerd Knorr @ 2004-10-25 20:53 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: linux-kernel

On Mon, Oct 25, 2004 at 06:01:45PM +0200, Lennert Buytenhek wrote:
> On Mon, Oct 25, 2004 at 05:18:41PM +0200, Gerd Knorr wrote:
> 
> > > When there is a background thread doing VIDIOCSYNC in a loop, issuing
> > > VIDIOCSPICT in the current thread on the same file descriptor causes
> > > it to go into uninterruptable sleep and hang.  This is on kernel 2.6.8
> > > using the bttv driver, and appears easily reproducible.
> > 
> > Don't do that.  bttv serializes ioctls with a lock.  Well, not all of
> > them, but the ones which change the state of the filehandle, and both
> > VIDIOCSYNC + VIDIOCSPICT fall into that group.  You simply can't run
> > them in parallel on the same filehandle.
> 
> OK, even though it worked fine on 2.4 I'll buy that, but it still
> shouldn't result in an unkillable process, should it?

Does it?  That wasn't clear.  One of the two threads (the one waiting
for the lock, probably the one doing VIDIOCSPICT) might be unkillable.
Try killing the other thread as well, that should work.  If it doesn't
I'd like to get stack traces for the deadlock case (sysrq-t).

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)

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

end of thread, other threads:[~2004-10-26  0:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-25 15:03 bttv hang problem on 2.6.8 Lennert Buytenhek
2004-10-25 15:18 ` Gerd Knorr
2004-10-25 16:01   ` Lennert Buytenhek
2004-10-25 20:53     ` Gerd Knorr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox