summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e6c7fcd)
there is no guarantee for the branches in cfs_race() to be executed
in strict order, thus it's possible that the second branch (with
cfs_race_state=1) is executed before the first branch and then another
thread executing the first branch gets stuck.
this construction is used for testing only and as a
workaround it's enough to timeout.
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ie1cc0accedb3e1a198d4b17d1ab00ce298c560f2
Reviewed-on: https://review.whamcloud.com/43161
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
int rc;
cfs_race_state = 0;
CERROR("cfs_race id %x sleeping\n", id);
int rc;
cfs_race_state = 0;
CERROR("cfs_race id %x sleeping\n", id);
- rc = wait_event_interruptible(cfs_race_waitq,
- cfs_race_state != 0);
+ /*
+ * XXX: don't wait forever as there is no guarantee
+ * that this branch is executed first. for testing
+ * purposes this construction works good enough
+ */
+ rc = wait_event_interruptible_timeout(cfs_race_waitq,
+ cfs_race_state != 0,
+ cfs_time_seconds(5));
CERROR("cfs_fail_race id %x awake: rc=%d\n", id, rc);
} else {
CERROR("cfs_fail_race id %x waking\n", id);
CERROR("cfs_fail_race id %x awake: rc=%d\n", id, rc);
} else {
CERROR("cfs_fail_race id %x waking\n", id);