public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Peschke <mp3@de.ibm.com>
To: artusemrys@sbcglobal.net
Cc: "Randy.Dunlap" <rdunlap@xenotime.net>,
	greg@kroah.com, akpm@osdl.org, ak@suse.de,
	linux-kernel@vger.kernel.org
Subject: Re: statistics infrastructure (in -mm tree) review
Date: Thu, 22 Jun 2006 13:43:32 +0200	[thread overview]
Message-ID: <449A8264.8000507@de.ibm.com> (raw)
In-Reply-To: <4499A030.8020106@sbcglobal.net>

Matthew Frost wrote:
> Martin Peschke wrote:
>> On Tue, 2006-06-20 at 09:50 -0700, Randy.Dunlap wrote:
>>> On Tue, 20 Jun 2006 17:40:01 +0200 Martin Peschke wrote:
>>>> Greg KH wrote:
>>>>>> 7) With regard to the delivery of statistic data to user land,
>>>>>> a library maintaining statistic counters, histograms or whatever
>>>>>> on behalf of exploiters doesn't need any help from the exploiter.
>>>>>> We can avoid the usual callbacks and code bloat in exploiters
>>>>>> this way.
>>>>> I don't really understand what you are stating here.
>>>> Sorry.
>>>> 1,$s/exploiter/client/g
>>>>
>>>> Any device driver or whatever gathering statistics data currently
>>>> has code dealing with showing the data. Usually, they have some
>>>> callbacks for procfs, sysfs or whatever.
>>>>
>>>> My point is that, if a library keeps track of statistics on behalf
>>>> of its clients, no client needs to be called back in order to
>>>> merge, format, copy, etc. data being shown to users. The library
>>>> can handle as a background operation without disturbing clients.
>>> That could be a good thing.  OTOH, it means that the library
>>> has to be either all-ways flexible or willing to change to
>>> accommodate clients since you can't predict the universe of all
>>> clients' requirements.
>>
>> Right. I have made provisions for that to some degree.
>>
>>
>> First, I could imagine that the statistics data of a client requires
>> a new way its data should be aggregated and, therewith, requires
>> a new form of statistic result being shown to users.
>>
>> I have scanned through the kernel sources for ways of aggregating
>> and showing statistics data. The usual constructs appear to be:
>>
>> - counter
>> - histogram (for intervals), linear scale
>> - histogram (for intervals), logarithmic scale
>> - "histogram" for discrete and sparse values
>> - "utilisation indicator" or "fill level indicator" (num-min-avg-max)
>>
>> These are implemented in my patches. I would expect these to cover most
>> requirements of possible new clients.
> 
> So you're saying, as regards "putting presentation format in ... the 
> kernel", that we already have presentation formats specified pell-mell 
> in the kernel.  That should then be a non-issue, because you aren't 
> introducing anything new, just centralizing an existing kernel behavior. 
>  Do I have you right?

Yes, there seem to be as many formats as statistics. See examples below.
My patches can help to improve usuability by providing some common basic
formats.

IMO, it would not make sense to "enhance" the statistics library in an
attempt to emulate all the preexisting statistic output formats.

[root@t2930041 ~]# cat /proc/dasd/statistics
31 dasd I/O requests
with 392 sectors(512B each)
    __<4    ___8    __16    __32    __64    _128    _256    _512    __1k
    __2k    __4k    __8k    _16k    _32k    _64k    128k
    _256    _512    __1M    __2M    __4M    __8M    _16M    _32M    _64M
    128M    256M    512M    __1G    __2G    __4G    _>4G
Histogram of sizes (512B secs)
       0       0      21       7       3       0       0       0       0
       0       0       0       0       0       0       0
       0       0       0       0       0       0       0       0       0
       0       0       0       0       0       0       0
Histogram of I/O times (microseconds)
       0       0       0       0       0       0       0       3       6
       1       5       6      10       0       0       0
       0       0       0       0       0       0       0       0       0
       0       0       0       0       0       0       0
<snip>

