lkml.org 
[lkml]   [2009]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] net: fix race in the receive/select
    On Sun, Jun 28, 2009 at 08:04:12PM +0200, Oleg Nesterov wrote:
    > On 06/28, Jarek Poplawski wrote:
    ...
    > > Hmm... of course:
    > >
    > > static inline void sock_poll_wait(struct file * filp, struct sock *sk, poll_table *p)
    > > {
    > > if (p && sk->sk_sleep) {
    > > __poll_wait(filp, sk->sk_sleep, p);
    > > /*
    > > * fat comment
    > > */
    > > smp_mb(); // or smp_mb__after_unlock();
    > > }
    > > }
    >
    > Perhaps it makes sense to check ->sk_sleep != NULL in sock_poll_wait(), but
    > I don't think we need __poll_wait(). poll_wait() is inline, I think gcc
    > will optimize out "if (p && wait_address)" check if poll_wait() is called
    > from sock_poll_wait().

    Sure, to me it looks a bit more readable, but let Jiri choose.;-)

    Cheers,
    Jarek P.


    \
     
     \ /
      Last update: 2009-06-28 23:51    [W:4.580 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site