Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 May 2014 13:06:22 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        freebsd-multimedia@FreeBSD.org,  FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Patch for Linux Futexes
Message-ID:  <537DDA2E.6030609@selasky.org>

next in thread | raw e-mail | index | archive | help
Hi,

When using the Linux Skype client under FreeBSD I sometimes see that the 
Audio disappears in the one direction. When I check "ps auxw" I see 
skype is stuck on a so-called Futex. I looked into the Linux futex code 
and see that wakeup_one() is used instead of wakeup(). Maybe others can 
test too and verify if replacing wakeup_one() by wakeup() makes any 
difference in for Linux applications using Futexes.

--HPS


> diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c
> index 9b4c92f..e893bf4 100644
> --- a/sys/compat/linux/linux_futex.c
> +++ b/sys/compat/linux/linux_futex.c
> @@ -498,7 +498,7 @@ futex_wake(struct futex *f, int n, uint32_t bitset)
>  		wp->wp_flags |= FUTEX_WP_REMOVED;
>  		TAILQ_REMOVE(&f->f_waiting_proc, wp, wp_list);
>  		LIN_SDT_PROBE1(futex, futex_wake, wakeup, wp);
> -		wakeup_one(wp);
> +		wakeup(wp);
>  		if (++count == n)
>  			break;
>  	}
> @@ -525,7 +525,7 @@ futex_requeue(struct futex *f, int n, struct futex *f2, int n2)
>  			wp->wp_flags |= FUTEX_WP_REMOVED;
>  			TAILQ_REMOVE(&f->f_waiting_proc, wp, wp_list);
>  			LIN_SDT_PROBE1(futex, futex_requeue, wakeup, wp);
> -			wakeup_one(wp);
> +			wakeup(wp);
>  		} else {
>  			LIN_SDT_PROBE3(futex, futex_requeue, requeue,
>  			    f->f_uaddr, wp, f2->f_uaddr);




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?537DDA2E.6030609>