linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [Patch 0/6] statistics infrastructure
@ 2006-05-23 20:42 Al Boldi
  0 siblings, 0 replies; 11+ messages in thread
From: Al Boldi @ 2006-05-23 20:42 UTC (permalink / raw)
  To: linux-kernel

Martin Peschke wrote:
> Andrew Morton wrote:
> > Martin Peschke <mp3@de.ibm.com> wrote:
> >> My patch series is a proposal for a generic implementation of
> >> statistics.
> >
> > This uses debugfs for the user interface, but the
> > per-task-delay-accounting-*.patch series from Balbir creates an
> > extensible netlink-based system for passing instrumentation results back
> > to userspace.
> >
> > Can this code be converted to use those netlink interfaces, or is
> > Balbir's approach unsuitable, or hasn't it even been considered, or
> > what?
>
> Andrew,
>
> taskstats, Balbir'r approach, is too specific and doesn't work for me.
> It is by design limited to per-task data.
>
> My statistics code is not limited to per-task statistics, but allows
> exploiters to have data been accumulated and been shown for whatever
> entity they need to, may it be for tasks, for SCSI disks, per adapter, per
> queue, per interface, for a device driver, etc.

How does your work and Balbir's and CKRM relate to each other?

Is there not a way to abstract your works to provide a common statistics 
infrastructure for all?

Thanks!

--
Al


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Patch 0/6] statistics infrastructure
@ 2006-05-24 12:27 Martin Peschke
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Peschke @ 2006-05-24 12:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Andrew,

Patches are against 2.6.17-rc4-git12. Only change since last time
is a beautification of the timestamp code (now using NSEC_PER_SEC etc.)

	Martin



My patch series is a proposal for a generic implementation of statistics.
Envisioned exploiters include device drivers, and any other component.
It provides both a unified programming interface for exploiters as well
as a unified user interface. It comes with a set of disciplines that
implement various ways of data processing, like counters and histograms.

The recent rework addresses performance issues and memory footprint,
straightens some concepts out, streamlines the programming interface,
removes some weiredness from the user interface, and reduces the
amount of code.

A few more keywords for the reader's convenience:
based on per-cpu data; spinlock-free protection of data; observes
cpu-hot(un)plug for efficient memory use; tiny state machine for
switching-on, switching-off, releasing data etc.; configurable by users
at run-time; still sitting in debugfs; simple addition of other disciplines.

Good places to start reading code are:

   statistic_create(), statistic_remove()
   statistic_add(), statistic_inc()
   struct statistic_interface, struct statistic
   struct statistic_discipline, statistic_*_counter()
   statistic_transition()



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Patch 0/6] statistics infrastructure
  2006-05-23 21:42     ` Andrew Morton
@ 2006-05-24  3:12       ` Balbir Singh
  0 siblings, 0 replies; 11+ messages in thread
From: Balbir Singh @ 2006-05-24  3:12 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Martin Peschke, linux-kernel

<snip>
> > Andrew,
> >
> > taskstats, Balbir'r approach, is too specific and doesn't work for me.
> > It is by design limited to per-task data.
>
> OK.  They are pretty different things.
>
> Balbir, do you see any sane way in which the APIs you've implemented can be
> extended to cover this requirement?

I'll work with Martin on that. If Martin decides to move to
netlink/genetlink we could search for some common ground w.r.t to
transfering data to user space, but IMHO its going to be hard, our API
is meant to be used in task context. I think both the statistics
target different use cases (one is device driver oriented and the
other is task oriented)

>
> > My statistics code is not limited to per-task statistics, but allows exploiters
> > to have data been accumulated and been shown for whatever entity they need to,
> > may it be for tasks, for SCSI disks, per adapter, per queue, per interface,
> > for a device driver, etc.
>
> OK.
>
> > If you want me to change my code to use netlink anyway, I might be able to
> > implement my own genetlink family. I haven't look at the details of that yet.
> >
>
> Well, a debugfs interface _should_ be OK.  If not, why do we need debugfs?
>
> Ho hum, hard.  Please send the patches again, let's take a closer look, see
> if we can move them forward a bit.
>

