public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Wragg <david@wragg.org>
To: "Albert Cahalan" <acahalan@gmail.com>
Cc: linux-kernel@vger.kernel.org, bcrl@kvack.org
Subject: Re: [PATCH] procfs: export context switch counts in /proc/*/stat
Date: Sun, 24 Dec 2006 01:40:52 +0000	[thread overview]
Message-ID: <87y7oy840r.fsf@wragg.org> (raw)
In-Reply-To: <787b0d920612200936w186a783aj81d10384c54dfc7e@mail.gmail.com> (Albert Cahalan's message of "Wed\, 20 Dec 2006 12\:36\:23 -0500")

"Albert Cahalan" <acahalan@gmail.com> writes:
> The cumulative ones are still not justified though, and I fear they
> may be 64-bit even on i386.

All the context switch counts are unsigned long.

> It turns out that an i386 procps spends
> much of its time doing 64-bit division to parse the damn ASCII crap.
> I suppose I could just skip those fields, but generating them isn't
> too cheap and probably I'd get stuck parsing them for some other
> reason -- having them separate is probably a good idea.

I can't think of a compelling justification for the cumulative context
switch counts.  But I suggest that if the cost of exposing these
values is low enough, they should be exposed anyway, just for the sake
of uniformity (these would be the only two getrusage values not
present in /proc/pid/stat).

If the decimal representation of values in /proc/pid/stat has such
unpleasant overheads, then I wonder if that is something worth fixing,
whether the context switch counts are added or not?  It occurs to me
that it would be easy to add support for a hex version of
/proc/pid/stat with very little additional code, by using an alternate
sprintf format string in fs/proc/array.c:do_task_stat().  I assume
that procps could be adapted quite easily to take advantage of this?


David

  reply	other threads:[~2006-12-24  1:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20  5:40 [PATCH] procfs: export context switch counts in /proc/*/stat Albert Cahalan
2006-12-20 13:20 ` David Wragg
2006-12-20 13:48   ` Arjan van de Ven
2006-12-20 14:38     ` David Wragg
2006-12-20 14:51       ` Arjan van de Ven
2006-12-20 15:13         ` David Wragg
2006-12-20 17:36   ` Albert Cahalan
2006-12-24  1:40     ` David Wragg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-12-21  6:02 Al Boldi
2006-12-18 23:50 David Wragg
2006-12-19  6:39 ` Benjamin LaHaise
2006-12-19 11:47   ` David Wragg

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=87y7oy840r.fsf@wragg.org \
    --to=david@wragg.org \
    --cc=acahalan@gmail.com \
    --cc=bcrl@kvack.org \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox