Miao Xie
cb4ad1ffc7
sched: fair-group: fix a Div0 error of the fair group scheduler
...
When I echoed 0 into the "cpu.shares" file, a Div0 error occured.
We found it is caused by the following calling.
sched_group_set_shares(tg, shares)
set_se_shares(tg->se[i], shares/nr_cpu_ids)
__set_se_shares(se, shares)
div64_64((1ULL<<32), shares)
When the echoed value was less than the number of processores, the result of the
sentence "shares/nr_cpu_ids" was 0, and then the system called div64() to divide
the result, the Div0 error occured.
It is unnecessary that the shares value is divided by nr_cpu_ids, I think.
Because in the function __update_group_shares_cpu() and init_tg_cfs_entry(),
the shares value isn't divided by nr_cpu_ids when setting shares of the sched
entity.
This patch fixes this bug. And echoing ULONG_MAX value into cpu.shares also
causes Div0 error, so we set a macro MAX_SHARES to limit the max value of
shares.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com >
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl >
Signed-off-by: Ingo Molnar <mingo@elte.hu >
2008-05-05 23:56:18 +02:00
..
2008-05-02 13:40:34 +02:00
Merge branches 'release', 'acpica', 'bugzilla-10224', 'bugzilla-9772', 'bugzilla-9916', 'ec', 'eeepc', 'idle', 'misc', 'pm-legacy', 'sysfs-links-2.6.26', 'thermal', 'thinkpad' and 'video' into release
2008-04-30 13:58:00 -04:00
2008-05-03 18:11:48 +02:00
2008-02-09 23:27:01 -08:00
2008-03-24 19:22:20 -07:00
2008-02-14 21:13:33 -08:00
2008-04-28 06:28:30 -04:00
2008-04-28 06:28:04 -04:00
2008-04-29 11:41:22 -07:00
2008-04-28 06:28:37 -04:00
2008-01-30 13:33:08 +01:00
2008-04-29 08:06:29 -07:00
2008-02-05 09:44:20 -08:00
2008-04-29 08:06:09 -07:00
2008-04-30 08:29:50 -07:00
2008-05-01 08:03:59 -07:00
2008-04-29 08:06:22 -07:00
2008-04-30 08:29:54 -07:00
2008-04-29 08:06:11 -07:00
2007-10-18 14:37:28 -07:00
2008-04-29 08:06:22 -07:00
2007-10-18 14:37:26 -07:00
2008-05-01 13:08:16 -04:00
2008-01-29 17:13:18 +11:00
2008-05-01 13:08:16 -04:00
2008-03-30 14:18:41 -07:00
2008-05-05 08:18:45 -07:00
2008-05-03 18:11:48 +02:00
2008-02-08 09:22:29 -08:00
2008-04-29 08:06:22 -07:00
2008-01-25 21:08:29 +01:00
2008-03-10 18:01:20 -07:00
2008-05-01 08:04:00 -07:00
2007-07-16 09:05:50 -07:00
2008-05-05 07:13:21 -05:00
2008-05-01 13:08:16 -04:00
2008-04-28 08:58:32 -07:00
2008-01-24 20:40:40 -08:00
2008-04-30 08:29:48 -07:00
2008-04-29 08:06:22 -07:00
2006-12-07 08:39:43 -08:00
2008-04-29 08:06:22 -07:00
2008-02-25 23:03:02 +01:00
2008-04-29 08:06:22 -07:00
2008-04-30 08:29:49 -07:00
2008-05-04 17:04:16 -07:00
2008-02-08 09:22:31 -08:00
2006-07-03 15:27:01 -07:00
2008-02-08 09:22:31 -08:00
2006-07-03 15:27:04 -07:00
2008-04-29 08:06:13 -07:00
2008-04-29 08:06:07 -07:00
2008-04-29 08:06:14 -07:00
2008-04-29 08:05:59 -07:00
2008-02-08 09:22:41 -08:00
2008-04-30 08:29:49 -07:00
2008-04-30 08:29:48 -07:00
2008-02-05 09:44:22 -08:00
2008-05-01 08:03:58 -07:00
2008-04-30 08:29:36 -07:00
2008-04-30 08:29:52 -07:00
2008-04-29 08:06:22 -07:00
2008-05-01 10:21:54 -07:00
2008-01-25 21:08:24 +01:00
2008-02-13 16:21:18 -08:00
2008-01-25 21:08:24 +01:00
2008-04-19 19:44:59 +02:00
2008-04-29 08:06:04 -07:00
2008-04-29 08:18:03 -07:00
2008-04-29 08:06:10 -07:00
2008-04-29 08:06:22 -07:00
2008-02-08 09:22:41 -08:00
2008-02-08 09:22:41 -08:00
2006-07-03 15:27:01 -07:00
2008-01-24 20:40:40 -08:00
2008-02-13 15:45:36 +01:00
2006-07-03 15:27:01 -07:00
2007-12-18 15:21:13 +01:00
2008-05-01 08:03:58 -07:00
2008-05-05 23:56:18 +02:00
2008-04-19 19:45:00 +02:00
2008-05-05 23:56:17 +02:00
2008-05-05 23:56:18 +02:00
2008-04-19 19:44:59 +02:00
2008-05-05 23:56:18 +02:00
2007-07-16 09:05:50 -07:00
2008-04-17 10:43:01 -04:00
2008-04-30 08:29:37 -07:00
2008-05-01 08:03:58 -07:00
2008-02-29 18:46:53 +01:00
2008-01-30 13:31:20 +01:00
2008-02-06 10:41:02 -08:00
2006-07-03 15:27:02 -07:00
2008-04-21 16:36:46 -07:00
2008-02-05 09:44:07 -08:00
2008-04-30 08:29:49 -07:00
2008-02-08 09:22:31 -08:00
2008-04-29 08:06:23 -07:00
2008-04-30 08:29:48 -07:00
2008-02-06 10:41:11 -08:00
2008-05-02 16:18:42 -07:00
2008-05-02 16:18:42 -07:00
2008-04-30 08:29:53 -07:00
2007-10-18 14:37:28 -07:00
2008-04-10 17:28:26 -07:00
2008-04-29 08:06:07 -07:00
2008-04-30 08:29:53 -07:00
2007-11-29 09:24:53 -08:00
2008-04-29 08:06:04 -07:00
2008-02-08 09:22:31 -08:00
2008-05-01 08:04:02 -07:00