All of lore.kernel.org
 help / color / mirror / Atom feed
* RPS vs RFS
@ 2014-04-03 19:14 Sharat Masetty
  2014-04-03 23:58 ` Tom Herbert
  0 siblings, 1 reply; 3+ messages in thread
From: Sharat Masetty @ 2014-04-03 19:14 UTC (permalink / raw)
  To: netdev; +Cc: sharat chandra

I am trying to understand the true benefit of RFS over RPS. In the
kernel documentation scaling.txt, the author talks about data cache
hitrate, can someone explain what this actually means? In which
scenarios would RFS be beneficial? Why would it help to have network
stack run on the same core on which the application for a stream/flow
is running?


Consider a NIC with a single receive queue, single interrupt line, and
iperf application is pulling data off this NIC card. In case where
iperf may still be running on the same core on which the interrupts
are delivered, then in that case the whole stack is pinned to the same
core, and would not be benefiting a lot from this scheme




References:
https://www.kernel.org/doc/Documentation/networking/scaling.txt

https://lwn.net/Articles/382428/

Regards,
Sharat

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RPS vs RFS
  2014-04-03 19:14 RPS vs RFS Sharat Masetty
@ 2014-04-03 23:58 ` Tom Herbert
  2014-04-07 21:15   ` Sharat Masetty
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Herbert @ 2014-04-03 23:58 UTC (permalink / raw)
  To: Sharat Masetty; +Cc: Linux Netdev List

On Thu, Apr 3, 2014 at 12:14 PM, Sharat Masetty <sharat04@gmail.com> wrote:
> I am trying to understand the true benefit of RFS over RPS. In the
> kernel documentation scaling.txt, the author talks about data cache
> hitrate, can someone explain what this actually means? In which
> scenarios would RFS be beneficial? Why would it help to have network
> stack run on the same core on which the application for a stream/flow
> is running?
>
Silo'ing processing is typically good, it provides cache locality,
potentially eliminates a cross CPU wakeup, and hopefully reduces lock
contention. There is a secondary benefit in that we get some isolation
of RX processing and application.
>
> Consider a NIC with a single receive queue, single interrupt line, and
> iperf application is pulling data off this NIC card. In case where
> iperf may still be running on the same core on which the interrupts
> are delivered, then in that case the whole stack is pinned to the same
> core, and would not be benefiting a lot from this scheme
>
Consider what happens you have a multi threaded network intensive
application like a web server. Running all the networking an a single
CPU becomes a bottleneck (why we created RPS/RFS in the first place).

>
>
>
> References:
> https://www.kernel.org/doc/Documentation/networking/scaling.txt
>
> https://lwn.net/Articles/382428/
>
> Regards,
> Sharat
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RPS vs RFS
  2014-04-03 23:58 ` Tom Herbert
@ 2014-04-07 21:15   ` Sharat Masetty
  0 siblings, 0 replies; 3+ messages in thread
From: Sharat Masetty @ 2014-04-07 21:15 UTC (permalink / raw)
  To: Tom Herbert; +Cc: Linux Netdev List

Ok.. the use case makes sense to me now.

On the benefits part of it, can you please elaborate a little bit on
the cross CPU wakeup and the lock contention? Are you talking about
scheduling NET_RX_ACTION softIRQ on another CPU, why is this
expensive?
Also what locks are you talking about?  regarding cache locality, do
you think that with hardware architectures where cores sharing the
same L2 cache, cache locality will not be an issue?

Thanks
Sharat

On Thu, Apr 3, 2014 at 5:58 PM, Tom Herbert <therbert@google.com> wrote:
> On Thu, Apr 3, 2014 at 12:14 PM, Sharat Masetty <sharat04@gmail.com> wrote:
>> I am trying to understand the true benefit of RFS over RPS. In the
>> kernel documentation scaling.txt, the author talks about data cache
>> hitrate, can someone explain what this actually means? In which
>> scenarios would RFS be beneficial? Why would it help to have network
>> stack run on the same core on which the application for a stream/flow
>> is running?
>>
> Silo'ing processing is typically good, it provides cache locality,
> potentially eliminates a cross CPU wakeup, and hopefully reduces lock
> contention. There is a secondary benefit in that we get some isolation
> of RX processing and application.
>>
>> Consider a NIC with a single receive queue, single interrupt line, and
>> iperf application is pulling data off this NIC card. In case where
>> iperf may still be running on the same core on which the interrupts
>> are delivered, then in that case the whole stack is pinned to the same
>> core, and would not be benefiting a lot from this scheme
>>
> Consider what happens you have a multi threaded network intensive
> application like a web server. Running all the networking an a single
> CPU becomes a bottleneck (why we created RPS/RFS in the first place).
>
>>
>>
>>
>> References:
>> https://www.kernel.org/doc/Documentation/networking/scaling.txt
>>
>> https://lwn.net/Articles/382428/
>>
>> Regards,
>> Sharat
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-07 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-03 19:14 RPS vs RFS Sharat Masetty
2014-04-03 23:58 ` Tom Herbert
2014-04-07 21:15   ` Sharat Masetty

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.