[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGZFCEFQju581PDF3QpyX-s8vvdxPrZTwS85CP3rTu4wUfEHBg@mail.gmail.com>
Date: Wed, 24 Jun 2015 19:44:49 +0530
From: ratheesh kannoth <ratheesh.ksz@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: netdev <netdev@...r.kernel.org>,
linux-newbie <linux-newbie@...r.kernel.org>
Subject: Re: sock_hold and sock_put
On Wed, Jun 24, 2015 at 6:16 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> You misunderstood the comment.
>
> Comment only stated that sock_hold() must be used in contexts where
> caller owns a reference (and will eventually release it later with
> sock_put().
>
> There is nothing about having a lock here.
Thanks. I think, i did not put the question right.
I understood the comment perfectly. Suppose i need to use the
sock_hold in some callbacks ( say netdev_notifier chain callback)
function. How can i gurantee race won't happen at the point where i
call sock_hold().
If i put the question in another way - say kernel is doing a
sock_put() on a socket, and at the same time the netdev_callback
function( that i implemented ) is called on another core ( in smp
machine ). and the callback is holding (sock_hold()) on the same
sock.
Thanks,
Ratheesh
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists