Date: Thu, 4 Jul 2013 20:12:12 -0600 (MDT) From: Warren Block <wblock@wonkity.com> To: acpi@freebsd.org Cc: wblock@freebsd.org Subject: Hyper mode for powerd Message-ID: <alpine.BSF.2.00.1307041955110.10280@wonkity.com>
next in thread | raw e-mail | index | archive | help
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --3512871622-242739370-1372990333=:10280 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Attached is a proposed patch for -head that adds a "hyper" mode to powerd. Instead of slewing like the adaptive modes, this mode drops all the way to the lowest frequency when the system is idle, and jumps all the way to the highest frequency when there is any load. Subjectively, it seems more responsive for desktop use than hiadaptive mode. That's hard to benchmark. Power usage is another question. This mode might use less power than the adaptive modes, but that's also difficult to benchmark. Comments welcome. --3512871622-242739370-1372990333=:10280 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=powerd-hyper.diff Content-Transfer-Encoding: BASE64 Content-ID: <alpine.BSF.2.00.1307042012120.10280@wonkity.com> Content-Description: Content-Disposition: attachment; filename=powerd-hyper.diff SW5kZXg6IHVzci5zYmluL3Bvd2VyZC9wb3dlcmQuYw0KPT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PQ0KLS0tIHVzci5zYmluL3Bvd2VyZC9wb3dlcmQuYwkocmV2 aXNpb24gMjUyNzEzKQ0KKysrIHVzci5zYmluL3Bvd2VyZC9wb3dlcmQuYwko d29ya2luZyBjb3B5KQ0KQEAgLTYzLDYgKzYzLDcgQEANCiAJTU9ERV9NSU4s DQogCU1PREVfQURBUFRJVkUsDQogCU1PREVfSElBREFQVElWRSwNCisJTU9E RV9IWVBFUiwNCiAJTU9ERV9NQVgsDQogfSBtb2Rlc190Ow0KIA0KQEAgLTQx OSw2ICs0MjAsOCBAQA0KIAkJKm1vZGUgPSBNT0RFX0FEQVBUSVZFOw0KIAll bHNlIGlmIChzdHJjbXAoYXJnLCAiaGl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icmV2aWF0ZWQgYXMNCiAuQXIgaGFkcCAuDQorLkl0IEFyIGh5cGVyDQor SW1tZWRpYXRlbHkgZHJvcCB0byB0aGUgbG93ZXN0IGZyZXF1ZW5jeSB3aGVu IHRoZSBzeXN0ZW0gYXBwZWFycyB0byBiZQ0KK2lkbGUuDQorV2hlbiB0aGVy ZSBpcyBhbnkgbG9hZCBvbiB0aGUgc3lzdGVtLCBpbW1lZGlhdGVseSBqdW1w IHRvIHRoZSBoaWdoZXN0DQorZnJlcXVlbmN5Lg0KK01heSBiZSBhYmJyZXZp YXRlZCBhcw0KKy5BciBoeXBlIC4NCiAuRWwNCiAuUHANCiBUaGUgZGVmYXVs dCBtb2RlIGlzDQo= --3512871622-242739370-1372990333=:10280--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1307041955110.10280>