From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Valdis.Kletnieks@vt.edu
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Matt Mackall <mpm@selenic.com>,
Anton Vorontsov <avorontsov@ru.mvista.com>,
Andrew Morton <akpm@linux-foundation.org>,
oleg@redhat.com, mingo@elte.hu, tony.luck@intel.com,
rth@twiddle.net, geert@linux-m68k.org
Subject: Re: [PATCH 1/2] sched: INIT_PREEMPT_COUNT
Date: Fri, 10 Jul 2009 17:51:06 +0200 [thread overview]
Message-ID: <1247241066.7529.50.camel@twins> (raw)
In-Reply-To: <17047.1247240546@turing-police.cc.vt.edu>
On Fri, 2009-07-10 at 11:42 -0400, Valdis.Kletnieks@vt.edu wrote:
> On Fri, 10 Jul 2009 14:57:56 +0200, Peter Zijlstra said:
>
> > +/*
> > + * Disable preemption until the scheduler is running.
> > + * Reset by start_kernel()->sched_init()->init_idle().
> > + */
> > +#define INIT_PREEMPT_COUNT (1)
> > +
>
> I had to look at this for quite some time before it sank in that it wasn't
> a reset of a #define, or a reset of (1) (anybody else remember changing the
> value of '5' in a Fortran program?). Especially when stuck in with a bunch
> of cputimer defines. Would have taken even longer if I was looking in sched.h
> for something and not looking at this patch at the same time.
>
> Can we fix this comment to mention it's thread_info.preempt_count that
> needs the reset?
Something along the lines of the below?
---
Index: linux-2.6/include/linux/sched.h
===================================================================
--- linux-2.6.orig/include/linux/sched.h
+++ linux-2.6/include/linux/sched.h
@@ -502,7 +502,9 @@ struct task_cputime {
/*
* Disable preemption until the scheduler is running.
- * Reset by start_kernel()->sched_init()->init_idle().
+ *
+ * We reset this initial offset of init_thread_info.preempt_count in:
+ * start_kernel()->sched_init()->init_idle().
*/
#define INIT_PREEMPT_COUNT (1)
next prev parent reply other threads:[~2009-07-10 15:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-10 12:57 [PATCH 0/2] cond_resched() optimization Peter Zijlstra
2009-07-10 12:57 ` [PATCH 1/2] sched: INIT_PREEMPT_COUNT Peter Zijlstra
2009-07-10 15:42 ` Valdis.Kletnieks
2009-07-10 15:51 ` Peter Zijlstra [this message]
2009-07-10 20:24 ` Valdis.Kletnieks
2009-07-10 21:18 ` Bjorn Helgaas
2009-07-11 9:32 ` Peter Zijlstra
2009-07-11 10:15 ` Matthew Wilcox
2009-07-10 12:57 ` [PATCH 2/2] sched: optimize cond_resched() Peter Zijlstra
2009-07-10 17:12 ` Matt Mackall
2009-07-10 22:34 ` [PATCH 0/2] cond_resched() optimization Anton Vorontsov
2009-07-11 11:28 ` -tip: ACPICA: Do not schedule during early init Ingo Molnar
2009-07-11 11:28 ` Ingo Molnar
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=1247241066.7529.50.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=Valdis.Kletnieks@vt.edu \
--cc=akpm@linux-foundation.org \
--cc=avorontsov@ru.mvista.com \
--cc=geert@linux-m68k.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mpm@selenic.com \
--cc=oleg@redhat.com \
--cc=rth@twiddle.net \
--cc=tony.luck@intel.com \
--cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.