Re: [Vserver] "vserver enter" eating cpu and vkill problem

From: Daniel Hokka Zakrisson <daniel_at_hozac.com>
Date: Wed 07 Mar 2007 - 17:29:18 GMT
Message-ID: <51475.192.168.101.6.1173288558.squirrel@intranet>

Jarek Dylag wrote:
> Hey,
>
> [...]
>> >> Apparently it happens when the session is not ended properly
>> >> (disconnections, etc)
>> >> I could reproduce the problem as follow:
>> >> * ssh to the server as normal user
>> >> * sudo su -
>> >> * vserver XX enter
>> >> * now from another term, kill -9 on either of the two su processes
>> ("su
>> >> -"
>> >> or "-su")
>> >> At that point the session in the vserver ends but vcontext is still
>> >> hooked
>> >> to the
>> >> current terminal so cpu is fine.
>> >> * now quit the current terminal
>> >> At that point vcontext is not hooked to any terminal (vps ax => "?"
>> on
>> >> the
>> >> tty column)
>> >> and using top you see it's running 100% cpu, ~ 80% system and 20%
>> user.
>> >
>> > I'll look in to it.
>>
>> I am unable to reproduce that here. The vlogin process does stick
>> around,
>> which it probably shouldn't, but its resource usage is the same as it's
>> always been.
>
> I can reproduce it on debian sid with 2.6.20.1-vs2.3.0.11 kernel.
>
> ps auxf
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> root 2716 82.5 0.0 116 40 ? R 15:17 7:04 login
> root 2774 0.0 0.3 5072 1660 pts/6 Ss+ 15:17 0:00 \_
> /bin/bash -login
>
> I straced login process, strace shows:
>
> Process 2716 attached - interrupt to quit
> select(4, [0 3], NULL, NULL, NULL) = 1 (in [0])
> read(0, "\r", 64) = 1
> write(3, "\r", 1) = 1
> select(4, [0 3], NULL, NULL, NULL) = 1 (in [3])
> read(3, "\r\n", 64) = 2
> write(1, "\r\n", 2) = 2
> select(4, [0 3], NULL, NULL, NULL) = 1 (in [3])
> read(3, "\33[1m/ \33[37;0m(\33[32;1m1525\33[37;0m"..., 64) = 47
> write(1, "\33[1m/ \33[37;0m(\33[32;1m1525\33[37;0m"..., 47) = 47
>
> Here session ended:
>
> select(4, [0 3], NULL, NULL, NULL) = 1 (in [0])
> read(0, "", 64) = 0
> select(4, [0 3], NULL, NULL, NULL) = 1 (in [0])
> read(0, "", 64) = 0
> select(4, [0 3], NULL, NULL, NULL) = 1 (in [0])
> read(0, "", 64) = 0
> select(4, [0 3], NULL, NULL, NULL) = 1 (in [0])
> read(0, "", 64) = 0
> select(4, [0 3], NULL, NULL, NULL) = 1 (in [0])
> read(0, "", 64) = 0
> select(4, [0 3], NULL, NULL, NULL) = 1 (in [0])
> read(0, "", 64) = 0
> select(4, [0 3], NULL, NULL, NULL) = 1 (in [0])

Yeah, I know where it happens, but why it happens and how to fix it is
still a mystery. Thus far, every solution I've tried has failed.
http://people.linux-vserver.org/~dhozac/p/uv/experimental/delta-vlogin-efds.diff
has two of the things I've tried to fix it.

-- 
Daniel Hokka Zakrisson
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Wed Mar 7 17:44:09 2007
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 07 Mar 2007 - 17:44:16 GMT by hypermail 2.1.8