Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164335
b: refs/heads/master
c: b8d57a7
h: refs/heads/master
i:
  164333: 12d6984
  164331: 05bb98d
  164327: 0cf2368
  164319: ac2d503
v: v3
  • Loading branch information
Josh Triplett authored and Ingo Molnar committed Sep 17, 2009
1 parent 8ac21bc commit fc4e6c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b835db1f9cadaf008750a32664e35a207782c95e
refs/heads/master: b8d57a76d9f92aa63b4f12990da5697b17000b0c
15 changes: 9 additions & 6 deletions trunk/kernel/rcutorture.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,17 @@ static int rcu_torture_read_lock(void) __acquires(RCU)

static void rcu_read_delay(struct rcu_random_state *rrsp)
{
long delay;
const long longdelay = 200;
const unsigned long shortdelay_us = 200;
const unsigned long longdelay_ms = 50;

/* We want there to be long-running readers, but not all the time. */
/* We want a short delay sometimes to make a reader delay the grace
* period, and we want a long delay occasionally to trigger
* force_quiescent_state. */

delay = rcu_random(rrsp) % (nrealreaders * 2 * longdelay);
if (!delay)
udelay(longdelay);
if (!(rcu_random(rrsp) % (nrealreaders * 2000 * longdelay_ms)))
mdelay(longdelay_ms);
if (!(rcu_random(rrsp) % (nrealreaders * 2 * shortdelay_us)))
udelay(shortdelay_us);
}

static void rcu_torture_read_unlock(int idx) __releases(RCU)
Expand Down

0 comments on commit fc4e6c9

Please sign in to comment.