There is already a soft watchdog in the kernel almost exactly like that - the only difference from your proposal is that instead of one high-priority process it is the timer interrupt to do the check; I also think that since the time interrupt should remain a raw interrupt without a task checking for it (it's used for the scheduler) it is the same thing.
And both things aren't safe when a process disables interrupts but that's not interesting (you really need a hardware watchdog for that).
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds