From: Bryan O'Donoghue Date: Wed, 23 Sep 2015 16:31:32 +0000 (-0700) Subject: greybus: loopback: masked out threads should sleep X-Git-Tag: v4.14-rc1~2366^2~378^2~21^2~1166 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42d7f7e884fcce78301ca88da3434f0fcbf3fee5;p=platform%2Fkernel%2Flinux-rpi.git greybus: loopback: masked out threads should sleep If a thread is masked out it should not consume CPU cycles during a test. We set an arbitrary 100 millisecond sleep time for each masked out thread. Reasonably blunt instrument to ensure threads with nothing to do don't end up thrashing the acquisition/release of mutexes. Signed-off-by: Bryan O'Donoghue Reviewed-by: Patrick Titiano Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 3151876..764ee83 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -693,8 +693,10 @@ static int gb_loopback_fn(void *data) break; mutex_lock(&gb_dev.mutex); - if (!gb_loopback_active(gb)) + if (!gb_loopback_active(gb)) { + ms_wait = 100; goto unlock_continue; + } if (gb_dev.iteration_max) { /* Determine overall lowest count */ low_count = gb->iteration_count;