All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Tejun Heo <tj@kernel.org>
Cc: Arjan van de Ven <arjan@infradead.org>,
	linux-ide@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH] libata: Add ALPM power state accounting to the AHCI driver
Date: Sun, 15 Nov 2009 03:27:33 -0500	[thread overview]
Message-ID: <4AFFBB75.7050601@pobox.com> (raw)
In-Reply-To: <4AFFB65F.3020201@kernel.org>

On 11/15/2009 03:05 AM, Tejun Heo wrote:
> 11/14/2009 12:24 PM, Arjan van de Ven wrote:
>>  From f62ff8c98080b4a9e66f82f793145b863b4e183a Mon Sep 17 00:00:00 2001
>> From: Arjan van de Ven<arjan@linux.intel.com>
>> Date: Fri, 13 Nov 2009 16:54:37 -0800
>> Subject: [PATCH] libata: Add ALPM power state accounting to the AHCI driver
>>
>> PowerTOP wants to show the user how effective the ALPM link
>> power management is for the user. ALPM is worth around 0.5W on a quiet
>> link; PowerTOP wants to be able to find and expose cases where the "quiet link"
>> isn't actually quiet.
>>
>> This patch adds state accounting functionality to the AHCI driver for
>> PowerTOP to use.
>> The parts of the patch are
>> 1) the sysfs logic of exposing the stats for each state in sysfs
>> 2) the basic accounting logic that gets update on link change interrupts
>>     (or when the user accesses the info from sysfs)
>> 3) a "accounting enable" flag; in order to get the accounting to work,
>>     the driver needs to get phyrdy interrupts on link status changes.
>>     Normally and currently this is disabled by the driver when ALPM is
>>     on (to reduce overhead); when PowerTOP is running this will need
>>     to be on to get usable statistics... hence the sysfs tunable.
>>
>> The PowerTOP output currently looks like this:
>>
>> Recent SATA AHCI link activity statistics
>> Active	Partial	Slumber	Device name
>>    0.5%	 99.5%	  0.0%	host0
>>
>> (work to resolve "host0" to a more human readable name is in progress in PowerTOP)
>
> Most of logic seems to belong to libata generic part rather than in
> ahci itself.  Wouldn't it be better to implement the thing as generic
> libata feature which ahci uses?

I had pretty much the same comment, on IRC.  The accounting variables 
should probably live in struct ata_link, or a subsidiary (struct 
ata_link_accounting ?).

What little there is of driver-specific behavior can be handled from 
existing callbacks (->enable_pm) or by creating a driver-specific 
function that calls a generic function (eg. ahci_alpm_set_accounting 
could call ata_alpm_set_accounting, before twiddling AHCI's PORT_IRQ_MASK).

	Jeff



  reply	other threads:[~2009-11-15  8:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-14  3:24 [PATCH] libata: Add ALPM power state accounting to the AHCI driver Arjan van de Ven
2009-11-15  8:05 ` Tejun Heo
2009-11-15  8:27   ` Jeff Garzik [this message]
2009-11-15 17:46     ` Arjan van de Ven
2009-11-15 18:06       ` Tejun Heo
2009-11-15 18:23         ` Arjan van de Ven
2009-11-15 18:26           ` Tejun Heo
2009-11-15 18:33             ` Arjan van de Ven
2009-11-16  1:51               ` Tejun Heo
2009-11-16  2:00                 ` Arjan van de Ven
2009-11-16  2:15                   ` Tejun Heo
2009-11-16  5:55                     ` Arjan van de Ven
2009-11-16  6:14                       ` Tejun Heo
2009-11-16  8:13                         ` Jeff Garzik
2009-11-16 14:43                           ` Arjan van de Ven
2009-11-16 14:59                             ` Tejun Heo
2009-11-16 15:21                               ` Arjan van de Ven
2009-11-16 15:35                                 ` Tejun Heo
2009-11-16 15:40                                   ` Tejun Heo
2009-11-16 15:57                                   ` Alan Cox
2009-11-16 16:25                                     ` Tejun Heo
2009-11-16 21:25                                 ` Jeff Garzik
2009-11-16 21:21                             ` Jeff Garzik
2009-11-17  5:25                               ` Arjan van de Ven
2009-11-15 17:00   ` Arjan van de Ven
2009-11-15 18:36   ` Arjan van de Ven
2009-11-15 18:42     ` Arjan van de Ven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AFFBB75.7050601@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.