Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd5b318d authored by Phil Sutter's avatar Phil Sutter Committed by David S. Miller
Browse files

rhashtable-test: add cond_resched() to thread test



This should fix for soft lockup bugs triggered on slow systems.

Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3d40e443
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -236,6 +236,8 @@ static int thread_lookup_test(struct thread_data *tdata)
			       obj->value, key);
			err++;
		}

		cond_resched();
	}
	return err;
}
@@ -251,6 +253,7 @@ static int threadfunc(void *data)

	for (i = 0; i < entries; i++) {
		tdata->objs[i].value = (tdata->id << 16) | i;
		cond_resched();
		err = rhashtable_insert_fast(&ht, &tdata->objs[i].node,
		                             test_rht_params);
		if (err == -ENOMEM || err == -EBUSY) {
@@ -285,6 +288,8 @@ static int threadfunc(void *data)
				goto out;
			}
			tdata->objs[i].value = TEST_INSERT_FAIL;

			cond_resched();
		}
		err = thread_lookup_test(tdata);
		if (err) {