public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgomp/43706] scheduling two threads on one core leads to starvation
Date: Tue, 24 Aug 2010 11:41:00 -0000	[thread overview]
Message-ID: <20100824114048.19394.qmail@sourceware.org> (raw)
In-Reply-To: <bug-43706-19017@http.gcc.gnu.org/bugzilla/>



------- Comment #18 from jakub at gcc dot gnu dot org  2010-08-24 11:40 -------
For the auto-tuning, ideally the kernel would tell the thread when it lost CPU,
I doubt there is any API for that currently.  E.g. if a thread could register
with kernel address where the kernel would store some value (e.g. zero) or do
atomic increment or decrement upon taking away CPU from the thread.
Then, at the start of the spinning libgomp could initialize that flag and check
it from time to time (say every few hundred or thousand iterations) whether it
has lost the CPU.  In the lost CPU case it would continue just with a couple of
spins and then go to sleep, and ensure the spincount will get dynamically
adjusted next time or something similar.

Currently I'm afraid the only way to dynamically adjust is from time to time
read/parse /proc/loadavg and if it went above number of available CPUs or
something similar, start throttling down.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |drepper at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43706


  parent reply	other threads:[~2010-08-24 11:41 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 16:22 [Bug libgomp/43706] New: " baeuml at kit dot edu
2010-04-09 16:22 ` [Bug libgomp/43706] " baeuml at kit dot edu
2010-04-09 18:34 ` pinskia at gcc dot gnu dot org
2010-04-09 20:55 ` baeuml at kit dot edu
2010-04-09 22:11 ` mika dot fischer at kit dot edu
2010-04-20 10:23 ` jakub at gcc dot gnu dot org
2010-04-20 10:49 ` jakub at gcc dot gnu dot org
2010-04-20 12:23 ` mika dot fischer at kit dot edu
2010-04-20 15:38 ` jakub at gcc dot gnu dot org
2010-04-21 14:01 ` jakub at gcc dot gnu dot org
2010-04-21 14:01 ` jakub at gcc dot gnu dot org
2010-04-21 14:06 ` jakub at gcc dot gnu dot org
2010-04-21 14:07 ` jakub at gcc dot gnu dot org
2010-04-21 14:23 ` mika dot fischer at kit dot edu
2010-04-23 14:17 ` singler at kit dot edu
2010-04-30  8:53 ` jakub at gcc dot gnu dot org
2010-07-02  1:39 ` solar-gcc at openwall dot com
2010-07-30 14:00 ` johnfb at mail dot utexas dot edu
2010-08-13 15:48 ` singler at kit dot edu
2010-08-24 11:07 ` solar-gcc at openwall dot com
2010-08-24 11:41 ` jakub at gcc dot gnu dot org [this message]
2010-08-24 12:18 ` solar-gcc at openwall dot com
2010-08-30  8:41 ` singler at kit dot edu
2010-09-01 16:38 ` jakub at gcc dot gnu dot org
2010-09-05 11:37 ` solar-gcc at openwall dot com
     [not found] <bug-43706-4@http.gcc.gnu.org/bugzilla/>
2010-11-09 16:33 ` solar-gcc at openwall dot com
2010-11-12  8:21 ` singler at kit dot edu
2010-11-12 11:44 ` solar-gcc at openwall dot com
2010-11-15  9:14 ` singler at kit dot edu
2010-12-02 14:31 ` jakub at gcc dot gnu.org
2010-12-16 13:03 ` rguenth at gcc dot gnu.org
2012-01-12 20:34 ` pinskia at gcc dot gnu.org

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=20100824114048.19394.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).