Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 May 2014 22:23:43 +0400
From:      Chagin Dmitry <dchagin@freebsd.org>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        freebsd-multimedia@FreeBSD.org, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: Patch for Linux Futexes
Message-ID:  <20140522182343.GA2825@dchagin.static.corbina.net>
In-Reply-To: <537DDA2E.6030609@selasky.org>
References:  <537DDA2E.6030609@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--TB36FDmn/VVEgNH/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, May 22, 2014 at 01:06:22PM +0200, Hans Petter Selasky wrote:
> Hi,
>=20
> When using the Linux Skype client under FreeBSD I sometimes see that the=
=20
> Audio disappears in the one direction. When I check "ps auxw" I see=20
> skype is stuck on a so-called Futex. I looked into the Linux futex code=
=20
> and see that wakeup_one() is used instead of wakeup(). Maybe others can=
=20
> test too and verify if replacing wakeup_one() by wakeup() makes any=20
> difference in for Linux applications using Futexes.
>=20

generally speaking the patch is not correct as futex_wake() should
wakeup n waiters which is specified by user space. and i think that
futex_wake() is correct.
so we must take a close look at futex_requeue() and FUTEX_WAKE_OP.


> --HPS
>=20
>=20
> > diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_fu=
tex.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 |=3D 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 =3D=3D n)
> >  			break;
> >  	}
> > @@ -525,7 +525,7 @@ futex_requeue(struct futex *f, int n, struct futex =
*f2, int n2)
> >  			wp->wp_flags |=3D 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);
>=20
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"

--=20
Have fun!
chd

--TB36FDmn/VVEgNH/
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlN+QK8ACgkQ0t2Tb3OO/O0+KwCgkhHcaVcf1fZKCeSxzTZ2pAxU
7y4An3a9fmowtr9nkrY7W01GwLnDRF0N
=x9dR
-----END PGP SIGNATURE-----

--TB36FDmn/VVEgNH/--



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