<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/acct.c, branch v2.6.18.7</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/acct.c?h=v2.6.18.7</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/acct.c?h=v2.6.18.7'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2006-07-15T04:53:54Z</updated>
<entry>
<title>[PATCH] Fix sighand-&gt;siglock usage in kernel/acct.c</title>
<updated>2006-07-15T04:53:54Z</updated>
<author>
<name>OGAWA Hirofumi</name>
<email>hirofumi@mail.parknet.co.jp</email>
</author>
<published>2006-07-14T07:24:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a4afee02a5dd4f20c08fca26e9b610e72d0bcbf0'/>
<id>urn:sha1:a4afee02a5dd4f20c08fca26e9b610e72d0bcbf0</id>
<content type='text'>
IRQs must be disabled before taking -&gt;siglock.

Noticed by lockdep.

Signed-off-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>Remove obsolete #include &lt;linux/config.h&gt;</title>
<updated>2006-06-30T17:25:36Z</updated>
<author>
<name>Jörn Engel</name>
<email>joern@wohnheim.fh-wedel.de</email>
</author>
<published>2006-06-30T17:25:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6ab3d5624e172c553004ecc862bfeac16d9d68b7'/>
<id>urn:sha1:6ab3d5624e172c553004ecc862bfeac16d9d68b7</id>
<content type='text'>
Signed-off-by: Jörn Engel &lt;joern@wohnheim.fh-wedel.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>[PATCH] fix kernel-doc in kernel/ dir</title>
<updated>2006-06-28T00:32:39Z</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@xenotime.net</email>
</author>
<published>2006-06-27T09:54:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1dbe83c3445a1604546620a60888cf26b63f8782'/>
<id>urn:sha1:1dbe83c3445a1604546620a60888cf26b63f8782</id>
<content type='text'>
Fix kernel-doc parameters in kernel/

Warning(/var/linsrc/linux-2617-g9//kernel/auditsc.c:1376): No description found for parameter 'u_abs_timeout'
Warning(/var/linsrc/linux-2617-g9//kernel/auditsc.c:1420): No description found for parameter 'u_msg_prio'
Warning(/var/linsrc/linux-2617-g9//kernel/auditsc.c:1420): No description found for parameter 'u_abs_timeout'
Warning(/var/linsrc/linux-2617-g9//kernel/acct.c:526): No description found for parameter 'pacct'

Signed-off-by: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] kernel/acct: fix function definition</title>
<updated>2006-06-28T00:32:35Z</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@xenotime.net</email>
</author>
<published>2006-06-27T09:53:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7f32a25f63358aa993a3403c047f3ecfa6d96367'/>
<id>urn:sha1:7f32a25f63358aa993a3403c047f3ecfa6d96367</id>
<content type='text'>
kernel/acct.c:579:19: warning: non-ANSI function declaration of function 'acct_process'

Signed-off-by: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] pacct: none-delayed process accounting accumulation</title>
<updated>2006-06-25T17:01:25Z</updated>
<author>
<name>KaiGai Kohei</name>
<email>kaigai@ak.jp.nec.com</email>
</author>
<published>2006-06-25T12:49:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=77787bfb44da6e6166af088226707aeccee27968'/>
<id>urn:sha1:77787bfb44da6e6166af088226707aeccee27968</id>
<content type='text'>
In current 2.6.17 implementation, signal_struct refered from task_struct is
used for per-process data structure.  The pacct facility also uses it as a
per-process data structure to store stime, utime, minflt, majflt.  But those
members are saved in __exit_signal().  It's too late.

For example, if some threads exits at same time, pacct facility has a
possibility to drop accountings for a part of those threads.  (see, the
following 'The results of original 2.6.17 kernel') I think accounting
information should be completely collected into the per-process data structure
before writing out an accounting record.

This patch fixes this matter.  Accumulation of stime, utime, minflt and majflt
are done before generating accounting record.

[mingo@elte.hu: fix acct_collect() siglock bug found by lockdep]
Signed-off-by: KaiGai Kohei &lt;kaigai@ak.jp.nec.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] pacct: avoidance to refer the last thread as a representation of the process</title>
<updated>2006-06-25T17:01:25Z</updated>
<author>
<name>KaiGai Kohei</name>
<email>kaigai@ak.jp.nec.com</email>
</author>
<published>2006-06-25T12:49:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f6ec29a42d7ac3b309a9cef179b686d23986ab98'/>
<id>urn:sha1:f6ec29a42d7ac3b309a9cef179b686d23986ab98</id>
<content type='text'>
When pacct facility generate an 'ac_flag' field in accounting record, it
refers a task_struct of the thread which died last in the process.  But any
other task_structs are ignored.

Therefore, pacct facility drops ASU flag even if root-privilege operations are
used by any other threads except the last one.  In addition, AFORK flag is
always set when the thread of group-leader didn't die last, although this
process has called execve() after fork().

We have a same matter in ac_exitcode.  The recorded ac_exitcode is an exit
code of the last thread in the process.  There is a possibility this exitcode
is not the group leader's one.
</content>
</entry>
<entry>
<title>[PATCH] pacct: add pacct_struct to fix some pacct bugs.</title>
<updated>2006-06-25T17:01:25Z</updated>
<author>
<name>KaiGai Kohei</name>
<email>kaigai@ak.jp.nec.com</email>
</author>
<published>2006-06-25T12:49:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0e4648141af02331f21aabcd34940c70f09a2d04'/>
<id>urn:sha1:0e4648141af02331f21aabcd34940c70f09a2d04</id>
<content type='text'>
The pacct facility need an i/o operation when an accounting record is
generated.  There is a possibility to wake OOM killer up.  If OOM killer is
activated, it kills some processes to make them release process memory
regions.

But acct_process() is called in the killed processes context before calling
exit_mm(), so those processes cannot release own memory.  In the results, any
processes stop in this point and it finally cause a system stall.
</content>
</entry>
<entry>
<title>[PATCH] Remove unecessary NULL check in kernel/acct.c</title>
<updated>2006-06-25T17:01:09Z</updated>
<author>
<name>Matt Helsley</name>
<email>matthltc@us.ibm.com</email>
</author>
<published>2006-06-25T12:48:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=11e64757f9fb32f13f51596bbf01988f42fca764'/>
<id>urn:sha1:11e64757f9fb32f13f51596bbf01988f42fca764</id>
<content type='text'>
copy_process() appears to be the only caller of acct_clear_integrals() and
does not pass in NULL task pointers.  Remove the unecessary check.

Signed-off-by: Matt Helsley &lt;matthltc@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] VFS: Permit filesystem to perform statfs with a known root dentry</title>
<updated>2006-06-23T14:42:45Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2006-06-23T09:02:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=726c334223180e3c0197cc980a432681370d4baf'/>
<id>urn:sha1:726c334223180e3c0197cc980a432681370d4baf</id>
<content type='text'>
Give the statfs superblock operation a dentry pointer rather than a superblock
pointer.

