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

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

 



On Sep 7, 2005, at 17:07:12, 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 ?

Umm, so then the kernel does what, exactly?  You have a process in some
indeterminate state, possibly holding semaphores, definitely pinning
memory/resources/etc, and you just stop it, turn it off, and expect
things to continue working?  This is similar in nature to that thread
a while ago about kernel error recovery and killing uninterruptible
user processes.  To extend this to kernel threads, unless the kernel
thread has been _specifically_ coded to be interruptible, it isn't, and
furthermore, *can't* be.

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.

You can't.  This is flatly impossible.  Go see the thread a while back
about a hot-patch system call for several reasons why that is a bad
idea.  In particular, look at the post that discusses phone switches,
the one with the quote "'So why don't you just reboot the affected
switches?' [...] 'That assumes the switches had ever been booted in
the first place'".

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.

Probably a while(1) loop that isn't intended to stop until the machine
physically powers off.  If you want to patch one specific kernel thread,
you might be able to do that, but you can't just expect to hot-patch
random parts of the kernel at runtime and have things work.

Cheers,
Kyle Moffett

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM/CS/IT/U d- s++: a18 C++++>$ UB/L/X/*++++(+)>$ P+++(++++)>$ L++++(+ ++) E W++(+) N+++(++) o? K? w--- O? M++ V? PS+() PE+(-) Y+ PGP+++ t+(+++) 5 X R?
tv-(--) b++++(++) DI+ D+ G e->++++$ h!*()>++$ r  !y?(-)
------END GEEK CODE BLOCK------


-
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