All of lore.kernel.org
 help / color / mirror / Atom feed
* de-indirect TCP congestion control
@ 2018-03-12 18:45 Stephen Hemminger
  2018-03-12 19:04 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2018-03-12 18:45 UTC (permalink / raw)
  To: Eric Dumazet, David Miller; +Cc: netdev

Since indirect calls are expensive, and now even more so, perhaps we should figure out
a way to make the default TCP congestion control hooks into direct calls.
99% of the users just use the single CC module compiled into the kernel.

Use some macros (or other stuff) to change indirect call to direct
calls. So that code like:

static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
{
	const struct inet_connection_sock *icsk = inet_csk(sk);

	icsk->icsk_ca_ops->cong_avoid(sk, ack, acked);

to:

static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
{
	const struct tcp_congestion_ops *ops = inet_csk(sk)->icsk_ca_ops;

	if (ops == default_tcp_ops)
		default_tcp_cong_avoid(s, ack, acked);
	else
		icsk->icsk_ca_ops->cong_avoid(sk, ack, acked);


The use macros and/or compiler symbols so the builtin (non-module) congestion
control is always default_tcp_XXX.

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

* Re: de-indirect TCP congestion control
  2018-03-12 18:45 de-indirect TCP congestion control Stephen Hemminger
@ 2018-03-12 19:04 ` David Miller
  2018-03-12 19:48   ` Stephen Hemminger
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2018-03-12 19:04 UTC (permalink / raw)
  To: stephen; +Cc: eric.dumazet, netdev

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 12 Mar 2018 11:45:52 -0700

> Since indirect calls are expensive, and now even more so, perhaps we should figure out
> a way to make the default TCP congestion control hooks into direct calls.
> 99% of the users just use the single CC module compiled into the kernel.

Who is this magic user with only one CC algorithm enabled in their
kernel?  I want to know who this dude is?

I don't think it's going to help much since people will have I think
at least two algorithms compiled into nearly everyone's tree.

Distributions will enable everything.

Google is going to have at least two algorithms enabled.

etc. etc. etc.

Getting rid of indirect calls is a fine goal, but the precondition you
are mentioning to achieve this doesn't seem practical at all.

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

* Re: de-indirect TCP congestion control
  2018-03-12 19:04 ` David Miller
@ 2018-03-12 19:48   ` Stephen Hemminger
  2018-03-12 20:03     ` Eric Dumazet
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2018-03-12 19:48 UTC (permalink / raw)
  To: David Miller; +Cc: eric.dumazet, netdev

On Mon, 12 Mar 2018 15:04:06 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: Stephen Hemminger <stephen@networkplumber.org>
> Date: Mon, 12 Mar 2018 11:45:52 -0700
> 
> > Since indirect calls are expensive, and now even more so, perhaps we should figure out
> > a way to make the default TCP congestion control hooks into direct calls.
> > 99% of the users just use the single CC module compiled into the kernel.  
> 
> Who is this magic user with only one CC algorithm enabled in their
> kernel?  I want to know who this dude is?
> 
> I don't think it's going to help much since people will have I think
> at least two algorithms compiled into nearly everyone's tree.
> 
> Distributions will enable everything.
> 
> Google is going to have at least two algorithms enabled.
> 
> etc. etc. etc.
> 
> Getting rid of indirect calls is a fine goal, but the precondition you
> are mentioning to achieve this doesn't seem practical at all.

What I meant is that kernels with N congestion controls, almost all traffic
uses the default So that path can be optimized. The example I gave would
have all the others doing the same indirect call.

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

* Re: de-indirect TCP congestion control
  2018-03-12 19:48   ` Stephen Hemminger
@ 2018-03-12 20:03     ` Eric Dumazet
  2018-03-12 20:05       ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Dumazet @ 2018-03-12 20:03 UTC (permalink / raw)
  To: Stephen Hemminger, David Miller; +Cc: netdev



On 03/12/2018 12:48 PM, Stephen Hemminger wrote:
> On Mon, 12 Mar 2018 15:04:06 -0400 (EDT)
> David Miller <davem@davemloft.net> wrote:
> 
>> From: Stephen Hemminger <stephen@networkplumber.org>
>> Date: Mon, 12 Mar 2018 11:45:52 -0700
>>
>>> Since indirect calls are expensive, and now even more so, perhaps we should figure out
>>> a way to make the default TCP congestion control hooks into direct calls.
>>> 99% of the users just use the single CC module compiled into the kernel.
>>
>> Who is this magic user with only one CC algorithm enabled in their
>> kernel?  I want to know who this dude is?
>>
>> I don't think it's going to help much since people will have I think
>> at least two algorithms compiled into nearly everyone's tree.
>>
>> Distributions will enable everything.
>>
>> Google is going to have at least two algorithms enabled.
>>
>> etc. etc. etc.
>>
>> Getting rid of indirect calls is a fine goal, but the precondition you
>> are mentioning to achieve this doesn't seem practical at all.
> 
> What I meant is that kernels with N congestion controls, almost all traffic
> uses the default So that path can be optimized. The example I gave would
> have all the others doing the same indirect call.
> 

I do not understand. What is default_tcp_ops anyway ?

How changes to /proc/sys/net/ipv4/tcp_congestion_control will impact this ?

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

* Re: de-indirect TCP congestion control
  2018-03-12 20:03     ` Eric Dumazet
@ 2018-03-12 20:05       ` David Miller
  2018-03-12 20:51         ` Stephen Hemminger
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2018-03-12 20:05 UTC (permalink / raw)
  To: eric.dumazet; +Cc: stephen, netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 12 Mar 2018 13:03:35 -0700

> 
> 
> On 03/12/2018 12:48 PM, Stephen Hemminger wrote:
>> On Mon, 12 Mar 2018 15:04:06 -0400 (EDT)
>> David Miller <davem@davemloft.net> wrote:
>> 
>>> From: Stephen Hemminger <stephen@networkplumber.org>
>>> Date: Mon, 12 Mar 2018 11:45:52 -0700
>>>
>>>> Since indirect calls are expensive, and now even more so, perhaps we
>>>> should figure out
>>>> a way to make the default TCP congestion control hooks into direct
>>>> calls.
>>>> 99% of the users just use the single CC module compiled into the
>>>> kernel.
>>>
>>> Who is this magic user with only one CC algorithm enabled in their
>>> kernel?  I want to know who this dude is?
>>>
>>> I don't think it's going to help much since people will have I think
>>> at least two algorithms compiled into nearly everyone's tree.
>>>
>>> Distributions will enable everything.
>>>
>>> Google is going to have at least two algorithms enabled.
>>>
>>> etc. etc. etc.
>>>
>>> Getting rid of indirect calls is a fine goal, but the precondition you
>>> are mentioning to achieve this doesn't seem practical at all.
>> What I meant is that kernels with N congestion controls, almost all
>> traffic
>> uses the default So that path can be optimized. The example I gave
>> would
>> have all the others doing the same indirect call.
> 
> I do not understand. What is default_tcp_ops anyway ?
> 
> How changes to /proc/sys/net/ipv4/tcp_congestion_control will impact
> this ?

I'm also confused what is being suggested exactly and how this can
work. :-)

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

* Re: de-indirect TCP congestion control
  2018-03-12 20:05       ` David Miller
@ 2018-03-12 20:51         ` Stephen Hemminger
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2018-03-12 20:51 UTC (permalink / raw)
  To: David Miller; +Cc: eric.dumazet, netdev

On Mon, 12 Mar 2018 16:05:16 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Mon, 12 Mar 2018 13:03:35 -0700
> 
> > 
> > 
> > On 03/12/2018 12:48 PM, Stephen Hemminger wrote:  
> >> On Mon, 12 Mar 2018 15:04:06 -0400 (EDT)
> >> David Miller <davem@davemloft.net> wrote:
> >>   
> >>> From: Stephen Hemminger <stephen@networkplumber.org>
> >>> Date: Mon, 12 Mar 2018 11:45:52 -0700
> >>>  
> >>>> Since indirect calls are expensive, and now even more so, perhaps we
> >>>> should figure out
> >>>> a way to make the default TCP congestion control hooks into direct
> >>>> calls.
> >>>> 99% of the users just use the single CC module compiled into the
> >>>> kernel.  
> >>>
> >>> Who is this magic user with only one CC algorithm enabled in their
> >>> kernel?  I want to know who this dude is?
> >>>
> >>> I don't think it's going to help much since people will have I think
> >>> at least two algorithms compiled into nearly everyone's tree.
> >>>
> >>> Distributions will enable everything.
> >>>
> >>> Google is going to have at least two algorithms enabled.
> >>>
> >>> etc. etc. etc.
> >>>
> >>> Getting rid of indirect calls is a fine goal, but the precondition you
> >>> are mentioning to achieve this doesn't seem practical at all.  
> >> What I meant is that kernels with N congestion controls, almost all
> >> traffic
> >> uses the default So that path can be optimized. The example I gave
> >> would
> >> have all the others doing the same indirect call.  
> > 
> > I do not understand. What is default_tcp_ops anyway ?
> > 
> > How changes to /proc/sys/net/ipv4/tcp_congestion_control will impact
> > this ?  
> 
> I'm also confused what is being suggested exactly and how this can
> work. :-)

Trying to directly call the fastpath TCP congestion operations for sockets
using the default.  The problem is how to do this and it gets messy with Kconfig
and CPP to deal with as raw tools. Maybe weak symbols could be used.

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

end of thread, other threads:[~2018-03-12 20:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12 18:45 de-indirect TCP congestion control Stephen Hemminger
2018-03-12 19:04 ` David Miller
2018-03-12 19:48   ` Stephen Hemminger
2018-03-12 20:03     ` Eric Dumazet
2018-03-12 20:05       ` David Miller
2018-03-12 20:51         ` Stephen Hemminger

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.