From: michi1@michaelblizek.twilightparadox.com (Michael Blizek)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Linux module for causing a system hard lock-up
Date: Thu, 9 Jun 2011 06:28:49 +0200 [thread overview]
Message-ID: <20110609042849.GA2036@michaelblizek.twilightparadox.com> (raw)
In-Reply-To: <SNT111-DS11211C8DE2A9C9EDD56CB3A7620@phx.gbl>
Hi!
On 20:27 Wed 08 Jun , limp wrote:
> Hi all,
>
> I am trying to hard lockup my Linux system (Debian) for evaluating some
> crash report mechanism.
...
> int init_module(void)
> {
> unsigned long flags;
> static spinlock_t lock;
> spin_lock_init(&lock);
> spin_lock_irqsave(&lock, flags);
> printk(KERN_INFO "Hello, world\n");
> spin_lock_irqsave(&lock, flags);
> //spin_lock(&lock);
> printk(KERN_INFO "Hello, world\n");
> return 0;
> }
Do you have SMP? On non-smp spin_lock_irqsave is mapped to local_irq_save().
Maybe try this:
int init_module(void)
{
unsigned long iflags;
local_irq_save(iflags);
while (1) {
}
local_irq_restore(iflags);
return 0;
}
-Michi
--
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com
next prev parent reply other threads:[~2011-06-09 4:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-08 19:27 Linux module for causing a system hard lock-up limp
2011-06-08 20:12 ` Daniel Baluta
2011-06-08 22:24 ` limp
2011-06-08 22:53 ` Jeff Haran
2011-06-08 22:53 ` Greg KH
2011-06-09 4:28 ` Michael Blizek [this message]
2011-06-09 4:46 ` Michael Blizek
2011-06-09 7:06 ` Mulyadi Santosa
2011-06-14 20:23 ` limp
2011-06-14 21:36 ` João Eduardo Luís
2011-06-28 14:35 ` hlist_add_head luca ellero
[not found] ` <BANLkTikb1ungKEJ_WoHOpMG+=-sHcFb5ag@mail.gmail.com>
2011-06-30 9:18 ` hlist_add_head piyush moghe
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=20110609042849.GA2036@michaelblizek.twilightparadox.com \
--to=michi1@michaelblizek.twilightparadox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).