Re: [ham] Re: Gracefully killing kswapd, or any kernel thread

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

 



On Wed, 7 Sep 2005, Kristis Makris wrote:

>> To kill a kernel thread, you need to make __it__ call exit(). It must be
>
> There must be another way to do it. Perhaps one could have another
> process effectively issue the contents of do_exit for the kswapd
> task_struct ?
>
>> CODED to do that! You can't do it externally although you can send
>
> I'm clearly asking for the case where the thread wasn't coded to do
> that.
>

It was not clear. You just sent it a signal and expected it to go
away. No tasks, even user-mode tasks, just go away! They need to
execute the exit code in the context of the task that will
expected to eventually disappear. It's contents of "current"
that tells the exit code what to clean up.

This means that you could probably install a driver that patches
some code that the kernel thread executes. Nothing like
modifying code at run-time....

>> it a signal, after which it will spin forever....
>
> kflushd and keventd don't seem to spin forever. I still haven't
> determined what makes kswapd spin forever after it receives the signal.
>

It depends how the signal was masked and how the thread was written.
Notice in the example posted, the code was reset to TASK_INTERRUPTIBLE
each time the loop was executed. If this is not done, the task won't
get interrupted by a signal again.

>
>

Cheers,
Dick Johnson
Penguin : Linux version 2.6.13 on an i686 machine (5589.51 BogoMips).
Warning : 98.36% of all statistics are fiction.
.
I apologize for the following. I tried to kill it with the above dot :

****************************************************************
The information transmitted in this message is confidential and may be privileged.  Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited.  If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux