From owner-freebsd-current@FreeBSD.ORG Thu May 22 18:23:54 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8861019B; Thu, 22 May 2014 18:23:54 +0000 (UTC) Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [IPv6:2a00:1450:4010:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF9EA2CFD; Thu, 22 May 2014 18:23:53 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id e16so2980218lan.0 for ; Thu, 22 May 2014 11:23:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=xlfbtBqEHzJ9YHBMGbwz8sMs4FzKsWfJUvxrMz29wkg=; b=ytg5Xdie216w+7dCmd1NTcYhn8nOGo3Sz/kj8SC/HW8hj9B5tu/jEBJUJndZpZ2Aj4 L6CO47/eD7gk7LwAYhjC+p+xbun6hLFjHlqKAqo/hQ3rp716RHuNi/FXFR01HNDUub0I hLhEYrtlPPO3v31D6vTuOKp6D6/Tt6HOtGu5zk2ZFy26xvOnJY1Fn0p+KbVexZcDdpCW r7DJxoaNvPxSEp+/oFxb1ZNBpygENQHlXBwyLec2rG4Y2o0zwaS3Ga6TxI0aTYOUV4do jnYcMWngpdWIsW0Epfo0eCpFA9XJKmoOEZV+ec8/6df0tjjUiJElChUH5RFMYkFzn5YX Oo9g== X-Received: by 10.112.189.138 with SMTP id gi10mr41522992lbc.15.1400783031720; Thu, 22 May 2014 11:23:51 -0700 (PDT) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru. [78.107.232.239]) by mx.google.com with ESMTPSA id k8sm443322lae.1.2014.05.22.11.23.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 May 2014 11:23:45 -0700 (PDT) Sender: Dmitry Chagin Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.8/8.14.8) with ESMTP id s4MINhSD002856; Thu, 22 May 2014 22:23:43 +0400 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.8/8.14.8/Submit) id s4MINhFC002855; Thu, 22 May 2014 22:23:43 +0400 (MSK) (envelope-from dchagin) Date: Thu, 22 May 2014 22:23:43 +0400 From: Chagin Dmitry To: Hans Petter Selasky Subject: Re: Patch for Linux Futexes Message-ID: <20140522182343.GA2825@dchagin.static.corbina.net> References: <537DDA2E.6030609@selasky.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline In-Reply-To: <537DDA2E.6030609@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-multimedia@FreeBSD.org, FreeBSD Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 18:23:54 -0000 --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/--