Use integer for size of cpuset, as it won't be bigger than INT_MAX,

This is requested by bge.
Also move the sysctl into file kern_cpuset.c, because it should
always be there, it is independent of thread scheduler.
This commit is contained in:
davidxu 2010-11-01 00:42:25 +00:00
parent c108d430e6
commit 4c899bcdf5
2 changed files with 4 additions and 9 deletions

View File

@ -107,6 +107,10 @@ static struct setlist cpuset_ids;
static struct unrhdr *cpuset_unr;
static struct cpuset *cpuset_zero;
/* Return the size of cpuset_t at the kernel level */
SYSCTL_INT(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD,
0, sizeof(cpuset_t), "sizeof(cpuset_t)");
cpuset_t *cpuset_root;
/*

View File

@ -2713,7 +2713,6 @@ sysctl_kern_sched_topology_spec(SYSCTL_HANDLER_ARGS)
return (err);
}
static size_t _kern_cpuset_size = sizeof(cpuset_t);
#endif
SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RW, 0, "Scheduler");
@ -2751,14 +2750,6 @@ SYSCTL_PROC(_kern_sched, OID_AUTO, topology_spec, CTLTYPE_STRING |
CTLFLAG_RD, NULL, 0, sysctl_kern_sched_topology_spec, "A",
"XML dump of detected CPU topology");
/*
* Return the size of cpuset_t at the kernel level
*
* XXX (gcooper): replace ULONG with SIZE once CTLTYPE_SIZE is implemented.
*/
SYSCTL_ULONG(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD,
&_kern_cpuset_size, 0, "Kernel-level cpuset_t struct size");
#endif
/* ps compat. All cpu percentages from ULE are weighted. */