Warm Regards,
Balbir
Linux Technology Center,
India Software Labs,
Bangalore

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Patch 0/6] statistics infrastructure
  2006-05-23 16:59   ` Martin Peschke
@ 2006-05-23 21:42     ` Andrew Morton
  2006-05-24  3:12       ` Balbir Singh
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2006-05-23 21:42 UTC (permalink / raw)
  To: Martin Peschke; +Cc: linux-kernel, balbir

Martin Peschke <mp3@de.ibm.com> wrote:
>
> Andrew Morton wrote:
> > Martin Peschke <mp3@de.ibm.com> wrote:
> >> My patch series is a proposal for a generic implementation of statistics.
> > 
> > This uses debugfs for the user interface, but the
> > per-task-delay-accounting-*.patch series from Balbir creates an extensible
> > netlink-based system for passing instrumentation results back to userspace.
> > 
> > Can this code be converted to use those netlink interfaces, or is Balbir's
> > approach unsuitable, or hasn't it even been considered, or what?
> > 
> 
> Andrew,
> 
> taskstats, Balbir'r approach, is too specific and doesn't work for me.
> It is by design limited to per-task data.

OK.  They are pretty different things.

Balbir, do you see any sane way in which the APIs you've implemented can be
extended to cover this requirement?

> My statistics code is not limited to per-task statistics, but allows exploiters
> to have data been accumulated and been shown for whatever entity they need to,
> may it be for tasks, for SCSI disks, per adapter, per queue, per interface,
> for a device driver, etc.

OK.

> If you want me to change my code to use netlink anyway, I might be able to
> implement my own genetlink family. I haven't look at the details of that yet.
> 

Well, a debugfs interface _should_ be OK.  If not, why do we need debugfs?

Ho hum, hard.  Please send the patches again, let's take a closer look, see
if we can move them forward a bit.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Patch 0/6] statistics infrastructure
  2006-05-19 16:24 ` Andrew Morton
       [not found]   ` <661de9470605191159n75578d60qd1f3309e3a7e2234@mail.gmail.com>
  2006-05-19 23:03   ` Martin Peschke
@ 2006-05-23 16:59   ` Martin Peschke
  2006-05-23 21:42     ` Andrew Morton
  2 siblings, 1 reply; 11+ messages in thread
From: Martin Peschke @ 2006-05-23 16:59 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Balbir Singh

Andrew Morton wrote:
> Martin Peschke <mp3@de.ibm.com> wrote:
>> My patch series is a proposal for a generic implementation of statistics.
> 
> This uses debugfs for the user interface, but the
> per-task-delay-accounting-*.patch series from Balbir creates an extensible
> netlink-based system for passing instrumentation results back to userspace.
> 
> Can this code be converted to use those netlink interfaces, or is Balbir's
> approach unsuitable, or hasn't it even been considered, or what?
> 

Andrew,

taskstats, Balbir'r approach, is too specific and doesn't work for me.
It is by design limited to per-task data.

My statistics code is not limited to per-task statistics, but allows exploiters
to have data been accumulated and been shown for whatever entity they need to,
may it be for tasks, for SCSI disks, per adapter, per queue, per interface,
for a device driver, etc.

If you want me to change my code to use netlink anyway, I might be able to
implement my own genetlink family. I haven't look at the details of that yet.

	Martin




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Patch 0/6] statistics infrastructure
  2006-05-19 23:03   ` Martin Peschke
@ 2006-05-21 11:29     ` Balbir Singh
  0 siblings, 0 replies; 11+ messages in thread
From: Balbir Singh @ 2006-05-21 11:29 UTC (permalink / raw)
  To: Martin Peschke; +Cc: Andrew Morton, linux-kernel

> Andrew, Balbir,
> 
> I will read Balbir's patches. Probably, I won't manage it this weekend,
> as a friend of mine is visiting.
> 
> Why doesn't come it as a surprise that the user interface appears to
> restart the discussion ;-)
> I can't comment on netlink yet. There are some thoughts on why I
> chose debugfs in my documentation file.
> 
> Balbir, could you try to summarise briefly what the main issues are that
> your patches solve?
>

We collect statistics about the delays that are experienced by each task on
the system. Note, that this information is per-task.

The information collected provides us with information about the number of
times the the task executed on the runqueue, the delay it encountered
waiting for CPU (run_delay) and the total time it spent on the runqueue.
Similar statistics are collected for block io and swapin block io.

The statistics can be queried at any time (during the lifetime of the task)
and user space can be notified of the statistics when the task exits.

