public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dinakar Guniguntala <dino@in.ibm.com>
To: Paul Jackson <pj@sgi.com>
Cc: linux-kernel@vger.kernel.org, lse-tech@lists.sourceforge.net
Subject: Re: [Lse-tech] [PATCH] new bitmap list format (for cpusets)
Date: Wed, 11 Aug 2004 18:41:55 +0530	[thread overview]
Message-ID: <20040811131155.GA4239@in.ibm.com> (raw)
In-Reply-To: <20040805100901.3740.99823.84118@sam.engr.sgi.com>

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

Paul,

Considering that cpu_possible_map does not get fully initialized
until smp_prepare_cpus gets called by init(), I thought it right
to move cpuset_init() to after smp initialization. I tested it on
2.6.8-rc2-mm2 and it seemed to work ok.

Patch attached below

Regards,

Dinakar 

Signed-off-by: Dinakar Guniguntala <dino@in.ibm.com>



[-- Attachment #2: cpuset-init.patch --]
[-- Type: text/plain, Size: 5597 bytes --]

diff -Naurp linux-2.6.8-rc2-mm2-cs3/include/linux/cpuset.h linux-2.6.8-rc2-mm2-cs3.new/include/linux/cpuset.h
--- linux-2.6.8-rc2-mm2-cs3/include/linux/cpuset.h	2004-08-05 17:22:31.000000000 +0530
+++ linux-2.6.8-rc2-mm2-cs3.new/include/linux/cpuset.h	2004-08-10 22:58:23.000000000 +0530
@@ -14,6 +14,43 @@
 
 #ifdef CONFIG_CPUSETS
 
+struct cpuset {
+	unsigned long flags;		/* "unsigned long" so bitops work */
+	cpumask_t cpus_allowed;		/* CPUs allowed to tasks in cpuset */
+	nodemask_t mems_allowed;	/* Memory Nodes allowed to tasks */
+
+	atomic_t count;			/* count tasks using this cpuset */
+
+	/*
+	 * We link our 'sibling' struct into our parents 'children'.
+	 * Our children link their 'sibling' into our 'children'.
+	 */
+	struct list_head sibling;	/* my parents children */
+	struct list_head children;	/* my children */
+
+	struct cpuset *parent;		/* my parent */
+	struct dentry *dentry;		/* cpuset fs entry */
+};
+
+/* bits in struct cpuset flags field */
+typedef enum {
+	CS_CPU_EXCLUSIVE,
+	CS_MEM_EXCLUSIVE,
+	CS_REMOVED,
+	CS_NOTIFY_ON_RELEASE
+} cpuset_flagbits_t;
+
+static struct cpuset top_cpuset = {
+	.flags = ((1 << CS_CPU_EXCLUSIVE) | (1 << CS_MEM_EXCLUSIVE)),
+	.cpus_allowed = CPU_MASK_ALL,
+	.mems_allowed = NODE_MASK_ALL,
+	.count = ATOMIC_INIT(0),
+	.sibling = LIST_HEAD_INIT(top_cpuset.sibling),
+	.children = LIST_HEAD_INIT(top_cpuset.children),
+	.parent = NULL,
+	.dentry = NULL,
+};
+
 extern int cpuset_init(void);
 extern void cpuset_fork(struct task_struct *p);
 extern void cpuset_exit(struct task_struct *p);
@@ -26,8 +63,14 @@ int cpuset_zonelist_valid_mems_allowed(s
 int cpuset_zone_allowed(struct zone *z);
 extern struct file_operations proc_cpuset_operations;
 
+#define INIT_TASK_CPUSET(tsk)	\
+	.cpuset = &top_cpuset,		\
+	.mems_allowed = NODE_MASK_ALL,
+
 #else /* !CONFIG_CPUSETS */
 
+#define INIT_TASK_CPUSET(tsk)
+
 static inline int cpuset_init(void) { return 0; }
 static inline void cpuset_fork(struct task_struct *p) {}
 static inline void cpuset_exit(struct task_struct *p) {}
diff -Naurp linux-2.6.8-rc2-mm2-cs3/include/linux/init_task.h linux-2.6.8-rc2-mm2-cs3.new/include/linux/init_task.h
--- linux-2.6.8-rc2-mm2-cs3/include/linux/init_task.h	2004-08-05 17:20:52.000000000 +0530
+++ linux-2.6.8-rc2-mm2-cs3.new/include/linux/init_task.h	2004-08-10 22:47:14.000000000 +0530
@@ -3,6 +3,7 @@
 
 #include <linux/file.h>
 #include <linux/pagg.h>
+#include <linux/cpuset.h>
 
 #define INIT_FILES \
 { 							\
@@ -114,6 +115,7 @@ extern struct group_info init_groups;
 	.switch_lock	= SPIN_LOCK_UNLOCKED,				\
 	.journal_info	= NULL,						\
 	INIT_TASK_PAGG(tsk)						\
+	INIT_TASK_CPUSET(tsk)						\
 }
 
 
diff -Naurp linux-2.6.8-rc2-mm2-cs3/include/linux/pagg.h linux-2.6.8-rc2-mm2-cs3.new/include/linux/pagg.h
--- linux-2.6.8-rc2-mm2-cs3/include/linux/pagg.h	2004-08-05 17:20:52.000000000 +0530
+++ linux-2.6.8-rc2-mm2-cs3.new/include/linux/pagg.h	2004-08-10 20:12:45.000000000 +0530
@@ -183,7 +183,7 @@ static inline void pagg_exec(struct task
  */
 #define INIT_TASK_PAGG(tsk) \
 	.pagg_list = LIST_HEAD_INIT(tsk.pagg_list),     \
-	.pagg_sem  = __RWSEM_INITIALIZER(tsk.pagg_sem)
+	.pagg_sem  = __RWSEM_INITIALIZER(tsk.pagg_sem),
 
 #else  /* CONFIG_PAGG */
 
diff -Naurp linux-2.6.8-rc2-mm2-cs3/init/main.c linux-2.6.8-rc2-mm2-cs3.new/init/main.c
--- linux-2.6.8-rc2-mm2-cs3/init/main.c	2004-08-05 17:22:31.000000000 +0530
+++ linux-2.6.8-rc2-mm2-cs3.new/init/main.c	2004-08-11 21:50:24.970179272 +0530
@@ -569,8 +569,6 @@ asmlinkage void __init start_kernel(void
 #ifdef CONFIG_PROC_FS
 	proc_root_init();
 #endif
-	cpuset_init();
-
 	check_bugs();
 
 	/* Do the rest non-__init'ed, we're now alive */
@@ -708,6 +706,8 @@ static int init(void * unused)
 	smp_init();
 	sched_init_smp();
 
+	cpuset_init();
+	
 	/*
 	 * Do this before initcalls, because some drivers want to access
 	 * firmware files.
diff -Naurp linux-2.6.8-rc2-mm2-cs3/kernel/cpuset.c linux-2.6.8-rc2-mm2-cs3.new/kernel/cpuset.c
--- linux-2.6.8-rc2-mm2-cs3/kernel/cpuset.c	2004-08-11 22:02:47.077361832 +0530
+++ linux-2.6.8-rc2-mm2-cs3.new/kernel/cpuset.c	2004-08-11 22:01:07.416512584 +0530
@@ -54,32 +54,6 @@
 
 #define CPUSET_SUPER_MAGIC 		0x27e0eb
 
-struct cpuset {
-	unsigned long flags;		/* "unsigned long" so bitops work */
-	cpumask_t cpus_allowed;		/* CPUs allowed to tasks in cpuset */
-	nodemask_t mems_allowed;	/* Memory Nodes allowed to tasks */
-
-	atomic_t count;			/* count tasks using this cpuset */
-
-	/*
-	 * We link our 'sibling' struct into our parents 'children'.
-	 * Our children link their 'sibling' into our 'children'.
-	 */
-	struct list_head sibling;	/* my parents children */
-	struct list_head children;	/* my children */
-
-	struct cpuset *parent;		/* my parent */
-	struct dentry *dentry;		/* cpuset fs entry */
-};
-
-/* bits in struct cpuset flags field */
-typedef enum {
-	CS_CPU_EXCLUSIVE,
-	CS_MEM_EXCLUSIVE,
-	CS_REMOVED,
-	CS_NOTIFY_ON_RELEASE
-} cpuset_flagbits_t;
-
 /* convenient tests for these bits */
 static inline int is_cpu_exclusive(const struct cpuset *cs)
 {
@@ -101,17 +75,6 @@ static inline int notify_on_release(cons
 	return !!test_bit(CS_NOTIFY_ON_RELEASE, &cs->flags);
 }
 
-static struct cpuset top_cpuset = {
-	.flags = ((1 << CS_CPU_EXCLUSIVE) | (1 << CS_MEM_EXCLUSIVE)),
-	.cpus_allowed = CPU_MASK_ALL,
-	.mems_allowed = NODE_MASK_ALL,
-	.count = ATOMIC_INIT(0),
-	.sibling = LIST_HEAD_INIT(top_cpuset.sibling),
-	.children = LIST_HEAD_INIT(top_cpuset.children),
-	.parent = NULL,
-	.dentry = NULL,
-};
-
 static struct vfsmount *cpuset_mount;
 static struct super_block *cpuset_sb = NULL;
 

  parent reply	other threads:[~2004-08-11 12:58 UTC|newest]

Thread overview: 233+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-05 10:08 [PATCH] new bitmap list format (for cpusets) Paul Jackson
2004-08-05 10:10 ` [PATCH] cpusets - big numa cpu and memory placement Paul Jackson
2004-08-05 20:55   ` [Lse-tech] " Martin J. Bligh
2004-08-06  2:05     ` Paul Jackson
2004-08-06  3:24       ` Martin J. Bligh
2004-08-06  8:31         ` Paul Jackson
2004-08-06 15:30         ` Erich Focht
2004-08-06 15:35           ` Martin J. Bligh
2004-08-06 15:48             ` Hubertus Franke
2004-08-07  6:30               ` Paul Jackson
2004-08-07  6:45               ` Paul Jackson
2004-08-06 15:49             ` Hubertus Franke
2004-08-06 15:52             ` Hubertus Franke
2004-08-06 15:55             ` Erich Focht
2004-08-07  6:10           ` Paul Jackson
2004-08-07 15:22             ` Erich Focht
2004-08-07 18:59               ` Paul Jackson
2004-08-08  3:17               ` Paul Jackson
2004-08-08 14:50               ` Martin J. Bligh
2004-08-11  0:43                 ` Paul Jackson
2004-08-11  9:40                 ` Erich Focht
2004-08-11 14:49                   ` Martin J. Bligh
2004-08-11 17:50                     ` Paul Jackson
2004-08-11 21:12                       ` Shailabh Nagar
2004-08-12  7:15                         ` Paul Jackson
2004-08-12 12:58                           ` Jack Steiner
2004-08-12 14:50                           ` Martin J. Bligh
2004-08-11 15:12                   ` Shailabh Nagar
2004-08-08 20:22               ` Shailabh Nagar
2004-08-09 15:57                 ` Hubertus Franke
2004-08-10 11:31                   ` [ckrm-tech] " Paul Jackson
2004-08-10 22:38                     ` Shailabh Nagar
2004-08-11 10:42                       ` Erich Focht
2004-08-11 14:56                         ` Shailabh Nagar
2004-08-14  8:51                       ` Paul Jackson
2004-08-08 19:58             ` Shailabh Nagar
2004-10-01 23:41               ` Andrew Morton
2004-10-02  6:06                 ` Paul Jackson
2004-10-02 14:55                   ` Dipankar Sarma
2004-10-02 16:14                     ` Hubertus Franke
2004-10-02 18:04                       ` Paul Jackson
2004-10-02 23:21                       ` Peter Williams
2004-10-02 23:44                         ` Hubertus Franke
2004-10-03  0:00                           ` Peter Williams
2004-10-03  3:44                           ` Paul Jackson
2004-10-05  3:13                           ` [ckrm-tech] " Matthew Helsley
2004-10-05  8:30                             ` Hubertus Franke
2004-10-05 14:20                               ` Paul Jackson
2004-10-03  2:59                         ` Paul Jackson
2004-10-03  3:19                         ` Paul Jackson
2004-10-03  3:53                           ` Peter Williams
2004-10-03  4:47                             ` Paul Jackson
2004-10-03  5:12                               ` Peter Williams
2004-10-03  5:39                                 ` Paul Jackson
2004-10-03  4:02                           ` Paul Jackson
2004-10-03  3:39                         ` Paul Jackson
2004-10-03 14:36                         ` Martin J. Bligh
2004-10-03 15:39                           ` Paul Jackson
2004-10-03 23:53                             ` Martin J. Bligh
2004-10-04  0:02                               ` Martin J. Bligh
2004-10-04  0:53                                 ` Paul Jackson
2004-10-04  3:56                                   ` Martin J. Bligh
2004-10-04  4:24                                     ` Paul Jackson
2004-10-04 15:03                                       ` Martin J. Bligh
2004-10-04 15:53                                         ` [ckrm-tech] " Paul Jackson
2004-10-04 18:17                                           ` Martin J. Bligh
2004-10-04 20:25                                             ` Paul Jackson
2004-10-04 22:15                                               ` Martin J. Bligh
2004-10-05  9:17                                                 ` Paul Jackson
2004-10-05 10:01                                                   ` Paul Jackson
2004-10-05 22:24                                                   ` Matthew Dobson
2004-10-05  9:26                                         ` Simon Derr
2004-10-05  9:58                                           ` Paul Jackson
2004-10-05 19:34                                           ` Martin J. Bligh
2004-10-06  0:28                                             ` Paul Jackson
2004-10-06  1:16                                               ` Martin J. Bligh
2004-10-06  2:08                                                 ` Paul Jackson
2004-10-06 22:59                                                   ` Matthew Dobson
2004-10-06 23:23                                                     ` Peter Williams
2004-10-07  0:16                                                       ` Rick Lindsley
2004-10-07 18:27                                                         ` Paul Jackson
2004-10-07  8:51                                                     ` Paul Jackson
2004-10-07 10:53                                                       ` Rick Lindsley
2004-10-07 14:41                                                         ` Martin J. Bligh
     [not found]                                                         ` <20041007072842.2bafc320.pj@sgi.com>
2004-10-07 19:05                                                           ` Rick Lindsley
2004-10-10  2:15                                                             ` [ckrm-tech] " Paul Jackson
2004-10-11 22:06                                                               ` Matthew Dobson
2004-10-11 22:58                                                                 ` Paul Jackson
2004-10-12 21:22                                                                   ` Matthew Dobson
2004-10-12  8:50                                                                 ` Simon Derr
2004-10-12 21:25                                                                   ` Matthew Dobson
2004-10-10  2:28                                                             ` Paul Jackson
     [not found]                                                           ` <4165A31E.4070905@watson.ibm.com>
2004-10-08 13:14                                                             ` Paul Jackson
2004-10-08 15:42                                                               ` Hubertus Franke
2004-10-08 18:23                                                                 ` Paul Jackson
2004-10-09  1:00                                                                   ` Matthew Dobson
2004-10-09 20:08                                                                     ` [Lse-tech] " Paul Jackson
2004-10-11 22:16                                                                       ` Matthew Dobson
2004-10-11 22:42                                                                         ` Paul Jackson
2004-10-10  0:05                                                                     ` Paul Jackson
2004-10-11 22:18                                                                       ` Matthew Dobson
2004-10-11 22:39                                                                         ` Paul Jackson
2004-10-09  0:51                                                               ` Matthew Dobson
2004-10-10  0:50                                                                 ` [Lse-tech] " Paul Jackson
2004-10-10  0:59                                                                 ` Paul Jackson
2004-10-09  0:22                                                             ` Matthew Dobson
2004-10-12 22:24                                                               ` [Lse-tech] " Hanna Linder
2004-10-13 20:56                                                                 ` Matthew Dobson
2004-10-09  0:06                                                           ` [Lse-tech] " Matthew Dobson
2004-10-07 12:47                                                       ` Simon Derr
2004-10-07 14:49                                                         ` Martin J. Bligh
2004-10-07 17:54                                                           ` Paul Jackson
2004-10-07 18:13                                                             ` Martin J. Bligh
2004-10-08  9:23                                                               ` Erich Focht
2004-10-08  9:50                                                                 ` Andrew Morton
2004-10-08 10:40                                                                   ` Erich Focht
2004-10-08 14:26                                                                     ` Martin J. Bligh
2004-10-08  9:53                                                                 ` Nick Piggin
2004-10-08 11:40                                                                   ` Erich Focht
2004-10-08 14:24                                                                 ` Martin J. Bligh
2004-10-08 22:37                                                                   ` Erich Focht
2004-10-14 10:35                                                               ` Eric W. Biederman
2004-10-14 11:22                                                                 ` Erich Focht
2004-10-14 11:23                                                                 ` Paul Jackson
2004-10-14 19:39                                                                 ` Paul Jackson
2004-10-14 22:38                                                                   ` Hubertus Franke
2004-10-15  1:26                                                                     ` Paul Jackson
2004-10-07 18:25                                                             ` Andrew Morton
2004-10-07 19:52                                                               ` Paul Jackson
2004-10-07 21:04                                                                 ` [ckrm-tech] " Matthew Helsley
2004-10-10  3:22                                                               ` Paul Jackson
2004-10-07 19:16                                                             ` Rick Lindsley
2004-10-10  2:35                                                               ` Paul Jackson
2004-10-10  5:12                                                           ` [ckrm-tech] " Paul Jackson
2004-10-08 23:48                                                       ` Matthew Dobson
2004-10-09  0:18                                                         ` Nick Piggin
2004-10-11 23:00                                                           ` Matthew Dobson
2004-10-11 23:09                                                             ` Nick Piggin
2004-10-05 22:33                                           ` Matthew Dobson
2004-10-06  3:01                                             ` Paul Jackson
2004-10-06 23:12                                               ` Matthew Dobson
2004-10-07  8:59                                                 ` [ckrm-tech] " Paul Jackson
2004-10-04  0:45                               ` Paul Jackson
2004-10-04 11:44                                 ` Rick Lindsley
2004-10-04 22:46                                   ` [ckrm-tech] " Paul Jackson
2004-10-05 22:19                               ` Matthew Dobson
2004-10-06  2:39                                 ` Paul Jackson
2004-10-06 23:21                                   ` Matthew Dobson
2004-10-07  9:41                                     ` [ckrm-tech] " Paul Jackson
2004-10-06  2:47                                 ` Paul Jackson
2004-10-06  9:43                                   ` Simon Derr
2004-10-06 13:27                                     ` Paul Jackson
2004-10-06 21:55                                     ` Peter Williams
2004-10-06 22:49                                       ` Paul Jackson
2004-10-06  8:02                                 ` Simon Derr
2005-02-07 23:59                                 ` Matthew Dobson
2005-02-08  0:20                                   ` Andrew Morton
2005-02-08  0:34                                     ` Paul Jackson
2005-02-08  9:54                                   ` Dinakar Guniguntala
2005-02-08  9:49                                     ` Nick Piggin
2005-02-08 16:13                                       ` Martin J. Bligh
2005-02-08 23:26                                         ` Nick Piggin
2005-02-09  4:23                                           ` Paul Jackson
2005-02-08 19:32                                       ` Matthew Dobson
2005-02-09  2:53                                         ` Nick Piggin
2005-02-08 19:00                                     ` Matthew Dobson
2005-02-08 20:42                                       ` Paul Jackson
2005-02-08 22:14                                         ` Matthew Dobson
2005-02-08 23:58                                           ` Shailabh Nagar
2005-02-09  0:27                                             ` Paul Jackson
2005-02-09  0:24                                           ` Paul Jackson
2005-02-09 17:59                                         ` [ckrm-tech] " Chandra Seetharaman
2005-02-11  2:46                                           ` Chandra Seetharaman
2005-02-11  9:21                                             ` Paul Jackson
2005-02-12  1:37                                               ` Chandra Seetharaman
2005-02-12  6:16                                                 ` Paul Jackson
2005-02-11 16:54                                             ` Jesse Barnes
2005-02-11 18:42                                               ` Chandra Seetharaman
2005-02-11 18:50                                                 ` Jesse Barnes
2005-02-08 16:15                                   ` Martin J. Bligh
2005-02-08 22:17                                     ` Matthew Dobson
2004-10-03 16:02                           ` Paul Jackson
2004-10-03 23:47                             ` Martin J. Bligh
2004-10-04  3:33                               ` Paul Jackson
2004-10-03 20:10                           ` Tim Hockin
2004-10-04  1:56                             ` Paul Jackson
2004-10-03  3:35                     ` Paul Jackson
2004-10-03 20:21                   ` Erich Focht
2004-10-03 20:48                     ` Andrew Morton
2004-10-04 14:05                       ` Erich Focht
2004-10-04 14:57                         ` Martin J. Bligh
2004-10-04 15:30                           ` Paul Jackson
2004-10-04 15:41                             ` Martin J. Bligh
2004-10-04 16:02                               ` Paul Jackson
2004-10-04 18:19                                 ` Martin J. Bligh
2004-10-04 18:29                                   ` Paul Jackson
2004-10-04 15:38                           ` Paul Jackson
2004-10-04 16:46                           ` Paul Jackson
2004-10-04  3:41                     ` Paul Jackson
2004-10-04 13:58                     ` Hubertus Franke
2004-10-04 14:13                       ` Simon Derr
2004-10-04 14:15                       ` Erich Focht
2004-10-04 15:23                         ` Paul Jackson
2004-10-04 14:37                       ` Paul Jackson
2004-10-02 15:46                 ` [ckrm-tech] " Marc E. Fiuczynski
2004-10-02 16:17                   ` Hubertus Franke
2004-10-02 17:53                     ` Paul Jackson
2004-10-02 18:16                       ` Hubertus Franke
2004-10-02 19:14                         ` Paul Jackson
2004-10-02 23:29                         ` Peter Williams
2004-10-02 23:51                           ` Hubertus Franke
2004-10-02 20:40                     ` Andrew Morton
2004-10-02 23:08                       ` Hubertus Franke
2004-10-02 22:26                         ` Alan Cox
2004-10-03  2:49                         ` Paul Jackson
2004-10-03 12:19                           ` Hubertus Franke
2004-10-03  3:25                         ` Paul Jackson
2004-10-03  2:26                       ` Paul Jackson
2004-10-03 14:11                         ` Paul Jackson
2004-10-02 17:47                   ` Paul Jackson
2004-08-05 20:47 ` [Lse-tech] [PATCH] new bitmap list format (for cpusets) Martin J. Bligh
2004-08-05 21:45   ` Paul Jackson
     [not found]     ` <Pine.A41.4.53.0408060930100.20680@isabelle.frec.bull.fr>
2004-08-06 10:14       ` Paul Jackson
2004-08-09  8:01   ` Paul Jackson
2004-08-09 14:49     ` Martin J. Bligh
2004-08-10 23:43       ` Paul Jackson
2004-08-11 13:11 ` Dinakar Guniguntala [this message]
2004-08-11 16:17   ` Paul Jackson
2004-08-11 18:05     ` Dinakar Guniguntala
2004-08-11 20:40       ` Paul Jackson
2004-08-12  9:48         ` Dinakar Guniguntala
2004-08-12 10:11           ` Paul Jackson
2004-08-12 12:34             ` Dinakar Guniguntala

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=20040811131155.GA4239@in.ibm.com \
    --to=dino@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lse-tech@lists.sourceforge.net \
    --cc=pj@sgi.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