Skip to contentSkip to conversation

Cpuset: rcu slab cache optimization rcu_dereference comment

PATCH New Paul Jackson 1 participant 1 message Dec 12, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Cpuset: rcu slab cache optimization rcu_dereference comment

Add a comment noting that unlike usual, we do not need to guard a dereference of an rcu guarded pointer with a call to rcu_dereference(), because we don't care if we see out of order results.

---

 kernel/cpuset.c |    6 ++++++
 1 files changed, 6 insertions(+)
kernel/cpuset.c +6 -0
@@ -632,6 +632,12 @@ static void guarantee_online_mems(const 
  * unmapped.  It's ok if attach_task() replaces our cpuset with
  * another while we are reading mems_generation, and even frees it.
  *
+ * We do -not- need to guard the 'cs' pointer dereference within the
+ * rcu_read_lock section with rcu_dereference(), because we don't
+ * mind getting bogus out-of-order results.  New cpuset pointer and
+ * old mems_generation is ok - we'll realize that our cpuset memory
+ * placement changed the next time through here.
+ *
  * This routine is needed to update the per-task mems_allowed data,
  * within the tasks context, when it is trying to allocate memory
  * (in various mm/mempolicy.c routines) and notices that some other
Signature · 3 lines
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <[email protected]> 1.650.933.1373