mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Mark Fasheh <mark.fasheh@oracle.com>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org,
	jim.houston@ccur.com, sunil.mushran@oracle.com
Subject: Re: [PATCH] Conditionally check expected_preempt_count in __resched_legal()
Date: Wed, 13 Dec 2006 21:04:22 +0100	[thread overview]
Message-ID: <20061213200422.GA992@elte.hu> (raw)
In-Reply-To: <20061213195537.GH6831@ca-server1.us.oracle.com>


* Mark Fasheh <mark.fasheh@oracle.com> wrote:

> Commit 2d7d253548cffdce80f4e03664686e9ccb1b0ed7 ("fix cond_resched() fix")
> introduced an 'expected_preempt_count' parameter to __resched_legal() to fix
> a bug where it was returning a false negative when called from
> cond_resched_lock() and preemption was enabled.
> 
> Unfortunately this broke things for when preemption is disabled.
> preempt_count() will always return zero, thus failing the check against
> any value of expected_preempt_count not equal to zero. cond_resched_lock()
> for example, passes an expected_preempt_count value of 1.
> 
> So fix the fix for the cond_resched() fix by skipping the check of
> preempt_count() against expected_preempt_count when preemption is disabled.
> 
> Credit should go to Sunil Mushran for spotting the bug during testing.
> 
> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>

well spotted. I'm wondering whether this piece of code has the highest 
amount of fixes per line of code ratio in the whole kernel ...

Acked-by: Ingo Molnar <mingo@elte.hu>

	Ingo

      reply	other threads:[~2006-12-13 20:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-13 19:55 Mark Fasheh
2006-12-13 20:04 ` Ingo Molnar [this message]

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=20061213200422.GA992@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=jim.houston@ccur.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.fasheh@oracle.com \
    --cc=sunil.mushran@oracle.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

Powered by JetHome