Date: Sat, 09 Apr 2011 16:39:14 +0200 From: Bartosz Fabianowski <freebsd@chillt.de> To: Daniel Gerzo <danger@FreeBSD.org> Cc: Alexander Motin <mav@FreeBSD.org>, stable@FreeBSD.org Subject: Re: powerd / cpufreq question Message-ID: <4DA06F92.4070702@chillt.de> In-Reply-To: <85cda6f83d328e67a552b2cd5758dbd3@rulez.sk> References: <4D9EEDAF.3020803@rulez.sk> <4D9EF48C.9070907@FreeBSD.org> <e229a6a374fdd5a626c0b777752fef54@rulez.sk> <4D9F2384.5000104@FreeBSD.org> <85cda6f83d328e67a552b2cd5758dbd3@rulez.sk>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------090008050507000001080607 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit I just noticed this thread a day after my own fight with powerd and load percentages that did not seem to make any sense. The patch I came up with is attached. It modifies powerd to use the load percentage of the busiest core. This reduces the range of values back to 0%...100% also for multi-core systems. On my Core i7 setup here, the change seems to work well. - Bartosz --------------090008050507000001080607 Content-Type: text/plain; name="powerd.c.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="powerd.c.diff" LS0tIHBvd2VyZC5jLm9sZAkyMDExLTA0LTA3IDE3OjMwOjU4LjAwMDAwMDAwMCArMDIwMAor KysgcG93ZXJkLmMJMjAxMS0wNC0wNyAxNzozODoyOC4wMDAwMDAwMDAgKzAyMDAKQEAgLTEy OCw3ICsxMjgsNyBAQAogCXN0YXRpYyBsb25nICpjcF90aW1lcyA9IE5VTEwsICpjcF90aW1l c19vbGQgPSBOVUxMOwogCXN0YXRpYyBpbnQgbmNwdXMgPSAwOwogCXNpemVfdCBjcF90aW1l c19sZW47Ci0JaW50IGVycm9yLCBjcHUsIGksIHRvdGFsOworCWludCBlcnJvciwgY3B1LCBp LCB0b3RhbCwgbWF4OwogCiAJaWYgKGNwX3RpbWVzID09IE5VTEwpIHsKIAkJY3BfdGltZXNf bGVuID0gMDsKQEAgLTE1MSw3ICsxNTEsNyBAQAogCQlyZXR1cm4gKGVycm9yKTsKIAkJCiAJ aWYgKGxvYWQpIHsKLQkJKmxvYWQgPSAwOworCQltYXggPSAwOwogCQlmb3IgKGNwdSA9IDA7 IGNwdSA8IG5jcHVzOyBjcHUrKykgewogCQkJdG90YWwgPSAwOwogCQkJZm9yIChpID0gMDsg aSA8IENQVVNUQVRFUzsgaSsrKSB7CkBAIC0xNjAsOSArMTYwLDEyIEBACiAJCQl9CiAJCQlp ZiAodG90YWwgPT0gMCkKIAkJCQljb250aW51ZTsKLQkJCSpsb2FkICs9IDEwMCAtIChjcF90 aW1lc1tjcHUgKiBDUFVTVEFURVMgKyBDUF9JRExFXSAtIAorCQkJdG90YWwgPSAxMDAgLSAo Y3BfdGltZXNbY3B1ICogQ1BVU1RBVEVTICsgQ1BfSURMRV0gLSAKIAkJCSAgICBjcF90aW1l c19vbGRbY3B1ICogQ1BVU1RBVEVTICsgQ1BfSURMRV0pICogMTAwIC8gdG90YWw7CisJCQlp ZiAodG90YWwgPiBtYXgpCisJCQkJbWF4ID0gdG90YWw7CiAJCX0KKwkJKmxvYWQgPSBtYXg7 CiAJfQogCiAJbWVtY3B5KGNwX3RpbWVzX29sZCwgY3BfdGltZXMsIGNwX3RpbWVzX2xlbik7 Cg== --------------090008050507000001080607--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DA06F92.4070702>