......
I'm afraid we can't do it the way you're proposing.  files in sysfs must
conform to the one value per file rule (so we avoid the ABI nastiness
that plagues /proc).  You can create a stat directory with a bunch of
files, but not a single file that gives all values.

That was initially my understanding, but when I looked at this the precedent 
had already been set, see for example the block subsys:

[root@darwin ~]# grep . /sys/block/sd*/stat
/sys/block/sda/stat:   27351     6890   609272   228129    36810   920727  
7660304  1333950        0   556889  1562009
/sys/block/sdb/stat:    2369     6762    18890    39003        0        0       
 0        0        0     4059    39002
[root@darwin ~]#

I can only assume it was implemented this way for the sake of
efficiency, eg avoid a huge amount of file open/read/close calls in
sar/iostat. It's not unusual for us to see a thousand block devices
on enterprise servers, multiply that by the number of above entries
and you would be talking about 11 x block-dev-count per iostat read
iteration. Okay for tapes we typically don't see anything like this
number but the patch just follows the precedent set with the block
device. Nevertheless, if opinion is really strong against this we
could split each stat out in to a single file.


Actually, to be a little more thorough I checked the kernel Docs:


[root@darwin Documentation]# less ./filesystems/sysfs.txt

....
Attributes
~~~~~~~~~~

Attributes can be exported for kobjects in the form of regular files in
the filesystem. Sysfs forwards file I/O operations to methods defined
for the attributes, providing a means to read and write kernel
attributes.

Attributes should be ASCII text files, preferably with only one value
per file. It is noted that it may not be efficient to contain only one
value per file, so it is socially acceptable to express an array of
values of the same type.
....


Technically speaking we are not providing an array of the same types, so again 
I'd say if opinion is really strong then we can break this out. It's really 
then a question of file-io efficiency. The biggest tape library I've seen has 
2700 drives installed, however I think devices of that number are few and far 
between....


Regards

Darren
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to