netdev
[Top] [All Lists]

Re: synchronization between bottom half and user context

To: Ronghua Zhang <rz5b@xxxxxxxxxxxxxxx>
Subject: Re: synchronization between bottom half and user context
From: jamal <hadi@xxxxxxxxxx>
Date: Mon, 9 Dec 2002 08:29:45 -0500 (EST)
Cc: <netdev@xxxxxxxxxxx>
In-reply-to: <Pine.LNX.4.44.0212041029230.1399-100000@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx


To reitarate:
1) serialization is against n-CPUs towards the socket.
2) ordered data (dont care whether its 1 or n-CPUs). TCP cares, UDP
doesnt.

The main TCP path towards the socket runs in softirq context - you can
have the same softirq code running on multiple CPUs at the same time. The
system call is in process context.

cheers,
jamal

On Wed, 4 Dec 2002, Ronghua Zhang wrote:

> Do you mean that net_bh can be running on several CPU at the same time?
> If it is juat a UP, can I say that socket system call and net_bh is always
> serialized even without lock_sock()?
>
> Ronghua
>
> On Wed, 4 Dec 2002, jamal wrote:
>
> >
> >
> > On Tue, 3 Dec 2002, Ronghua Zhang wrote:
> >
> > > Can someone tell me when lock should be used to synchronize bh and user
> > > context?
> > >
> > > For examle: in tcp_accept(), lock_sock() is called to avoid any change
> > > made by net_bh during its operation. But if tcp_accept() is called, it's
> > > impossilbe that net_bh is also executing. (i think this is true for UP,
> > > what about SMP?), then why need lock_sock()?
> > >
> >
> > to serialize packets towards the socket; The linux network stack
> > is threaded, you can have upto n packets to the same socket coming up the
> > stack in parallel on an n-SMP machine; think of that and the fact that TCP
> > data must be sequenced.
> >
> > cheers,
> > jamal
> >
>
>



<Prev in Thread] Current Thread [Next in Thread>