[root@t2930041 ~]# cat /proc/diskstats
<snip>
   94    0 dasda 67389 1478 1142520 281080 78260 461181 4326752 10280570
  0 6392030 10565980
   94    1 dasda1 68849 1142272 540838 4326704
   94    4 dasdb 27 29 448 0 0 0 0 0 0 0 0
   94    5 dasdb1 27 216 0 0
   94    8 dasdc 28 29 456 40 0 0 0 0 0 30 40
   94    9 dasdc1 28 224 0 0
    9    0 md0 0 0 0 0 0 0 0 0 0 0 0
    8    0 sda 35423 12268 4340826 284540 8605 275966 2276792 980810
  0 219260 1265370
    8   16 sdb 36741 12626 4588754 293140 10090 277678 2302400 440010
  0 221990 733140
    8   32 sdc 36621 11748 4548722 298170 10394 272680 2264736 303580
  0 223110 601730

[root@t2930041 ~]# cat /proc/net/stat/arp_cache
entries  allocs destroys hash_grows  lookups hits  res_failed
rcv_probes_mcast rcv_probes_ucast  periodic_gc_runs forced_gc_runs
00000002  0000002c 000000cd 00000000  00000082 00000056
00000000  00000000 00000000  00017306 00000000
00000002  00000031 00000000 00000000  0000007d 0000004c
00000000  00000000 00000000  00000000 00000000
00000002  0000002f 00000000 00000001  00000074 00000045
00000000  00000000 00000000  00000000 00000000
00000002  00000043 00000000 00000000  00000084 00000041
00000000  00000000 00000000  00000000 00000000

>> If another construct would be needed anyway, it can be added to the
>> statistics library by implemententing about half a dozen routines
>> described by struct statistic_discipline. I might be wrong, but I don't
>> think we would see an inflationary growth there.
>>
>>
> -- elision --
>>
>> OTOH, I don't see a real need for allowing that. Data can be reformatted
>> and rearranged in any possible way in user space.
> 
> Because you're just providing a range of basic output formats, 
> standardized.  So anybody can ask for statistics from the kernel in a 
> preferred output to then massage as needed in userland.  ACK?  Am I 
> oversimplifying?

Sounds reasonable.

Thanks, Martin


  reply	other threads:[~2006-06-22 11:43 UTC|newest]

Thread overview: 166+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-04 20:50 2.6.18 -mm merge plans Andrew Morton
2006-06-04 21:20 ` 2.6.18 hdrinstall (Re: 2.6.18 -mm merge plans) Bernhard Rosenkraenzer
2006-06-04 21:33 ` header cleanup and install David Woodhouse
2006-06-04 21:43   ` Andrew Morton
2006-06-05 10:52   ` Jens Axboe
2006-06-05 10:54     ` David Woodhouse
2006-06-05 10:59       ` Jens Axboe
2006-06-05 10:57         ` David Woodhouse
2006-06-05 11:03           ` Jens Axboe
2006-06-05 18:09             ` Andrew Morton
2006-06-05 19:19               ` David Woodhouse
2006-06-17 20:35                 ` Alistair John Strachan
2006-06-17 21:20                   ` David Woodhouse
2006-06-04 21:36 ` 2.6.18 -mm merge plans Alan Cox
2006-06-04 21:41 ` kbuild, kconfig and hrdinstall stuff Sam Ravnborg
2006-06-04 21:54   ` David Woodhouse
2006-06-04 23:04 ` klibc (was: 2.6.18 -mm merge plans) H. Peter Anvin
2006-06-05 18:09   ` Roman Zippel
2006-06-06 15:20   ` Pavel Machek
2006-06-06 20:56     ` Rafael J. Wysocki
2006-06-07  3:37       ` H. Peter Anvin
2006-06-07  4:00       ` Nigel Cunningham
2006-06-07  4:10         ` H. Peter Anvin
2006-06-07  4:25           ` Nigel Cunningham
2006-06-07  4:26             ` klibc H. Peter Anvin
2006-06-07  6:22               ` klibc Nigel Cunningham
2006-06-07  6:38                 ` klibc H. Peter Anvin
2006-06-07  6:51             ` klibc (was: 2.6.18 -mm merge plans) Joshua Hudson
2006-06-07 21:12               ` H. Peter Anvin
2006-06-09  8:03                 ` klibc Nix
2006-06-09 18:45                   ` klibc H. Peter Anvin
     [not found]                   ` <bda6d13a0606091050n40fda044v668eef09af3c29a7@mail.gmail.com>
     [not found]                     ` <871wty6rl9.fsf@hades.wkstn.nix>
