Buying a laptop - used
Ian Smith
smithi at nimnet.asn.au
Mon Feb 2 16:51:05 UTC 2015
On Sun, 1 Feb 2015 21:14:58 -1000, parv wrote:
> in message <20150201154129.J14378 at sola.nimnet.asn.au>,
> wrote Ian Smith thusly...
> >
>
> Hi Ian,
Aloha parv!
> > On Sat, 31 Jan 2015 04:51:30 -1000, Parv wrote:
> ...
> > > I am currently using a used Lenovo Thinkpad X200 with FreeBSD
> > > 8. I have not tried using or setting at all any suspend-resume
> > > setting. A 9-celll battery ([0], "47++", apparently bought new
> > > about 2-3 years ago along with the 'puter) lasts for 4.5 hours.
> >
> > I bought a used X200 a year ago without AC adaptor or battery, so
> > bought it a new 6-cell battery (47+) and 65W P/S (about AU$150).
> > Using powerd - but not p4tcc or acpi_throttle - it runs almost 6
> > hours on battery just idling and over 4 hours with moderate use,
>
> Sweet, Ian! Which version of FreeBSD are you running? 8-STABLE is on
> my X200 for now; have been thinking (for a while) to update to
> 10-STABLE.
Presently 9.3-R sources, GENERIC plus a couple of patches and 9.2-R xorg
and ports; too busy with other projects to update it and it's not broke.
> > so your 9-cell battery may be getting a bit old, and/or you
> > haven't optimised power usage?
>
> No, I have not used any power related things in FreeBSD itself. I do
> have BIOS setup to maximum performance when connected to AC power;
> optimize battery otherwise. One thing I am not sure is what happens
> when booted up on battery & some time later connect to AC, and vice
> versa.
Below I'll include a small script that shows what's going on in that
respect. I don't think the BIOS AC/battery performance settings have
any effect at all in FreeBSD, but this script will tell you for sure.
> In any case I will try powered, and possibly other things.
https://wiki.freebsd.org/TuningPowerConsumption is a good place to
start. Alexander goes to extremes - and doubles battery life - but the
big ones are running powerd to only rev up the CPU/s when needed, and
allowing use of C2 and C3 power states, which work reliably on these.
In /boot/loader.conf:
acpi_ibm_load="YES"
hint.p4tcc.0.disabled=1
hint.acpi_throttle.0.disabled=1
This allows EST to run the CPUs at 800, 1600, 2400 & '2401' (turbo) MHz,
where CPU power consumption is fairly proportional to frequency. Using
p4tcc or acpi_throttle provides many more rates down to 100MHz, but they
don't reduce power consumption, make powerd work slower and harder while
shuffling frequency, and are removed as defaults from -CURRENT we hear.
In /etc/rc.conf:
performance_cx_lowest=C3 # you can use "Cmax" here, same on X200
economy_cx_lowest=C3
powerd_enable="YES"
powerd_flags="-a adp -b adp -i 70 -r 90"
Those powerd settings are you might say 'non-aggressive', only boosting
speed on fairly high demand. Lots of fun tuning these to your workload.
> > After a problem that affected many/most modern T and X series
> > Lenovos regarding losing external USB ports on resume was resolved
> > last year, suspend and resume work flawlesly; they're really nice
> > little machines.
>
> Good to hear. Would that be suspend-to-RAM?
Yes, FreeBSD doesn't do suspend to disk (ACPI state S4) unless BIOS
supports it and none do these days, to my knowledge. I haven't done any
real tests, but suspect the X200 would run for a week in S3 suspend (if
you don't charge your mobile from its USB ports while suspended :)
> > Arnab may not wish to buy anything as old as an X200 (C.2008),
>
> Oh, I remembered later somebody was running FreeBSD 11 on Macbook
> Pro 2011 ...
>
> http://blog.foxkit.us/2015/01/freebsd-on-apple-macbook-pro-82-now.html?spref=tw
That and its previous episode are really good posts for Mac people
considering FreeBSD. If my daughter would only let me play with hers :)
These also needed an ACPI fix mostly affecting HP laptops that's just
been committed to 9 & 10 regarding reporting of AC/battery states etc.
> > but could likely pick up an X210/220/230, or the larger
> > T410/420/430 models at a good price.
>
> Sure. (I am also looking for another one, this time much lighter
> than X200. Is Thinkpad X1 Carbon II any lighter, I wonder.)
I expect so. And I expect they may work with 9.x and 10.x by now,
there's been some good ACPI and video stuff MFC'd lately I gather.
https://wiki.freebsd.org/Laptops/Thinkpad_X1_Carbon
Also - though out of date re Lenovo problems having dead USB on resume:
https://wiki.freebsd.org/SuspendResume
> > Very latest models may still have some issues with video?
>
> Well, somebody had reported success|progress with Intel i915 on
> 11-CURRENT (and somebody else had working suspend-resume with
> "recent HEAD" on X230) ...
>
> https://twitter.com/etnapierala/status/561500382850215936
I can't keep track of it at all nowadays .. but I don't think you need
to run -CURRENT except perhaps newest laptops with latest chipsets, and
except perhaps for the latest wireless work, lacking helpers to MFC it.
cheers, Ian
Oh yes, scripts; I use this one often:
% cat /root/bin/x200stat
#!/bin/sh
t=" "
echo -n "`date` "
sysctl dev.cpu.0.freq
echo "`sysctl -n dev.cpu.0.cx_usage` $t `sysctl -n vm.loadavg`"
echo "`sysctl -n dev.cpu.1.cx_usage` $t { `sysctl -n kern.eventtimer.timer` }"
sysctl dev.acpi_ibm | egrep 'fan_|thermal'
sysctl hw.acpi.thermal.tz0.temperature
sysctl hw.acpi.thermal.tz1.temperature
acpiconf -i0 | egrep 'State|Remain|Present|Volt'
And also added to /etc/devd.conf
notify 10 {
match "system" "ACPI";
match "subsystem" "CMBAT";
action "/root/bin/acpi_cmbat $notify";
};
% cat /root/bin/acpi_cmbat
#!/bin/sh
#% acpi_cmbat 27/6/14 for CMBAT notifies. from /etc/rc.d/power_profile
LOGGER="logger -t acpi_cmbat -p daemon.notice"
notify=$1
${LOGGER} "CMBAT notify = $1"
#% 27/10/14 logs at 3%, 20%, 80% and discharging, high & charging states
/root/bin/x200stat >> /root/acpi_cmbat_events.log
echo "CMBAT status: notify = $1" >> /root/acpi_cmbat_events.log
exit 0
More information about the freebsd-mobile
mailing list