[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090629092741.GB3845@jolsa.lab.eng.brq.redhat.com>
Date: Mon, 29 Jun 2009 11:27:41 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Jarek Poplawski <jarkao2@...il.com>
Cc: Oleg Nesterov <oleg@...hat.com>,
Davide Libenzi <davidel@...ilserver.org>,
Eric Dumazet <eric.dumazet@...il.com>, netdev@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
fbl@...hat.com, nhorman@...hat.com, davem@...hat.com,
Tejun Heo <htejun@...il.com>
Subject: Re: [PATCH] net: fix race in the receive/select
On Sun, Jun 28, 2009 at 11:48:46PM +0200, Jarek Poplawski wrote:
> 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.
yes :) I like more Jarek's way.. and I'll send separate patch for the
smp_mb_after_lock change.
thanks,
jirka
--
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