On 05/11/17(Sun) 09:39, Mihai Popescu wrote:
> [...] 
> This is rather a tech@ question but i'm not high enough for that list.
> I see some articles about the fact the network stack in OpenBSD is
> locked or single threaded. IT may be the same thing, i don't really
> know.
> 
> Can anyone share some light for this topic, at some beginner level?
> What is that 'lock' actually? Does it mean it can only be modified by
> a single thread at the time?
> Will multithread make things faster for the case where there is only
> one physical interface in a computer?

It means that if multiple CPUs want to process network packet (sending
and/or receiving) or access network data structure (interfaces, routes,
addresses, etc) at the same time they will be serialized by the NET_LOCK().

Serialized mean that the second CPU will start executing code in the
Network Stack as soon as the first one is "finished" with its current
task.  So there's currently no parallelism *inside* the Network Stack.

However some parts of the Network Stack, the IP layer for example, can
be executed in parallel of the rest of the kernel.  That's because it
doesn't run with the KERNEL_LOCK().

We're now working on using two threads to process packets.  Diffs are
floating around among developers and give some nice performance boost.

Other developers are working [0] on letting read data access, most of
ifconfig(8) for example, be able to be executed in parallel of packet
processing.

Stay tuned!

[0] https://marc.info/?l=openbsd-cvs&m=150981473127558&w=2

Reply via email to