From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Question about watchdog
Date: Mon, 2 Jul 2018 10:29:30 +0200 [thread overview]
Message-ID: <20180702082930.GA18655@kroah.com> (raw)
In-Reply-To: <221657105.45314.1530518297340@email.1and1.co.uk>
On Mon, Jul 02, 2018 at 08:58:16AM +0100, Justin Skists wrote:
>
> > On 01 July 2018 at 13:44 bing zhu <zhubohong12@gmail.com> wrote:
> >
> >
> > Dear Sir/Ma'am
> > Thank you for your time ,i'm a student new to linux kernel.at present ,i'd
> > like to create a kernel thread
> > say use kthread_create func ,my question is :how can i make this thread to
> > run on a cpu and never get switched or scheduled , there is a
> > while(1).....structure in that thread i need it to do work . at present i
> > comes with errors like "NMI watchdog: BUG: soft lockup - CPU#0 stuck for
> > 23s! [test thread :1881]",i understand there is a watchdog but is there
> > anyway i can feed the dog myself and let my thread have cpu as much as i
> > want ?
>
> Yowsers! Why would you want to do that? The whole idea of a watchdog is
> to prevent threads hogging the CPU for a long time. Linux is a multi-user,
> multi-process, pre-emptive operating system. It needs to share. :-)
Not true, Linux can take a cpu, remove itself from it, and run a single
process if needed, just fine. It's a great operating system for such a
thing.
You just have to use the apis we have for this already, it's been
possible to do this for many years now.
As for why you would want to do this within the kernel itself, well, I
can understand that need for some situations, and it is possible to do
as well, just use the correct api and all is fine (no, I can't remember
what it is at the moment, sorry...)
greg k-h
next prev parent reply other threads:[~2018-07-02 8:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-01 12:44 Question about watchdog bing zhu
2018-07-01 23:12 ` Ruben Safir
2018-07-02 7:58 ` Justin Skists
2018-07-02 8:29 ` Greg KH [this message]
2018-07-02 8:38 ` Justin Skists
2018-07-08 19:46 ` Ruben Safir
2018-07-08 20:44 ` valdis.kletnieks at vt.edu
2018-07-09 13:30 ` Ruben Safir
2018-07-09 16:17 ` valdis.kletnieks at vt.edu
2018-07-10 0:25 ` Ruben Safir
2018-07-02 15:59 ` valdis.kletnieks at vt.edu
[not found] ` <CACdNawp4Mfo9ifWu==9t1fUZJ1kqCrunU1CRwmL8zXHsa5zLWg@mail.gmail.com>
2018-07-03 16:02 ` valdis.kletnieks at vt.edu
2018-07-07 11:27 ` bing zhu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180702082930.GA18655@kroah.com \
--to=greg@kroah.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.