All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: mingo@elte.hu
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Fix initialization of runqueues
Date: Wed, 2 Aug 2006 14:27:43 +0200	[thread overview]
Message-ID: <20060802122743.GF4460@implementation.labri.fr> (raw)

Hi,

There's an odd thing about the nr_active field in arrays of runqueue_t:
it is actually never initialized to 0!...  This doesn't yet trigger a
bug probably because the way runqueues are allocated make it so that
it is already initialized to 0, but that's not a safe way.  Here is a
patch:

Initialize to zero the nr_active field of arrays of runqueues.
(fixes future potential dynamic allocation of runqueues).

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

--- linux-2.6.17-orig/kernel/sched.c	2006-06-18 19:22:40.000000000 +0200
+++ linux/kernel/sched.c	2006-08-02 14:23:02.000000000 +0200
@@ -6132,6 +6132,7 @@
 
 		for (j = 0; j < 2; j++) {
 			array = rq->arrays + j;
+			array->nr_active = 0;
 			for (k = 0; k < MAX_PRIO; k++) {
 				INIT_LIST_HEAD(array->queue + k);
 				__clear_bit(k, array->bitmap);

             reply	other threads:[~2006-08-02 12:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-02 12:27 Samuel Thibault [this message]
2006-08-02 15:24 ` [PATCH] Fix initialization of runqueues Ingo Molnar
2006-08-02 16:57   ` Samuel Thibault
2006-08-03 15:07     ` Steven Rostedt
2006-08-03 18:26       ` Samuel Thibault

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=20060802122743.GF4460@implementation.labri.fr \
    --to=samuel.thibault@ens-lyon.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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.