Skip to contentSkip to conversation

Per ATA host sysfs attributes?

DISCUSSION Mark Lord 2 participants 2 messages Mar 10, 2009 libata

lore
Share & tools
lore

Mark Lord

author
#0 lore raw

Guys,

I have added IRQ coalescing to sata_mv, but need a way to activate/tune it. There are two simple parameters: an IRQ count threshold, and a time threshold.

Whenever either the count or the time threshold is exceeded,
the chip will generate an interrupt (assuming at least one completed event).

These two parameters are per-chip (actually, per group of four ports within the chip). How can I export these for setting/query withing sysfs ?

It is all rather easy to create per-SCSI-host attrs in sysfs, but I don't see any obvious way to do it per-chip.

Suggestions?

For now, I'm doing it with a module parameter, but that's really rather stone-age in the sysfs era.

Thanks.

#1 lore raw
Quoted 8 lines · Mark Lord

Guys,

I have added IRQ coalescing to sata_mv, but need a way to activate/tune it. There are two simple parameters: an IRQ count threshold, and a time threshold.

Whenever either the count or the time threshold is exceeded,
the chip will generate an interrupt (assuming at least one completed event).

Quoted 6 lines

These two parameters are per-chip (actually, per group of four ports within the chip). How can I export these for setting/query withing sysfs ?

It is all rather easy to create per-SCSI-host attrs in sysfs, but I don't see any obvious way to do it per-chip. Suggestions?

The absence of a kobject associated with ata_host is largely the root cause of this problem you've noted. Long term, we want to move in a direction where we have a "storage_host" container object, containing one or more port-style objects that can be ATA or SCSI. In that scenario (and what we want to move towards, over the years), the sysfs attachment points should be fairly obvious.

Lacking a better suggestion, I suppose the answer is exporting per-chip variables multiple times, once per scsi-host. Just get the locking right, since multiple sysfs attributes access the same underlying per-chip variable.

Quoted 2 lines

For now, I'm doing it with a module parameter, but that's really rather stone-age in the sysfs era.

Indeed! :)

Jeff