public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "katsuki.uwatoko at toshiba dot co.jp" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug ports/15119] New: unnecessary busy loop in __lll_timedlock_wait on ARM
Date: Fri, 08 Feb 2013 00:01:00 -0000	[thread overview]
Message-ID: <bug-15119-131@http.sourceware.org/bugzilla/> (raw)

http://sourceware.org/bugzilla/show_bug.cgi?id=15119

             Bug #: 15119
           Summary: unnecessary busy loop in __lll_timedlock_wait on ARM
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ports
        AssignedTo: unassigned@sourceware.org
        ReportedBy: katsuki.uwatoko@toshiba.co.jp
                CC: carlos@redhat.com, roland@gnu.org
    Classification: Unclassified


Created attachment 6856
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6856
patch for Avoid unneecssary busy loop in __lll_timedlock_wait on ARM.

The following sequence causes unnecessary busy loop. 

"A thread" gets the lock. (futex = 1)
"B thread" tries to get the lock, and has not called futex syscall yet. (futex
= 2)
"A thread" releases the lock (futex = 0)
"C thread" gets the lock, and does not call futex syscall because of futex=0
(futex = 1)
"B thread" calls futex syscall, and returns with an error.
           Because futex syscall in Linux Kernel checks if the val is changed 
           from 2, which is the 3rd arg of the syscall at futex_wait_setup(),
           but in this case futex is 1.
"B thread" tries to get the lock in userspace but cannot get it 
           because futex is not 0.
           After all the thread keeps calling futex syscall 
           until "C thread" will release it (futex = 0) or timeout.

Therefore I think that the value should be set 2 in every loop 
the same as __lll_lock_wait_private, and attached a patch for this issue.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


             reply	other threads:[~2013-02-08  0:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08  0:01 katsuki.uwatoko at toshiba dot co.jp [this message]
2014-02-08  1:58 ` [Bug nptl/15119] [arm] " jsm28 at gcc dot gnu.org
2014-04-18  5:34 ` maxim.kuvyrkov at gmail dot com
2014-04-24 14:32 ` bernie.ogden at linaro dot org
2014-05-01 13:01 ` bernie.ogden at linaro dot org
2014-05-01 13:28 ` cvs-commit at gcc dot gnu.org
2014-05-01 15:28 ` will.newton at gmail dot com
2014-05-02  1:36 ` maxim.kuvyrkov at linaro dot org
2014-05-02  7:48 ` will.newton at gmail dot com
2014-06-10  3:25 ` cvs-commit at gcc dot gnu.org
2014-06-13 18:53 ` fweimer at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-15119-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).