Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754786AbZF1VtY (ORCPT ); Sun, 28 Jun 2009 17:49:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752885AbZF1Vs6 (ORCPT ); Sun, 28 Jun 2009 17:48:58 -0400 Received: from mail-fx0-f218.google.com ([209.85.220.218]:51059 "EHLO mail-fx0-f218.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752949AbZF1Vs5 (ORCPT ); Sun, 28 Jun 2009 17:48:57 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=aBvB+mWTW2gCRCcRmeGLYpXEF3EnMC1HQ8RHuhTIR7DjtcUlmRIsNr9JZ1gwqjbUQe 1jgKUrXS5ipICtZYM0DpO+BBxxJJiq+EEXec7skWBv5Nq54/BynDBY9gI7h7ddXX1lXX BOuEjUDMhDXF1SYH49iyuH73865vWH7FoKHog= Date: Sun, 28 Jun 2009 23:48:46 +0200 From: Jarek Poplawski To: Oleg Nesterov Cc: Davide Libenzi , Eric Dumazet , Jiri Olsa , netdev@vger.kernel.org, Linux Kernel Mailing List , fbl@redhat.com, nhorman@redhat.com, davem@redhat.com, Tejun Heo Subject: Re: [PATCH] net: fix race in the receive/select Message-ID: <20090628214846.GB4584@ami.dom.local> References: <4A442B65.8040701@gmail.com> <4A443033.8060401@gmail.com> <20090626135742.GB3845@redhat.com> <20090626145027.GA6534@redhat.com> <4A474FB5.4070901@gmail.com> <4A475266.9040203@gmail.com> <20090628180412.GA9171@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090628180412.GA9171@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 989 Lines: 30 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/