mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michael Guo" <Michael.Guo@advantechAMT.com>
To: "Liu haixiang" <liu.haixiang@gmail.com>, <linux-kernel@vger.kernel.org>
Subject: RE: Question on Schedule and Preemption
Date: Tue, 18 Apr 2006 09:31:04 -0400	[thread overview]
Message-ID: <1A60C93388AFD3419AEE0E20A116D3201CFDA7@exch2k> (raw)

Hi,
 The comments above the piece of code give some hints about the sane checking. When call "schedule" for process scheduling, make sure that context isn't atomic. That is, schedule should be called in a safe place such as spinlock free etc. And you can also read do_exit() code to get more detailed information.


   

-----Original Message-----
From: linux-kernel-owner@vger.kernel.org
[mailto:linux-kernel-owner@vger.kernel.org]On Behalf Of Liu haixiang
Sent: Tuesday, April 18, 2006 3:23 AM
To: linux-kernel@vger.kernel.org
Subject: Question on Schedule and Preemption


Hi All,

Now I am developing the driver on Linux kernel 2.6.11. And I met the
problem that kernel will dump my stack from time to time. And the
kernel log will give me messages like "scheduling while atomic: ...".

Then I found the code in sched.c:

if (likely(!current->exit_state)) {
	if (unlikely(in_atomic())) {
		printk(KERN_ERR "scheduling while atomic: "
			"%s/0x%08x/%d\n",
			current->comm, preempt_count(), current->pid);
		dump_stack();
	}
}

Anybody can explain above code for me?

Thanks

best regards

Haixiang Liu
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

             reply	other threads:[~2006-04-18 13:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-18 13:31 Michael Guo [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-04-18  7:23 Liu haixiang
2006-04-18  9:17 ` Andreas Mohr
2006-04-18  9:23   ` Arjan van de Ven
2006-04-18  9:28     ` Andreas Mohr
2006-04-18 12:55   ` Liu haixiang
2006-04-18 14:56     ` Steven Rostedt
2006-04-18 17:21       ` Liu haixiang
2006-04-18 17:32         ` Steven Rostedt
2006-04-18  7:12 Liu haixiang

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=1A60C93388AFD3419AEE0E20A116D3201CFDA7@exch2k \
    --to=michael.guo@advantechamt.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liu.haixiang@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®