netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Eric Dumazet <edumazet@google.com>
Cc: Florian Westphal <fw@strlen.de>,
	Brian Vazquez <brianvv@google.com>,
	netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, shakeelb@google.com, soheil@google.com
Subject: Re: [PATCH net] net: avoid indirect memory pressure calls
Date: Wed, 1 Mar 2023 13:31:14 +0100	[thread overview]
Message-ID: <20230301123114.GA6827@breakpoint.cc> (raw)
In-Reply-To: <CANn89i+WYy+Q1i1e1vrQmPzH-eDEVHJn29xgmsXJ8uMidP9CqQ@mail.gmail.com>

Eric Dumazet <edumazet@google.com> wrote:
> BTW I was curious why Google was not seeing this, and it appears Brian Vasquez
> forgot to upstream this change...
> 
> commit 5ea2f21d6c1078d2c563cb455ad5877b4ada94e1
> Author: Brian Vazquez <brianvv@google.com>
> Date:   Thu Mar 3 19:09:49 2022 -0800
> 
>     PRODKERNEL: net-directcall: annotate tcp_leave_memory_pressure and
>     tcp_getsockopt
> 
> diff --git a/net/core/sock.c b/net/core/sock.c
> index 05032b399c873984e5297898d647905ca9f21f2e..54cb989dc162f3982380ac12cf5a150214e209a2
> 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -2647,10 +2647,13 @@ static void sk_enter_memory_pressure(struct sock *sk)
>         sk->sk_prot->enter_memory_pressure(sk);
>  }
> 
> +INDIRECT_CALLABLE_DECLARE(void tcp_leave_memory_pressure(struct sock *sk));
> +
>  static void sk_leave_memory_pressure(struct sock *sk)
>  {
>         if (sk->sk_prot->leave_memory_pressure) {
> -               sk->sk_prot->leave_memory_pressure(sk);
> +               INDIRECT_CALL_1(sk->sk_prot->leave_memory_pressure,
> +                               tcp_leave_memory_pressure, sk);
>         } else {
>                 unsigned long *memory_pressure = sk->sk_prot->memory_pressure;

re-tested: this change also resolves the regression i was seeing.

If you prefer to upstream this instead of the proposed change then I'm
fine with that.

Thanks.

  reply	other threads:[~2023-03-01 12:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 18:46 [PATCH net] net: avoid indirect memory pressure calls Florian Westphal
2023-02-27 23:27 ` Jakub Kicinski
2023-02-28 16:28   ` Alexander Lobakin
2023-02-28 16:34     ` Florian Westphal
2023-02-28 16:35       ` Eric Dumazet
2023-02-28 16:44 ` Eric Dumazet
2023-02-28 17:42   ` Eric Dumazet
2023-03-01 12:31     ` Florian Westphal [this message]
2023-03-01 12:51       ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230301123114.GA6827@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=brianvv@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shakeelb@google.com \
    --cc=soheil@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).