Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
6aacd88d
Commit
6aacd88d
authored
Jul 13, 2019
by
Paul E. McKenney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rcu/nocb: EXP Check use and usefulness of ->nocb_lock_contended
Signed-off-by:
Paul E. McKenney
<
paulmck@linux.ibm.com
>
parent
d1b222c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
kernel/rcu/tree_plugin.h
kernel/rcu/tree_plugin.h
+3
-1
No files found.
kernel/rcu/tree_plugin.h
View file @
6aacd88d
...
@@ -1515,6 +1515,7 @@ static void rcu_nocb_bypass_lock(struct rcu_data *rdp)
...
@@ -1515,6 +1515,7 @@ static void rcu_nocb_bypass_lock(struct rcu_data *rdp)
if
(
raw_spin_trylock
(
&
rdp
->
nocb_bypass_lock
))
if
(
raw_spin_trylock
(
&
rdp
->
nocb_bypass_lock
))
return
;
return
;
atomic_inc
(
&
rdp
->
nocb_lock_contended
);
atomic_inc
(
&
rdp
->
nocb_lock_contended
);
WARN_ON_ONCE
(
smp_processor_id
()
!=
rdp
->
cpu
);
smp_mb__after_atomic
();
/* atomic_inc() before lock. */
smp_mb__after_atomic
();
/* atomic_inc() before lock. */
raw_spin_lock
(
&
rdp
->
nocb_bypass_lock
);
raw_spin_lock
(
&
rdp
->
nocb_bypass_lock
);
smp_mb__before_atomic
();
/* atomic_dec() after lock. */
smp_mb__before_atomic
();
/* atomic_dec() after lock. */
...
@@ -1533,7 +1534,8 @@ static void rcu_nocb_bypass_lock(struct rcu_data *rdp)
...
@@ -1533,7 +1534,8 @@ static void rcu_nocb_bypass_lock(struct rcu_data *rdp)
*/
*/
static
void
rcu_nocb_wait_contended
(
struct
rcu_data
*
rdp
)
static
void
rcu_nocb_wait_contended
(
struct
rcu_data
*
rdp
)
{
{
while
(
atomic_read
(
&
rdp
->
nocb_lock_contended
))
WARN_ON_ONCE
(
smp_processor_id
()
!=
rdp
->
cpu
);
while
(
WARN_ON_ONCE
(
atomic_read
(
&
rdp
->
nocb_lock_contended
)))
cpu_relax
();
cpu_relax
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment