public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Mandeep Singh Baines <msb@google.com>
Cc: fweisbec@gmail.com, linux-kernel@vger.kernel.org,
	rientjes@google.com, mbligh@google.com, thockin@google.com
Subject: Re: [PATCH v2] softlockup: remove hung_task_check_count
Date: Thu, 22 Jan 2009 09:34:57 +0100	[thread overview]
Message-ID: <20090122083457.GC7438@elte.hu> (raw)
In-Reply-To: <20090122005405.GA6067@google.com>


* Mandeep Singh Baines <msb@google.com> wrote:

> > do the need_resched() check first (it's very lighweight) - and thus 
> > only do the heavy ops (get-task-struct & tasklist_lock unlock) if that 
> > is set?
> 
> Wanted to upper-bound the amount of time the lock is held. In order to 
> give others a chance to write_lock the tasklist, released the lock 
> regardless of whether a re-schedule is need.

but this:

> +static void check_hung_reschedule(struct task_struct *t)
> +{
> +	get_task_struct(t);
> +	read_unlock(&tasklist_lock);
> +	if (need_resched())
> +		schedule();
> +	read_lock(&tasklist_lock);
> +	put_task_struct(t);
> +}

does not actually achieve that. Releasing a lock does not mean that other 
CPUs will immediately be able to get it - if the ex-owner quickly 
re-acquires it then it will often succeed in doing so. Perhaps adding a 
cpu_relax() would increase the chance ... but still, it looks a bit weird.

	Ingo

  reply	other threads:[~2009-01-22  8:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21  1:46 [PATCH] softlockup: remove hung_task_check_count Mandeep Singh Baines
2009-01-21 11:13 ` Ingo Molnar
2009-01-21 13:14   ` Frédéric Weisbecker
2009-01-22  0:54   ` [PATCH v2] " Mandeep Singh Baines
2009-01-22  8:34     ` Ingo Molnar [this message]
2009-01-22 19:55       ` [PATCH v3] " Mandeep Singh Baines
2009-01-23  3:21         ` Mandeep Baines
2009-01-23  9:23           ` Ingo Molnar
2009-01-23 10:04             ` Frédéric Weisbecker
2009-01-24  1:55               ` Mandeep Singh Baines
2009-01-24 15:52                 ` Frederic Weisbecker
2009-01-26  2:25                   ` Mandeep Baines
2009-01-24  2:56             ` Mandeep Singh Baines

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=20090122083457.GC7438@elte.hu \
    --to=mingo@elte.hu \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@google.com \
    --cc=msb@google.com \
    --cc=rientjes@google.com \
    --cc=thockin@google.com \
    /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