2006-06-09 22:28                       ` klibc Joshua Hudson
2006-06-09 22:48                         ` klibc H. Peter Anvin
2006-06-09 23:13                           ` klibc Joshua Hudson
2006-06-09 23:44                             ` klibc H. Peter Anvin
2006-06-16  6:02                               ` klibc Joshua Hudson
2006-06-16 19:19                                 ` klibc H. Peter Anvin
2006-06-07  8:44       ` klibc (was: 2.6.18 -mm merge plans) Pavel Machek
2006-06-07  9:44         ` Rafael J. Wysocki
2006-06-04 23:50 ` clocksource Roman Zippel
2006-06-05 20:20   ` clocksource john stultz
2006-06-05 20:53     ` clocksource john stultz
2006-06-05 21:07     ` clocksource Roman Zippel
2006-06-06 19:42       ` clocksource john stultz
2006-06-07  0:41         ` clocksource Roman Zippel
2006-06-08  8:05           ` clocksource john stultz
2006-06-15 11:40             ` clocksource Roman Zippel
2006-06-16  3:21               ` clocksource john stultz
2006-06-16  3:35                 ` clocksource john stultz
2006-06-16 15:33                 ` clocksource Roman Zippel
2006-06-16 18:48                   ` clocksource john stultz
2006-06-17 19:45                     ` clocksource Roman Zippel
2006-06-17 17:04                 ` clocksource Andrew Morton
2006-06-05  0:02 ` utsname/hostname Randy.Dunlap
2006-06-05  1:06   ` utsname/hostname Andrew Morton
2006-06-05  3:10     ` utsname/hostname Randy.Dunlap
     [not found] ` <20060605002807.GA4919@mail.ustc.edu.cn>
2006-06-05  0:28   ` readahead benchmark Fengguang Wu
2006-06-05  1:02     ` Andrew Morton
2006-06-05  0:32 ` new SCSI drivers (was Re: 2.6.18 -mm merge plans) Jeff Garzik
2006-06-05  1:06 ` wireless " Jeff Garzik
2006-06-05  1:15   ` Andrew Morton
2006-06-05  8:33     ` Andreas Mohr
2006-06-05  8:45       ` Arjan van de Ven
2006-06-05 10:26         ` Alan Cox
2006-06-05 10:35           ` Arjan van de Ven
2006-06-05 10:59             ` Alan Cox
2006-06-10  6:58             ` Pavel Machek
2006-06-05  8:54   ` Christoph Hellwig
2006-06-05 12:33     ` Jeff Garzik
2006-06-05 12:48       ` Arjan van de Ven
2006-06-05 12:52         ` Jeff Garzik
2006-06-05 14:02           ` Linux kernel and laws Adrian Bunk
2006-06-05 14:21             ` linux-os (Dick Johnson)
2006-06-06  5:33             ` Evgeniy Polyakov
2006-06-05 13:27     ` wireless (was Re: 2.6.18 -mm merge plans) John W. Linville
2006-06-05 13:31       ` Christoph Hellwig
2006-06-05 13:42       ` Arjan van de Ven
2006-06-05 16:24       ` Alan Cox
2006-06-29 14:26         ` ACX100 (softmac-based) driver ready to merge, but is it legal? -- " John W. Linville
     [not found]           ` <20060629144233.GB24463@tuxdriver.com>
