cgroups: add cpu_relax() calls in css_tryget() and cgroup_clear_css_refs()
css_tryget() and cgroup_clear_css_refs() contain polling loops; these loops should have cpu_relax calls in them to reduce cross-cache traffic. Signed-off-by: Paul Menage <menage@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
1404f06565
commit
804b3c28a4
@@ -99,6 +99,7 @@ static inline bool css_tryget(struct cgroup_subsys_state *css)
|
||||
while (!atomic_inc_not_zero(&css->refcnt)) {
|
||||
if (test_bit(CSS_REMOVED, &css->flags))
|
||||
return false;
|
||||
cpu_relax();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user