[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: updatedb+checksecurity are killing my battery



Laurent de Segur <ldesegur@mac.com> writes:

> End result: I get longer battery life.  However, there is probably
> something I missed that could help more in this direction. I would
> appreciate if people on the list could post more hints in order to
> get more juice off the hook. Thanks in advance,

My favorite trick is to remount my filesystems with "noatime".
Especially with a journalling filesystem like XFS, which has to touch
the disk in several places for metadata updates like access time
updates, it can be a big win.

Here's my power control function:

function pwrctl_Core99() 
{
	case "$1" in
	minimum)
	    	# min power, set disk to spin down after 1 minute
                $logger -p daemon.info -t pwrctl "going to minimum power"	
	;;
	medium)
	    	# medium power, set disk to spin down after 2.5 minutes
                $logger -p daemon.info -t pwrctl "going to medium power"	
    	;;
	maximum)
		case "$2" in
		ac)
                $logger -p daemon.info -t pwrctl "ac in, remounting with atime"	
		mount -o remount,atime /
		;;
		*)
                $logger -p daemon.info -t pwrctl "on battery, remounting with noatime"	
		mount -o remount,noatime /
    			# on battery, set disk to spin down after 5 minutes
		;;
		esac
    	;;
	warning)
		do_warn
	;;
	sleep)
    	;;
	wakeup)
		# maybe force wakeup of media bay devices? 
	;;
	*)
		$logger -p daemon.error -t pwrctl "$0: invalid arg $1"
	;;
	esac
} 



Reply to: