From: Rik van Riel <riel@surriel.com>
To: Rick Brown <rick.brown.3@gmail.com>
Cc: "bora.sahin@ttnet.net.tr" <bora.sahin@ttnet.net.tr>,
kernelnewbies@nl.linux.org, linux-newbie@vger.kernel.org
Subject: Re: Sleeping after preempt_disable() possible?
Date: Fri, 01 Sep 2006 19:56:37 -0400 [thread overview]
Message-ID: <44F8C8B5.2050103@surriel.com> (raw)
In-Reply-To: <7783925d0609010621j5a2cd857t67336a28782fedb3@mail.gmail.com>
Rick Brown wrote:
> I was curious that after a call to preempt_disable(), can I call a
> function that MAY sleep?
Bad idea. That can make the kernel do bad things...
Just take a look at schedule() in kernel/sched.c:
asmlinkage void __sched schedule(void)
{
...
if (unlikely(in_atomic() && !current->exit_state)) {
printk(KERN_ERR "BUG: scheduling while atomic: "
"%s/0x%08x/%d\n",
current->comm, preempt_count(), current->pid);
dump_stack();
}
Of course, in_atomic() checks whether you disabled preemption.
--
What is important? What you want to be true, or what is true?
--
VGER BF report: H 1.11022e-16
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" 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.linux-learn.org/faqs
prev parent reply other threads:[~2006-09-01 23:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-01 5:24 Sleeping after preempt_disable() possible? Rick Brown
2006-09-01 12:46 ` bora.sahin
2006-09-01 13:21 ` Rick Brown
2006-09-01 14:13 ` Octavian Purdila
2006-09-01 23:56 ` Rik van Riel [this message]
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=44F8C8B5.2050103@surriel.com \
--to=riel@surriel.com \
--cc=bora.sahin@ttnet.net.tr \
--cc=kernelnewbies@nl.linux.org \
--cc=linux-newbie@vger.kernel.org \
--cc=rick.brown.3@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 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.