lkml.org 
[lkml]   [2008]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/1] Use RCU for the UDP hash lock
    Stephen Hemminger wrote:
    >
    >>
    >> static inline void udp_lib_unhash(struct sock *sk)
    >> {
    >> - write_lock_bh(&udp_hash_lock);
    >> - if (sk_del_node_init(sk)) {
    >> + spin_lock_bh(&udp_hash_wlock);
    >> + if (sk_del_node_rcu(sk)) {
    >> inet_sk(sk)->num = 0;
    >> sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
    >> }
    >> - write_unlock_bh(&udp_hash_lock);
    >> + spin_unlock_bh(&udp_hash_wlock);
    >> + synchronize_sched();
    >>
    >
    > Could this be synchronize_rcu? You are using rcu_read_lock() protected sections.
    >
    I meant to comment on that. I wasn't sure which to use, so I chose the
    more conservative approach. synchronize_rcu() might be appropriate.

    -corey



    \
     
     \ /
      Last update: 2008-09-24 22:49    [W:0.030 / U:1.684 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site