Skip to contentSkip to conversation

remove redundant rcu_read_unlock

PATCH In review Mike D. Day 2 participants 2 messages Mar 28, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove redundant rcu_read_unlock

In the function rcu_lock_domain_by_id there is a call to rcu_read_unlock just prior to returning. However, the intent is that the rcu reader retain the read lock after the call has returned. This can be verified by auditing the callers of this routine, which each explicitly call rcu_unlock_domain, which in turn calls rcu_read_unlock.

--
Remove redundant call to rcu_read_unlock.

xen/common/domain.c +0 -2
diff -r 6ee683d1b61f xen/common/domain.c
@@ -252,8 +252,6 @@ struct domain *rcu_lock_domain_by_id(dom
            return d;
    }
 
-    rcu_read_unlock(&domlist_read_lock);
-
    return NULL;

}

Signature · 5 lines
Mike D. Day
IBM LTC
Cell: 919 412-3900
Sametime: [email protected] AIM: ncmikeday  Yahoo: ultra.runner
PGP key: http://www.ncultra.org/ncmike/pubkey.asc
#1 lore raw
Quoted 9 lines · Mike D. Day

In the function rcu_lock_domain_by_id there is a call to rcu_read_unlock just prior to returning. However, the intent is that the rcu reader retain the read lock after the call has returned. This can be verified by auditing the callers of this routine, which each explicitly call rcu_unlock_domain, which in turn calls rcu_read_unlock.

--
Remove redundant call to rcu_read_unlock.

It's not redundant -- that's the error path (returning NULL). Callers do not call the unlock function in this case.

-- Keir