All of lore.kernel.org
 help / color / mirror / Atom feed
* Softlockup and Hardlockup sample test module
@ 2018-04-15  7:47 ` Ivid Suvarna
  0 siblings, 0 replies; 11+ messages in thread
From: Ivid Suvarna @ 2018-04-15  7:47 UTC (permalink / raw)
  To: Kernel development list, kernelnewbies

Hi All,

Could you please provide some sample test module for causing a
Softlockup and Hardlockup in latest kernel for SMP for testing
purposes. I assume there are some Kconfigs to be enabled as well for
this.

I had tried with the module where I put a busy loop inside spinlock
but was not able to cause any lockups. Maybe this is because of SMP
which schedule the job to other CPU. "How do I make a task to run on
single CPU only?"

I only get RCU stalls sometimes instead of softlockup when I use busy
loop inside a spinlock. Is there any explanation for difference
between these stalls and softlockup.

Thanks,
IVID

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Softlockup and Hardlockup sample test module
@ 2018-04-15  7:47 ` Ivid Suvarna
  0 siblings, 0 replies; 11+ messages in thread
From: Ivid Suvarna @ 2018-04-15  7:47 UTC (permalink / raw)
  To: kernelnewbies

Hi All,

Could you please provide some sample test module for causing a
Softlockup and Hardlockup in latest kernel for SMP for testing
purposes. I assume there are some Kconfigs to be enabled as well for
this.

I had tried with the module where I put a busy loop inside spinlock
but was not able to cause any lockups. Maybe this is because of SMP
which schedule the job to other CPU. "How do I make a task to run on
single CPU only?"

I only get RCU stalls sometimes instead of softlockup when I use busy
loop inside a spinlock. Is there any explanation for difference
between these stalls and softlockup.

Thanks,
IVID

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Softlockup and Hardlockup sample test module
  2018-04-15  7:47 ` Ivid Suvarna
@ 2018-04-15 19:12   ` valdis.kletnieks at vt.edu
  -1 siblings, 0 replies; 11+ messages in thread
From: valdis.kletnieks @ 2018-04-15 19:12 UTC (permalink / raw)
  To: Ivid Suvarna; +Cc: Kernel development list, kernelnewbies

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

On Sun, 15 Apr 2018 13:17:27 +0530, Ivid Suvarna said:

> I had tried with the module where I put a busy loop inside spinlock
> but was not able to cause any lockups. Maybe this is because of SMP
> which schedule the job to other CPU. "How do I make a task to run on
> single CPU only?"

So you get a kernel thread that's taken a lock and will busy-loop and not free
it.  What sort of lockup do you expect will be detected from this? Would the
results be any different if you didn't take a lock before busy-looping?

For bonus points - what additional things have to happen before a livelock
happens?

And before a deadlock happens?