More detailed information can be found at
http://lkml.org/lkml/2006/5/2/30

and in the Documentation/accounting directory tree in -mm

I hope this is the summary you were looking for.

	Warm Regards,
	Balbir Singh,
	Linux Technology Center,
	IBM Software Labs

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Patch 0/6] statistics infrastructure
  2006-05-19 16:24 ` Andrew Morton
       [not found]   ` <661de9470605191159n75578d60qd1f3309e3a7e2234@mail.gmail.com>
@ 2006-05-19 23:03   ` Martin Peschke
  2006-05-21 11:29     ` Balbir Singh
  2006-05-23 16:59   ` Martin Peschke
  2 siblings, 1 reply; 11+ messages in thread
From: Martin Peschke @ 2006-05-19 23:03 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Balbir Singh

Andrew Morton wrote:
> Martin Peschke <mp3@de.ibm.com> wrote:
>> My patch series is a proposal for a generic implementation of statistics.
> 
> This uses debugfs for the user interface, but the
> per-task-delay-accounting-*.patch series from Balbir creates an extensible
> netlink-based system for passing instrumentation results back to userspace.
> 
> Can this code be converted to use those netlink interfaces, or is Balbir's
> approach unsuitable, or hasn't it even been considered, or what?

Andrew, Balbir,

I will read Balbir's patches. Probably, I won't manage it this weekend,
as a friend of mine is visiting.

Why doesn't come it as a surprise that the user interface appears to
restart the discussion ;-)
I can't comment on netlink yet. There are some thoughts on why I
chose debugfs in my documentation file.

Balbir, could you try to summarise briefly what the main issues are that
your patches solve?

To summarise the issues I want to solve with my paches:

First, we have a requirement to provide statistics for our FCP attachment
(transport latencies, utilisation of likely bottlenecks, etc.),
mostly for customer service reasons. This is what the small exploitation
patches are about.

Second, I thought it useful to get there by implementing and using a generic
statistics infrastructure that could be called by other kernel components.
This is what the bulk of my patches and all of the documentation is about.
Debugfs is just one aspect of it (- it shouldn't be too difficult to rip
it out and use some other transport). But, there are other features like
the various modes for accumulating data, and that the on-the-fly data
processing is configurable by users to a certain degree.

Martin



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Patch 0/6] statistics infrastructure
       [not found]   ` <661de9470605191159n75578d60qd1f3309e3a7e2234@mail.gmail.com>
@ 2006-05-19 19:02     ` Balbir Singh
  0 siblings, 0 replies; 11+ messages in thread
From: Balbir Singh @ 2006-05-19 19:02 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Martin Peschke, linux-kernel

On 5/20/06, Balbir Singh <balbir@in.ibm.com> wrote:
>
> On 5/19/06, Andrew Morton <akpm@osdl.org> wrote:
>
> >  Martin Peschke <mp3@de.ibm.com> wrote:
> > >
> > > My patch series is a proposal for a generic implementation of statistics.
> >
> > This uses debugfs for the user interface, but the
> > per-task-delay-accounting-*.patch series from Balbir creates an extensible
> > netlink-based system for passing instrumentation results back to userspace.
> >
> > Can this code be converted to use those netlink interfaces, or is Balbir's
> > approach unsuitable, or hasn't it even been considered, or what?
> >
> >
>
Hi, Martin/Andrew,

I am resending this email, my mailer got crazy and sent out HTML (sorry!)

I have seen the patches around, but I've had no time to review them. I
was planning to do so this weekend.

The main difference I see, like you pointed out is the netlink
interface vs debugfs. I think the netlink approach is more suitable
(there is no need to mount a filesystem and create files followed by
frequent open/read/close operations). Just one netlink socket should
do the trick. The event subscription mechanism in netlink is very
useful as well.

Martin, could you please take a look at the taskstats interface and
see if it is possible to make use of them?

Thanks,
Balbir

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Patch 0/6] statistics infrastructure
  2006-05-19 16:07 Martin Peschke
@ 2006-05-19 16:24 ` Andrew Morton
       [not found]   ` <661de9470605191159n75578d60qd1f3309e3a7e2234@mail.gmail.com>
                     ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Andrew Morton @ 2006-05-19 16:24 UTC (permalink / raw)
  To: Martin Peschke; +Cc: linux-kernel, Balbir Singh

Martin Peschke <mp3@de.ibm.com> wrote:
>
> My patch series is a proposal for a generic implementation of statistics.

This uses debugfs for the user interface, but the
per-task-delay-accounting-*.patch series from Balbir creates an extensible
netlink-based system for passing instrumentation results back to userspace.

Can this code be converted to use those netlink interfaces, or is Balbir's
approach unsuitable, or hasn't it even been considered, or what?


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Patch 0/6] statistics infrastructure
@ 2006-05-19 16:07 Martin Peschke
  2006-05-19 16:24 ` Andrew Morton
  0 siblings, 1 reply; 11+ messages in thread
