public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/10] Make bsd process accounting work in pid namespaces
@ 2008-05-15 10:52 Pavel Emelyanov
  2008-05-15 10:54 ` [PATCH 1/10] Bsdacct: rename acct_blbls to bsd_acct_struct Pavel Emelyanov
                   ` (10 more replies)
  0 siblings, 11 replies; 16+ messages in thread
From: Pavel Emelyanov @ 2008-05-15 10:52 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Oleg Nesterov, Linux Kernel Mailing List

After I fixed access to task->tgid in kernel/acct.c, Oleg 
pointed out some bad side effects with this accounting vs pid 
namespaces interaction. I.e. when some task in pid namespace 
sets this accounting up, this blocks all the others from doing 
the same. Restricting this to init namespace only could help, 
but didn't look as a grace solution.

So here is the approach to make this accounting work with pid
namespaces properly.

The idea is simple - when a task dies it accounts itself in 
each namespace it is visible from and which set the accounting 
up. 

For example here are the commands run and the output of lastcomm 
from init and sub namespaces:

init_ns# accton pacct
 sub_ns# accton pacct (this is a different file - sub ns is run in
                       a chroot-ed environment)
init_ns# cat /dev/null
 sub_ns# ls /dev/null
init_ns# accton
 sub_ns# accton

 sub_ns#  lastcomm -f pacct
ls                      0        [136,0]    0.00 secs Thu May 15 10:30
accton                  0        [136,0]    0.00 secs Thu May 15 10:30

init_ns# lastcomm -f pacct
accton                  root     pts/0      0.00 secs Thu May 15 14:30 << got from sub
cat                     root     pts/1      0.00 secs Thu May 15 14:30
ls                      root     pts/0      0.00 secs Thu May 15 14:30 << got from sub
accton                  root     pts/1      0.00 secs Thu May 15 14:30

That was the summary, the details are in patches.

The set was sent for RFC a month ago, but I got only one, but
positive response from Oleg. Hopefully, he can confirm one now.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

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

end of thread, other threads:[~2008-05-16 10:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-15 10:52 [PATCH 0/10] Make bsd process accounting work in pid namespaces Pavel Emelyanov
2008-05-15 10:54 ` [PATCH 1/10] Bsdacct: rename acct_blbls to bsd_acct_struct Pavel Emelyanov
2008-05-15 10:56 ` [PATCH 2/10] Pidns: use kzalloc when allocating new pid_namespace struct Pavel Emelyanov
2008-05-15 10:58 ` [PATCH 3/10] Pidns: add the struct bsd_acct_struct pointer on " Pavel Emelyanov
2008-05-15 11:00 ` [PATCH 4/10] Bsdacct: "truthify" a comment near acct_process Pavel Emelyanov
2008-05-15 11:02 ` [PATCH 5/10] Bsdacct: make check timer accept a bsd_acct_struct argument Pavel Emelyanov
2008-05-15 11:04 ` [PATCH 6/10] Bsdacct: turn the acct_lock from on-the-struct to global Pavel Emelyanov
2008-05-15 11:07 ` [PATCH 7/10] Bsdacct: make internal code work with passed bsd_acct_struct, not global Pavel Emelyanov
2008-05-15 11:08 ` [PATCH 8/10] Bsdacct: switch from global bsd_acct_struct instance to per-pidns one Pavel Emelyanov
2008-05-15 11:10 ` [PATCH 9/10] Bsdacct: turn acct off for all pidns-s on umount time Pavel Emelyanov
2008-05-15 11:11 ` [PATCH 10/10] Bsdacct: account dying tasks in all relevant namespaces Pavel Emelyanov
2008-05-16  2:44   ` Andrew Morton
2008-05-16 10:11     ` Pavel Emelyanov
2008-05-16 10:33       ` Andrew Morton
2008-05-16  2:43 ` [PATCH 0/10] Make bsd process accounting work in pid namespaces Andrew Morton
2008-05-16 10:16   ` Pavel Emelyanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox