public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ragnar Kjørstad" <kernel@ragnark.vestdata.no>
To: Tim Schmielau <tim@physik3.uni-rostock.de>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Arthur Corliss <corliss@digitalmages.com>,
	watters@sgi.com, law@sgi.com, te@scali.com
Subject: Re: [PATCH][RFC] fix BSD accounting (w/ long-term perspective ;-)
Date: Fri, 12 Mar 2004 18:59:59 +0100	[thread overview]
Message-ID: <20040312175959.GN1066@vestdata.no> (raw)
In-Reply-To: <Pine.LNX.4.53.0403082241200.16420@gockel.physik3.uni-rostock.de>

[ CCing Sam Watters and Linda Walsh at SGI for feedback about using
pid/ppid/pgid/sid/paggid/whatever to track jobs in accounting-logs ]

On Tue, Mar 09, 2004 at 12:03:27AM +0100, Tim Schmielau wrote:
> BSD accounting currently reports only the lower 16 bits of 32 bit uids,
> reports times in units of 1/HZ seconds while it announces a unit of
> 1/100 seconds in the header file (which hurts especially on i386 where
> HZ changed since 2.4) and cannot report times longer that 49 days.

Red Hat uses a patch that adds 32 bit uids and 32 bit gids at the end of
struct acct, reducing the size of the padding to 2 bytes. If a simular
extension is added to the official kernel it would be nice if they were
compatible.


There is also a few other problems with the current implementation that
we would like to see fixed if there is going to be a format-change
anyway:
- Architecture indepencence. It would be nice if the binary format was
  independent of the architecture so files can be processed on other
  hosts. This would involve defining padding and byte-ordering, as well
  as either stop using 1/HZ units in the file or add AHZ to the record.

- Better accuracy. Specificly the records don't include an exact
  termination-time for the process. One can estimate termination-time
  based on creation time and elapsed time but since elapsed time is
  truncated into comp_t it is not accurate for long-lived processes.

- More information. Accounting is typically used to keep track of
  what resources different jobs have used, where the definition of
  "job" may differ from site to site. Quite often "job" is a group
  of related processes, so including pid/ppid would allow
  post-processing to rebuild the process-hierarchy and deduce what
  processes were part of the same job. Even better, if usespace
  could notify the kernel what job a process belongs to, it would be
  easier to track jobs across multiple nodes in a cluster and so on.
  Maybe adding pid, ppid and jobid to the format and then use the sid
  as the jobid for now? And then it can be replaced by a proper jobid
  from e.g. PAGG later?

>    My proposed solution: keep backwards compatibility with 2.4 by using
>    a unit of 1/USER_HZ, announce that correctly in the header file,
>    and simply admit that BSD accounting on i386 is broken in 2.6.0-2.6.4.

Sounds good.

>  - store a version number in the last byte of struct acct, which allows
>    for a smooth transition to a new binary format when 2.7 comes out.
>    For 2.7, extend uid/gid fields to 32 bit, report times in terms
>    of AHZ=100 on all platforms (thus allowing to report times up to 1988 
>    days), and remove the compatibility stuff from the kernel.

It may be useful to have the version-information in the beginning of the
struct to allow future versions to use a struct of a different size.
There should be some bits available in the flag-field, maybe that's
enough?


-- 
Ragnar Kjørstad
Software Engineer
Scali - http://www.scali.com
High Performance Clustering

  parent reply	other threads:[~2004-03-12 18:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-08 23:03 [PATCH][RFC] fix BSD accounting (w/ long-term perspective ;-) Tim Schmielau
2004-03-08 23:33 ` Tim Schmielau
2004-03-09  0:23 ` Arthur Corliss
2004-03-12 17:59 ` Ragnar Kjørstad [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-03-12 23:20 Albert Cahalan

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=20040312175959.GN1066@vestdata.no \
    --to=kernel@ragnark.vestdata.no \
    --cc=corliss@digitalmages.com \
    --cc=law@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=te@scali.com \
    --cc=tim@physik3.uni-rostock.de \
    --cc=watters@sgi.com \
    /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