From: Martin Peschke @ 2006-05-19 16:07 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Andrew, please apply.

Changes since I have posted these patches last time:

- improvements as suggested on lkml
  (documentation, comments, coding style, etc.)

- fixed race in statistic_add()/statistic_inc()
  with regard to releasing statistics



My patch series is a proposal for a generic implementation of statistics.
Envisioned exploiters include device drivers, and any other component.
It provides both a unified programming interface for exploiters as well
as a unified user interface. It comes with a set of disciplines that
implement various ways of data processing, like counters and histograms.

The recent rework addresses performance issues and memory footprint,
straightens some concepts out, streamlines the programming interface,
removes some weiredness from the user interface, reduces the amount of
code, and moves the exploitation according to last time's feedback.

A few more keywords for the reader's convenience:
based on per-cpu data; spinlock-free protection of data; observes
cpu-hot(un)plug for efficient memory use; tiny state machine for
switching-on, switching-off, releasing data etc.; configurable by users
at run-time; still sitting in debugfs; simple addition of other disciplines.

Good places to start reading code are:

   statistic_create(), statistic_remove()
   statistic_add(), statistic_inc()
   struct statistic_interface, struct statistic
   struct statistic_discipline, statistic_*_counter()
   statistic_transition()

Martin




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [patch 0/6] statistics infrastructure
@ 2005-12-14 16:13 Martin Peschke
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Peschke @ 2005-12-14 16:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

This patch set replaces s390-statistics-infrastructure.patch in the -mm tree.

The common code component proposed makes a unified and inexpensive way
for providing statistics available to kernel programmers, particularly
device driver programmers. It comes with an architecture independent and
exploiter (device driver) independent user interface and allows users to
adjust gathering and processing of statistics data to their needs.

Patch 5/6 contains more detailed information in the form of a
Documentation/ file.

The most important change since s390-statistics-infrastructure.patch is
that the code doesn't just seem to be quite generic, but really is generic.

I have worked through the list of improvements pointed out by Andrew in the
following lkml thread
http://marc.theaimsgroup.com/?l=linux-kernel&m=113050865300184&w=2

Furthermore, I spend some extra time on comments and I fixed
some bugs, mostly related to allocation and NULL-pointer issues.

I am posting a patch for the zfcp driver, as well, which would
be the first exploiter of the statistics infrastructure. Actually, the
zfcp driver has been my test vehicle.

Patch set is against 2.6.15-rc5-git4.

Please keep me on cc: since I am not subscribed to lkml.

List of patches:

[patch 1/6] statistics infrastructure - prerequisite: scatter-gather ringbuffer
[patch 2/6] statistics infrastructure - prerequisite: parser enhancement
[patch 3/6] statistics infrastructure - prerequisite: list operation
[patch 4/6] statistics infrastructure - prerequisite: timestamp
[patch 5/6] statistics infrastructure
[patch 6/6] statistics infrastructure - exploitation: zfcp


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-05-24 12:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-23 20:42 [Patch 0/6] statistics infrastructure Al Boldi
  -- strict thread matches above, loose matches on Subject: below --
2006-05-24 12:27 Martin Peschke
2006-05-19 16:07 Martin Peschke
2006-05-19 16:24 ` Andrew Morton
     [not found]   ` <661de9470605191159n75578d60qd1f3309e3a7e2234@mail.gmail.com>
2006-05-19 19:02     ` Balbir Singh
2006-05-19 23:03   ` Martin Peschke
2006-05-21 11:29     ` Balbir Singh
2006-05-23 16:59   ` Martin Peschke
2006-05-23 21:42     ` Andrew Morton
2006-05-24  3:12       ` Balbir Singh
2005-12-14 16:13 [patch " Martin Peschke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).