2006-06-29 14:47             ` [Acx100-users] Denis Vlasenko, where are you? (mail bounced) Andreas Mohr
2006-06-05  1:32 ` merging new drivers (was Re: 2.6.18 -mm merge plans) Jeff Garzik
2006-06-05  1:47   ` Andrew Morton
2006-06-05  8:59     ` Christoph Hellwig
2006-06-05  9:10       ` Andrew Morton
2006-06-05  9:16         ` Arjan van de Ven
2006-06-05 11:10       ` Ivan Novick
2006-06-05 11:26         ` Adrian Bunk
2006-06-05  6:58   ` Francois Romieu
2006-06-05 10:32     ` Alan Cox
2006-06-05 10:36       ` Arjan van de Ven
2006-06-06  2:02         ` Chris Wright
2006-06-06  7:01           ` Andi Kleen
2006-06-06 13:04             ` Steven Rostedt
2006-06-05 13:38 ` 2.6.18 -mm merge plans -- GFS David Woodhouse
2006-06-05 14:10   ` Russell King
2006-06-05 15:01   ` Steven Whitehouse
2006-06-07  7:12     ` Steven Whitehouse
2006-06-05 14:08 ` 2.6.18 -mm merge plans Oleg Nesterov
2006-06-05 14:43 ` Serge E. Hallyn
2006-06-08 19:56   ` Eric W. Biederman
2006-06-09 13:02     ` Serge E. Hallyn
2006-06-09 23:25     ` Serge E. Hallyn
2006-06-10  0:39       ` Eric W. Biederman
2006-06-10  1:23         ` Serge E. Hallyn
2006-06-10  7:52           ` Eric W. Biederman
2006-06-10  8:09           ` Eric W. Biederman
2006-06-10  9:53       ` Christoph Hellwig
     [not found] ` <20060605010501.GA4931@mail.ustc.edu.cn>
2006-06-05  1:05   ` statistics infrastructure Fengguang Wu
2006-06-05 16:30   ` Greg KH
2006-06-13 23:47     ` statistics infrastructure (in -mm tree) review Greg KH
2006-06-14  0:18       ` Randy.Dunlap
2006-06-14 16:45         ` Greg KH
2006-06-14 22:48         ` Martin Peschke
2006-06-19 22:12           ` Greg KH
2006-06-20 15:40             ` Martin Peschke
2006-06-20 16:50               ` Randy.Dunlap
2006-06-21 18:51                 ` Martin Peschke
2006-06-21 19:38                   ` Matthew Frost
2006-06-22 11:43                     ` Martin Peschke [this message]
2006-06-14  5:04       ` Andi Kleen
2006-06-14 22:49         ` Martin Peschke
2006-06-16 20:40           ` Greg KH
2006-06-16 21:34             ` Martin Peschke
2006-06-17  6:51           ` Andi Kleen
2006-06-17 11:03             ` Martin Peschke
2006-06-17 10:30       ` Martin Peschke
2006-06-06  0:54 ` Merge of per task delay accounting (was Re: 2.6.18 -mm merge plans) Balbir Singh
2006-06-06 22:28   ` Shailabh Nagar
2006-06-06 22:40     ` Andrew Morton
2006-06-08 14:27       ` Shailabh Nagar
2006-06-08 17:42         ` Andrew Morton
2006-06-08 18:36           ` Shailabh Nagar
2006-06-08 19:33             ` Balbir Singh
2006-06-06 22:52     ` Jay Lan
2006-06-06 22:55       ` Shailabh Nagar
2006-06-12 12:02       ` Martin Peschke
2006-06-12 13:28         ` Shailabh Nagar
2006-06-06 12:32 ` 2.6.18 -mm pi-futex merge Steven Rostedt
2006-06-06 13:34   ` Roman Zippel
2006-06-06 13:44     ` Steven Rostedt
2006-06-06 14:42 ` genirq Ingo Molnar
2006-06-06 16:56   ` genirq Daniel Walker
2006-06-07  8:42     ` genirq Ingo Molnar
2006-06-07  3:46   ` genirq Benjamin Herrenschmidt
2006-06-06 14:53 ` 2.6.18 -mm merge plans Ingo Molnar
2006-06-06 16:02   ` Andrew Morton
2006-06-06 16:35     ` Arjan van de Ven
2006-06-06 20:47     ` lock validator [2.6.18 -mm merge plans] Ingo Molnar
2006-06-07  3:52 ` mutex vs. local irqs (Was: 2.6.18 -mm merge plans) Benjamin Herrenschmidt
2006-06-07  4:29   ` Andrew Morton
2006-06-07  5:04     ` Benjamin Herrenschmidt
2006-06-07  5:29       ` Andrew Morton
2006-06-07  6:44         ` Benjamin Herrenschmidt
2006-06-07  7:03           ` Andrew Morton
2006-06-07 13:21           ` Ingo Molnar
2006-06-08  0:31             ` Benjamin Herrenschmidt
2006-06-08 10:49               ` David Woodhouse
2006-06-08 10:53                 ` Ingo Molnar
2006-06-08 11:01                   ` David Woodhouse
2006-06-08 11:17               ` Roman Zippel
2006-06-08 13:38                 ` Benjamin Herrenschmidt
2006-06-08 14:02                   ` Roman Zippel
2006-06-08 23:40                     ` Benjamin Herrenschmidt
2006-06-08 22:59             ` Paul Mackerras
2006-06-10 10:22 ` 2.6.18 -mm merge plans Christoph Hellwig
2006-06-14 15:18   ` Michael Halcrow

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=449A8264.8000507@de.ibm.com \
    --to=mp3@de.ibm.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=artusemrys@sbcglobal.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox