Re: Re: Gracefully killing kswapd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Fawaad, Kristis...

> I don't think that kswapd can be killed by loading modules or after
> when it started during boot time ..... As I havn't saw any break or
> getting kill or other signals in the code of kswapd, this means that
> when it goes into for(;;) loop it won't break out of it through any
> killing signal send from outside. I may be wrong b/c I havn't worked
> on it but telling what I can get by just seeing on the code of kswapd
> fucntion.

I think I know why kswapd doesn't get killed. recall the fact that 
kswapd is kernel thread (therefore running in kernel mode) and signal 
handler (i mean the one which does the usual process termination) is 
only executed when a process wants to return from kernel space to user 
mode. read arch/i386/entry.S and search for "ENTRY(ret_from_sys_call)"  
and "signal_return:".

So, that's why kswapd just return back to TASK_RUNNING (previously 
TASK_(UN)INTERRUPTIBLE) and doing loop again and again.

I don't know clever way to stop kswapd, so I'll let other to give 
commentaries. Personally I think it is better to directly patch 
mm/vmscan.c rather than creating kswapd-alike kernel thread from kernel 
module.

regards

Mulyadi


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux