lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080428125141.GF27997@elte.hu>
Date:	Mon, 28 Apr 2008 14:51:41 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Miao Xie <miaox@...fujitsu.com>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Linux-Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sched: fair-group: fix a Div0 error of the fair group
	scheduler


* Miao Xie <miaox@...fujitsu.com> wrote:

> 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.

thanks, applied.

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