)]}'
{"id":"userspace-rcu~8442","triplet_id":"userspace-rcu~master~I83942e24c32e77395ff25b466f1b1640422b9eb5","project":"userspace-rcu","branch":"master","topic":"fix-futex-race","hashtags":[],"change_id":"I83942e24c32e77395ff25b466f1b1640422b9eb5","subject":"Fix: urcu: futex wait: handle spurious futex wakeups","status":"MERGED","created":"2022-06-22 20:50:52.000000000","updated":"2022-06-27 14:30:14.000000000","submitted":"2022-06-27 14:30:14.000000000","submitter":{"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]},"total_comment_count":0,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"8441-fix-futex-race","meta_rev_id":"5f1e7672c7ffed0593ed81e5f0d8adc5248aa232","_number":8442,"virtual_id_number":8442,"owner":{"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]},"actions":{},"labels":{"Code-Review":{"all":[{"value":0,"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]}],"values":{"-2":"This shall not be merged","-1":"I would prefer this is not merged as is"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me, approved"},"description":"","default_value":0,"optional":true},"Verified":{"all":[{"value":0,"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]}],"values":{"-2":"Failure","-1":"Not built"," 0":"No score","+1":"Unstable","+2":"Success"},"description":"CI Build results","default_value":0,"optional":true},"CI-Build":{"all":[{"value":0,"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]}],"values":{" 0":"No score","+1":"Trigger a CI build"},"description":"Trigger CI builds","default_value":0,"optional":true},"Smoke-Build-Lvl1":{"all":[{"value":0,"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]}],"values":{" 0":"No score","+1":"Trigger a level 1 smoke build"},"description":"Trigger Level 1 Smoke builds","default_value":0,"optional":true},"Smoke-Build-Lvl2":{"all":[{"value":0,"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]}],"values":{" 0":"No score","+1":"Trigger a level 2 smoke build"},"description":"Trigger Level 2 Smoke builds","default_value":0,"optional":true}},"removable_reviewers":[],"reviewers":{},"pending_reviewers":{},"reviewer_updates":[],"messages":[{"id":"821bd3f965e4307d403711f9ce9b222c2aa78745","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]},"date":"2022-06-22 20:50:52.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"bb2549942879676ad52f7b8e79dcc20863ca590c","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]},"date":"2022-06-23 19:09:31.000000000","message":"Uploaded patch set 2.","accounts_in_message":[],"_revision_number":2},{"id":"f647d81f7c07b22eb565f13896803c7491214bfb","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]},"date":"2022-06-23 19:56:57.000000000","message":"Uploaded patch set 3: Patch Set 2 was rebased.","accounts_in_message":[],"_revision_number":3},{"id":"5f1e7672c7ffed0593ed81e5f0d8adc5248aa232","tag":"autogenerated:gerrit:merged","author":{"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]},"date":"2022-06-27 14:30:14.000000000","message":"Change has been successfully pushed.","accounts_in_message":[],"_revision_number":4}],"current_revision_number":4,"current_revision":"a18d0428065b301086d4e8a85bc057dc39946891","revisions":{"36196841c226f812e292d804dff795a79afe9705":{"kind":"REWORK","_number":1,"created":"2022-06-22 20:50:52.000000000","uploader":{"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]},"ref":"refs/changes/42/8442/1","fetch":{"anonymous http":{"url":"https://review.lttng.org/userspace-rcu","ref":"refs/changes/42/8442/1","commands":{"Branch":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/1 \u0026\u0026 git checkout -b change-8442 FETCH_HEAD","Checkout":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.lttng.org/userspace-rcu refs/changes/42/8442/1","Reset To":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/1 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"08bb27c338b24b19d850c6ec4841258a32601d05","subject":"Fix: workqueue: futex wait: handle spurious futex wakeups","web_links":[{"name":"gitweb","tooltip":"Open in GitWeb","url":"/gitweb?p\u003duserspace-rcu.git;a\u003dcommit;h\u003d08bb27c338b24b19d850c6ec4841258a32601d05"}]}],"author":{"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","date":"2022-06-22 20:34:02.000000000","tz":-240},"committer":{"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","date":"2022-06-22 20:34:02.000000000","tz":-240},"subject":"Fix: urcu: futex wait: handle spurious futex wakeups","message":"Fix: urcu: futex wait: handle spurious futex wakeups\n\nFrom futex(5):\n\n       FUTEX_WAIT\n              Returns 0 if the caller was woken up.  Note that a  wake-up  can\n              also  be caused by common futex usage patterns in unrelated code\n              that happened to have previously used the  futex  word\u0027s  memory\n              location  (e.g., typical futex-based implementations of Pthreads\n              mutexes can cause this under some conditions).  Therefore, call‐\n              ers should always conservatively assume that a return value of 0\n              can mean a spurious wake-up, and  use  the  futex  word\u0027s  value\n              (i.e.,  the user-space synchronization scheme) to decide whether\n              to continue to block or not.\n\nWe therefore need to validate whether the value differs from -1 in\nuser-space after the call to FUTEX_WAIT returns 0.\n\nSigned-off-by: Mathieu Desnoyers \u003cmathieu.desnoyers@efficios.com\u003e\nChange-Id: I83942e24c32e77395ff25b466f1b1640422b9eb5\n","web_links":[{"name":"gitweb","tooltip":"Open in GitWeb","url":"/gitweb?p\u003duserspace-rcu.git;a\u003dcommit;h\u003d36196841c226f812e292d804dff795a79afe9705"}],"resolve_conflicts_web_links":[{"name":"gitweb","tooltip":"Open in GitWeb","url":"/gitweb?p\u003duserspace-rcu.git;a\u003dcommit;h\u003d36196841c226f812e292d804dff795a79afe9705"}]},"branch":"refs/heads/master"},"d7568d3b513f442b24e5152713ecfa8393daf686":{"kind":"TRIVIAL_REBASE_WITH_MESSAGE_UPDATE","_number":2,"created":"2022-06-23 19:09:31.000000000","uploader":{"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]},"ref":"refs/changes/42/8442/2","fetch":{"anonymous http":{"url":"https://review.lttng.org/userspace-rcu","ref":"refs/changes/42/8442/2","commands":{"Branch":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/2 \u0026\u0026 git checkout -b change-8442 FETCH_HEAD","Checkout":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.lttng.org/userspace-rcu refs/changes/42/8442/2","Reset To":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/2 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"e31d4550e30aff04e9a335f55f4c157bd19f8ac4","subject":"Fix: urcu-wait: futex wait: handle spurious futex wakeups","web_links":[{"name":"gitweb","tooltip":"Open in GitWeb","url":"/gitweb?p\u003duserspace-rcu.git;a\u003dcommit;h\u003de31d4550e30aff04e9a335f55f4c157bd19f8ac4"}]}],"author":{"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","date":"2022-06-22 20:34:02.000000000","tz":-240},"committer":{"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","date":"2022-06-23 19:09:31.000000000","tz":-240},"subject":"Fix: urcu: futex wait: handle spurious futex wakeups","message":"Fix: urcu: futex wait: handle spurious futex wakeups\n\nObserved issue\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nThe urcu wait_gp() implements a futex wait/wakeup scheme identical to\nthe workqueue code, which has an issue with spurious wakeups.\n\nA spurious wakeup on wait_gp can cause wait_gp to return with a\nrcu_gp.futex state of -1, which is unexpected. It would cause the\nfollowing loops in wait_for_readers() to decrement the\nrcu_gp.futex to values below -1, thus actively using CPU as values\nwill be decremented to very low negative values until it reaches 0\nthrough underflow, or until the input_readers list is found to be empty.\nThe state is restored to 0 when the input_readers list is found to be\nempty, which restores the futex state to a correct state for the\nfollowing calls to wait_for_readers().\n\nThis issue will cause spurious unexpected high CPU use, but will not\nlead to data corruption.\n\nCause\n\u003d\u003d\u003d\u003d\u003d\n\nFrom futex(5):\n\n       FUTEX_WAIT\n              Returns 0 if the caller was woken up.  Note that a  wake-up  can\n              also  be caused by common futex usage patterns in unrelated code\n              that happened to have previously used the  futex  word\u0027s  memory\n              location  (e.g., typical futex-based implementations of Pthreads\n              mutexes can cause this under some conditions).  Therefore, call‐\n              ers should always conservatively assume that a return value of 0\n              can mean a spurious wake-up, and  use  the  futex  word\u0027s  value\n              (i.e.,  the user-space synchronization scheme) to decide whether\n              to continue to block or not.\n\nSolution\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nWe therefore need to validate whether the value differs from -1 in\nuser-space after the call to FUTEX_WAIT returns 0.\n\nKnown drawbacks\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nNone.\n\nSigned-off-by: Mathieu Desnoyers \u003cmathieu.desnoyers@efficios.com\u003e\nChange-Id: I83942e24c32e77395ff25b466f1b1640422b9eb5\n","web_links":[{"name":"gitweb","tooltip":"Open in GitWeb","url":"/gitweb?p\u003duserspace-rcu.git;a\u003dcommit;h\u003dd7568d3b513f442b24e5152713ecfa8393daf686"}],"resolve_conflicts_web_links":[{"name":"gitweb","tooltip":"Open in GitWeb","url":"/gitweb?p\u003duserspace-rcu.git;a\u003dcommit;h\u003dd7568d3b513f442b24e5152713ecfa8393daf686"}]},"branch":"refs/heads/master"},"4be1856d8fe7f37c8515302848cc944ed7a53e49":{"kind":"TRIVIAL_REBASE","_number":3,"created":"2022-06-23 19:56:57.000000000","uploader":{"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]},"ref":"refs/changes/42/8442/3","fetch":{"anonymous http":{"url":"https://review.lttng.org/userspace-rcu","ref":"refs/changes/42/8442/3","commands":{"Branch":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/3 \u0026\u0026 git checkout -b change-8442 FETCH_HEAD","Checkout":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/3 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/3 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/3 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.lttng.org/userspace-rcu refs/changes/42/8442/3","Reset To":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/3 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"9caa269068a0ebd49632519824d240046cd13c12","subject":"Fix: urcu-wait: futex wait: handle spurious futex wakeups","web_links":[{"name":"gitweb","tooltip":"Open in GitWeb","url":"/gitweb?p\u003duserspace-rcu.git;a\u003dcommit;h\u003d9caa269068a0ebd49632519824d240046cd13c12"}]}],"author":{"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","date":"2022-06-22 20:34:02.000000000","tz":-240},"committer":{"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","date":"2022-06-23 19:56:50.000000000","tz":-240},"subject":"Fix: urcu: futex wait: handle spurious futex wakeups","message":"Fix: urcu: futex wait: handle spurious futex wakeups\n\nObserved issue\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nThe urcu wait_gp() implements a futex wait/wakeup scheme identical to\nthe workqueue code, which has an issue with spurious wakeups.\n\nA spurious wakeup on wait_gp can cause wait_gp to return with a\nrcu_gp.futex state of -1, which is unexpected. It would cause the\nfollowing loops in wait_for_readers() to decrement the\nrcu_gp.futex to values below -1, thus actively using CPU as values\nwill be decremented to very low negative values until it reaches 0\nthrough underflow, or until the input_readers list is found to be empty.\nThe state is restored to 0 when the input_readers list is found to be\nempty, which restores the futex state to a correct state for the\nfollowing calls to wait_for_readers().\n\nThis issue will cause spurious unexpected high CPU use, but will not\nlead to data corruption.\n\nCause\n\u003d\u003d\u003d\u003d\u003d\n\nFrom futex(5):\n\n       FUTEX_WAIT\n              Returns 0 if the caller was woken up.  Note that a  wake-up  can\n              also  be caused by common futex usage patterns in unrelated code\n              that happened to have previously used the  futex  word\u0027s  memory\n              location  (e.g., typical futex-based implementations of Pthreads\n              mutexes can cause this under some conditions).  Therefore, call‐\n              ers should always conservatively assume that a return value of 0\n              can mean a spurious wake-up, and  use  the  futex  word\u0027s  value\n              (i.e.,  the user-space synchronization scheme) to decide whether\n              to continue to block or not.\n\nSolution\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nWe therefore need to validate whether the value differs from -1 in\nuser-space after the call to FUTEX_WAIT returns 0.\n\nKnown drawbacks\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nNone.\n\nSigned-off-by: Mathieu Desnoyers \u003cmathieu.desnoyers@efficios.com\u003e\nChange-Id: I83942e24c32e77395ff25b466f1b1640422b9eb5\n","web_links":[{"name":"gitweb","tooltip":"Open in GitWeb","url":"/gitweb?p\u003duserspace-rcu.git;a\u003dcommit;h\u003d4be1856d8fe7f37c8515302848cc944ed7a53e49"}],"resolve_conflicts_web_links":[{"name":"gitweb","tooltip":"Open in GitWeb","url":"/gitweb?p\u003duserspace-rcu.git;a\u003dcommit;h\u003d4be1856d8fe7f37c8515302848cc944ed7a53e49"}]},"branch":"refs/heads/master"},"a18d0428065b301086d4e8a85bc057dc39946891":{"kind":"NO_CHANGE","_number":4,"created":"2022-06-27 14:30:14.000000000","uploader":{"_account_id":1000009,"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","username":"compudj","avatars":[{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/7326b3e1d32b971a5e69d9730228c428.jpg?d\u003dretro\u0026r\u003dr\u0026s\u003d120","height":120}]},"ref":"refs/changes/42/8442/4","fetch":{"anonymous http":{"url":"https://review.lttng.org/userspace-rcu","ref":"refs/changes/42/8442/4","commands":{"Branch":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/4 \u0026\u0026 git checkout -b change-8442 FETCH_HEAD","Checkout":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/4 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/4 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/4 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.lttng.org/userspace-rcu refs/changes/42/8442/4","Reset To":"git fetch https://review.lttng.org/userspace-rcu refs/changes/42/8442/4 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"71693131550753be0fcd2b2d4175b53c697be5a3","subject":"Fix: urcu-wait: futex wait: handle spurious futex wakeups","web_links":[{"name":"gitweb","tooltip":"Open in GitWeb","url":"/gitweb?p\u003duserspace-rcu.git;a\u003dcommit;h\u003d71693131550753be0fcd2b2d4175b53c697be5a3"}]}],"author":{"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","date":"2022-06-22 20:34:02.000000000","tz":-240},"committer":{"name":"Mathieu Desnoyers","email":"mathieu.desnoyers@efficios.com","date":"2022-06-27 14:30:13.000000000","tz":-240},"subject":"Fix: urcu: futex wait: handle spurious futex wakeups","message":"Fix: urcu: futex wait: handle spurious futex wakeups\n\nObserved issue\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nThe urcu wait_gp() implements a futex wait/wakeup scheme identical to\nthe workqueue code, which has an issue with spurious wakeups.\n\nA spurious wakeup on wait_gp can cause wait_gp to return with a\nrcu_gp.futex state of -1, which is unexpected. It would cause the\nfollowing loops in wait_for_readers() to decrement the\nrcu_gp.futex to values below -1, thus actively using CPU as values\nwill be decremented to very low negative values until it reaches 0\nthrough underflow, or until the input_readers list is found to be empty.\nThe state is restored to 0 when the input_readers list is found to be\nempty, which restores the futex state to a correct state for the\nfollowing calls to wait_for_readers().\n\nThis issue will cause spurious unexpected high CPU use, but will not\nlead to data corruption.\n\nCause\n\u003d\u003d\u003d\u003d\u003d\n\nFrom futex(5):\n\n       FUTEX_WAIT\n              Returns 0 if the caller was woken up.  Note that a  wake-up  can\n              also  be caused by common futex usage patterns in unrelated code\n              that happened to have previously used the  futex  word\u0027s  memory\n              location  (e.g., typical futex-based implementations of Pthreads\n              mutexes can cause this under some conditions).  Therefore, call‐\n              ers should always conservatively assume that a return value of 0\n              can mean a spurious wake-up, and  use  the  futex  word\u0027s  value\n              (i.e.,  the user-space synchronization scheme) to decide whether\n              to continue to block or not.\n\nSolution\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nWe therefore need to validate whether the value differs from -1 in\nuser-space after the call to FUTEX_WAIT returns 0.\n\nKnown drawbacks\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nNone.\n\nSigned-off-by: Mathieu Desnoyers \u003cmathieu.desnoyers@efficios.com\u003e\nChange-Id: I83942e24c32e77395ff25b466f1b1640422b9eb5\n","web_links":[{"name":"gitweb","tooltip":"Open in GitWeb","url":"/gitweb?p\u003duserspace-rcu.git;a\u003dcommit;h\u003da18d0428065b301086d4e8a85bc057dc39946891"}],"resolve_conflicts_web_links":[{"name":"gitweb","tooltip":"Open in GitWeb","url":"/gitweb?p\u003duserspace-rcu.git;a\u003dcommit;h\u003da18d0428065b301086d4e8a85bc057dc39946891"}]},"branch":"refs/heads/master"}},"requirements":[],"submit_records":[],"submit_requirements":[]}