[-- Attachment #2: Type: application/pgp-signature, Size: 486 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Softlockup and Hardlockup sample test module
@ 2018-04-15 19:12   ` valdis.kletnieks at vt.edu
  0 siblings, 0 replies; 11+ messages in thread
From: valdis.kletnieks at vt.edu @ 2018-04-15 19:12 UTC (permalink / raw)
  To: kernelnewbies

On Sun, 15 Apr 2018 13:17:27 +0530, Ivid Suvarna said:

> I had tried with the module where I put a busy loop inside spinlock
> but was not able to cause any lockups. Maybe this is because of SMP
> which schedule the job to other CPU. "How do I make a task to run on
> single CPU only?"

So you get a kernel thread that's taken a lock and will busy-loop and not free
it.  What sort of lockup do you expect will be detected from this? Would the
results be any different if you didn't take a lock before busy-looping?

For bonus points - what additional things have to happen before a livelock
happens?

And before a deadlock happens?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180415/039001d8/attachment.sig>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Softlockup and Hardlockup sample test module
  2018-04-15  7:47 ` Ivid Suvarna
@ 2018-04-15 22:19   ` Cong Wang
  -1 siblings, 0 replies; 11+ messages in thread
From: Cong Wang @ 2018-04-15 22:19 UTC (permalink / raw)
  To: Ivid Suvarna; +Cc: Kernel development list, kernelnewbies

On Sun, Apr 15, 2018 at 12:47 AM, Ivid Suvarna <ivid.suvarna@gmail.com> wrote:
> Hi All,
>
> Could you please provide some sample test module for causing a
> Softlockup and Hardlockup in latest kernel for SMP for testing
> purposes. I assume there are some Kconfigs to be enabled as well for
> this.


https://github.com/torvalds/linux/blob/master/drivers/misc/lkdtm/bugs.c#L130
Is this what you need?

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Softlockup and Hardlockup sample test module
@ 2018-04-15 22:19   ` Cong Wang
  0 siblings, 0 replies; 11+ messages in thread
From: Cong Wang @ 2018-04-15 22:19 UTC (permalink / raw)
  To: kernelnewbies

On Sun, Apr 15, 2018 at 12:47 AM, Ivid Suvarna <ivid.suvarna@gmail.com> wrote:
> Hi All,
>
> Could you please provide some sample test module for causing a
> Softlockup and Hardlockup in latest kernel for SMP for testing
> purposes. I assume there are some Kconfigs to be enabled as well for
> this.


https://github.com/torvalds/linux/blob/master/drivers/misc/lkdtm/bugs.c#L130
Is this what you need?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Softlockup and Hardlockup sample test module
  2018-04-15  7:47 ` Ivid Suvarna
                   ` (2 preceding siblings ...)
  (?)
@ 2018-05-06 18:13 ` NiftyLinKern Mitchell
  -1 siblings, 0 replies; 11+ messages in thread
From: NiftyLinKern Mitchell @ 2018-05-06 18:13 UTC (permalink / raw)
  To: kernelnewbies

On Sun, Apr 15, 2018 at 12:47 AM, Ivid Suvarna <ivid.suvarna@gmail.com>
wrote:
>
> Hi All,
>
> Could you please provide some sample test module for causing a
> Softlockup and Hardlockup in latest kernel for SMP for testing


Have you looked at this book?

Operating System Principles   by Per Brinch Hansen

It outlines some basic multi processing locking strategies and how things
might break.

These apply to multiple process user programs as well as kernel code.

Being inside a lock has impact only on that lock and the tree of locks ,
data and code that depend on it.

Locking of two types come to mind.  Locked data or a lock on a monitor
function that  manages a set of things
that depend on each other or just simply modifies data.

Interrupt and signal masks play an important part in all of this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180506/ca7a2d68/attachment.html>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Softlockup and Hardlockup sample test module
  2018-04-15  7:47 ` Ivid Suvarna
                   ` (3 preceding siblings ...)
  (?)
@ 2018-05-06 18:36 ` NiftyLinKern Mitchell
  -1 siblings, 0 replies; 11+ messages in thread
From: NiftyLinKern Mitchell @ 2018-05-06 18:36 UTC (permalink / raw)
  To: kernelnewbies

On Sun, Apr 15, 2018 at 12:47 AM, Ivid Suvarna <ivid.suvarna@gmail.com>
wrote:
>
> Hi All,
>
> Could you please provide some sample test module for causing a
> Softlockup and Hardlockup in latest kernel for SMP for testing
> purposes. I assume there are some Kconfigs to be enabled as well for


Have you looked at this book?

       Operating System Principles   by Per Brinch Hansen

It outlines some basic multi processing locking strategies and how things
might break.

These apply to SMP multiple process user programs as well as kernel code.

Being inside a lock has impact only on what that lock locks which includes
the tree of locks, data and code that depend on it.

Locking of two types come to mind.  Locked specific data or a lock on a
monitor function that  manages a set of things
that depend on each other or just simply modifies data.  A monitor might
hold multiple data locks...

Interrupt and signal masks play an important part in all of this.
Does your modified spinlock have a lock locked when your busy loop is
entered and what invokes it?
Each core needs to enter the bad code for a system to lock up.  Other
interrupts can keep the system
happy forever as long as the 'stuck' code is not critical.   Atomic
operations can be hardware specific
so knowing the hardware is part of selecting the test cases.

 --

  T o m   M i t c h e l l
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180506/ac7a8d03/attachment.html>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Softlockup and Hardlockup sample test module
@ 2018-04-15  6:31 Ivid Suvarna
  0 siblings, 0 replies; 11+ messages in thread
From: Ivid Suvarna @ 2018-04-15  6:31 UTC (permalink / raw)
  To: kernelnewbies

 Hi All,

Could you please provide some sample test module for causing a Softlockup
and Hardlockup in latest kernel for SMP for testing purposes. I assume
there are some Kconfigs to be enabled as well for this.

I had tried with the module where I put a busy loop inside spinlock but was
not able to cause any lockups. Maybe this is because of SMP which schedule
the job to other CPU. "How do I make a task to run on single CPU only?"

I only get RCU stalls sometimes instead of softlockup when I use busy loop
inside a spinlock. Is there any explanation for difference between these
stalls and softlockup.

Thanks,
IVID
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180415/a816a574/attachment.html>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Softlockup and Hardlockup sample test module
@ 2018-04-15  5:41 ` Ivid Suvarna
  0 siblings, 0 replies; 11+ messages in thread
From: Ivid Suvarna @ 2018-04-15  5:41 UTC (permalink / raw)
  To: Kernel development list, kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 625 bytes --]

Hi All,

Could you please provide some sample test module for causing a Softlockup
and Hardlockup in latest kernel for SMP for only testing purposes. I assume
there are some Kconfigs to be enabled as well for this.

I had tried with the module where I put a busy loop inside spinlock but was
not able to cause any lockups. Maybe this is because of SMP which schedule
the job to other CPU. "How do I make a task to run on single CPU only?"

I only get RCU stalls sometimes instead of softlockup when I use busy loop
inside a spinlock. Is there any explanation for difference between these
stalls and softlockup.

Thanks,
IVID

[-- Attachment #1.2: Type: text/html, Size: 863 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Softlockup and Hardlockup sample test module
@ 2018-04-15  5:41 ` Ivid Suvarna
  0 siblings, 0 replies; 11+ messages in thread
From: Ivid Suvarna @ 2018-04-15  5:41 UTC (permalink / raw)
  To: kernelnewbies

Hi All,

Could you please provide some sample test module for causing a Softlockup
and Hardlockup in latest kernel for SMP for only testing purposes. I assume
there are some Kconfigs to be enabled as well for this.

I had tried with the module where I put a busy loop inside spinlock but was
not able to cause any lockups. Maybe this is because of SMP which schedule
the job to other CPU. "How do I make a task to run on single CPU only?"

I only get RCU stalls sometimes instead of softlockup when I use busy loop
inside a spinlock. Is there any explanation for difference between these
stalls and softlockup.

Thanks,
IVID
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180415/13768eaa/attachment.html>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-05-06 18:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-15  7:47 Softlockup and Hardlockup sample test module Ivid Suvarna
2018-04-15  7:47 ` Ivid Suvarna
2018-04-15 19:12 ` valdis.kletnieks
2018-04-15 19:12   ` valdis.kletnieks at vt.edu
2018-04-15 22:19 ` Cong Wang
2018-04-15 22:19   ` Cong Wang
2018-05-06 18:13 ` NiftyLinKern Mitchell
2018-05-06 18:36 ` NiftyLinKern Mitchell
  -- strict thread matches above, loose matches on Subject: below --
2018-04-15  6:31 Ivid Suvarna
2018-04-15  5:41 Ivid Suvarna
2018-04-15  5:41 ` Ivid Suvarna

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.