This complements the get_sb() patch.  That reduced the significance of
sb-&gt;s_root, allowing NFS to place a fake root there.  However, NFS does
require a dentry to use as a target for the statfs operation.  This permits
the root in the vfsmount to be used instead.

linux/mount.h has been added where necessary to make allyesconfig build
successfully.

Interest has also been expressed for use with the FUSE and XFS filesystems.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Nathan Scott &lt;nathans@sgi.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Fix pacct bug in multithreading case.</title>
<updated>2006-03-31T20:18:54Z</updated>
<author>
<name>KaiGai Kohei</name>
<email>kaigai@ak.jp.nec.com</email>
</author>
<published>2006-03-31T10:30:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bb231fe3a53b2d34c1aef119613816fcb18864b1'/>
<id>urn:sha1:bb231fe3a53b2d34c1aef119613816fcb18864b1</id>
<content type='text'>
I noticed a bug on the process accounting facility.  In multi-threading
process, some data would be recorded incorrectly when the group_leader dies
earlier than one or more threads.  The attached patch fixes this problem.

See below.  'bugacct' is a test program that create a worker thread after 4
seconds sleeping, then the group_leader dies soon.  The worker thread
consume CPU/Memory for 6 seconds, then exit.  We can estimate 10 seconds as
etime and 6 seconds as stime + utime.  This is a sample program which the
group_leader dies earlier than other threads.

The results of same binary execution on different kernel are below.
-- accounted records --------------------
         |   btime  | utime | stime | etime | minflt | majflt |   comm  |
original | 13:16:40 |  0.00 |  0.00 |  6.10 |    171 |      0 | bugacct |
 patched | 13:20:21 |  5.83 |  0.18 | 10.03 |  32776 |      0 | bugacct |
(*) bugacct allocates 128MB memory, thus 128MB / 4KB = 32768 of minflt is
    appropriate.

-- Test results in original kernel ------
$ date; time -p ./bugacct
Tue Mar 28 13:16:36 JST 2006  &lt;- But pacct said btime is 13:16:40
real 10.11                    &lt;- But pacct said etime is 6.10
user 5.96                     &lt;- But pacct said utime is 0.00
sys 0.14                      &lt;- But pacct said stime is 0.00
$
-- Test results in patched kernel -------
$ date; time -p ./bugacct
Tue Mar 28 13:20:21 JST 2006
real 10.04
user 5.83
sys 0.19
$

In the original 2.6.16 kernel, pacct records btime, utime, stime, etime and
minflt incorrectly.  In my opinion, this problem is caused by an assumption
that group_leader dies last.

The following section calculates process running time for etime and btime.
But it means running time of the thread that dies last, not process.  The
start_time of the first thread in the process (group_leader) should be
reduced from uptime to calculate etime and btime correctly.

   ---- do_acct_process() in kernel/acct.c:
   /* calculate run_time in nsec*/
   do_posix_clock_monotonic_gettime(&amp;uptime);
   run_time = (u64)uptime.tv_sec*NSEC_PER_SEC + uptime.tv_nsec;
   run_time -= (u64)current-&gt;start_time.tv_sec*NSEC_PER_SEC
                                   + current-&gt;start_time.tv_nsec;
   ----

The following section calculates stime and utime of the process.
But it might count the utime and stime of the group_leader duplicatly
and ignore the utime and stime of the thread dies last, when one or
more threads remain after group_leader dead.
The ac_utime should be calculated as the sum of the signal-&gt;utime
and utime of the thread dies last. The ac_stime should be done also.

   ---- do_acct_process() in kernel/acct.c:
   jiffies = cputime_to_jiffies(cputime_add(current-&gt;group_leader-&gt;utime,
                                            current-&gt;signal-&gt;utime));
   ac.ac_utime = encode_comp_t(jiffies_to_AHZ(jiffies));
   jiffies = cputime_to_jiffies(cputime_add(current-&gt;group_leader-&gt;stime,
                                            current-&gt;signal-&gt;stime));
   ac.ac_stime = encode_comp_t(jiffies_to_AHZ(jiffies));
   ----

The part of the minflt/majflt calculation has same problem.
This patch solves those problems, I think.

Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
