netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bobby Eshleman <bobbyeshleman@gmail.com>
To: Mina Almasry <almasrymina@google.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Willem de Bruijn <willemb@google.com>,
	Neal Cardwell <ncardwell@google.com>,
	David Ahern <dsahern@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bobby Eshleman <bobbyeshleman@meta.com>
Subject: Re: [PATCH net-next v5 4/4] net: add per-netns sysctl for devmem autorelease
Date: Wed, 29 Oct 2025 08:00:22 -0700	[thread overview]
Message-ID: <aQIsBlf4O7cyrXq8@devvm11784.nha0.facebook.com> (raw)
In-Reply-To: <CAHS8izPB6Fn+_Kn-6PWU19rNYOn_0=EngvXyg9Qu48s32Zs9gQ@mail.gmail.com>

On Tue, Oct 28, 2025 at 07:09:58PM -0700, Mina Almasry wrote:
> On Tue, Oct 28, 2025 at 2:14 PM Bobby Eshleman <bobbyeshleman@gmail.com> wrote:
> >
> > On Mon, Oct 27, 2025 at 06:22:16PM -0700, Mina Almasry wrote:
> > > On Thu, Oct 23, 2025 at 2:00 PM Bobby Eshleman <bobbyeshleman@gmail.com> wrote:
> >
> > [...]
> >
> > > > diff --git a/net/core/devmem.c b/net/core/devmem.c
> > > > index 8f3199fe0f7b..9cd6d93676f9 100644
> > > > --- a/net/core/devmem.c
> > > > +++ b/net/core/devmem.c
> > > > @@ -331,7 +331,7 @@ net_devmem_bind_dmabuf(struct net_device *dev,
> > > >                 goto err_free_chunks;
> > > >
> > > >         list_add(&binding->list, &priv->bindings);
> > > > -       binding->autorelease = true;
> > > > +       binding->autorelease = dev_net(dev)->core.sysctl_devmem_autorelease;
> > > >
> > >
> > > Do you need to READ_ONCE this and WRITE_ONCE the write site? Or is
> > > that silly for a u8? Maybe better be safe.
> >
> > Probably worth it to be safe.
> > >
> > > Could we not make this an optional netlink argument? I thought that
> > > was a bit nicer than a sysctl.
> > >
> > > Needs a doc update.
> > >
> > >
> > > -- Thanks, Mina
> >
> > Sounds good, I'll change to nl for the next rev. Thanks for the review!
> >
> 
> Sorry to pile the requests, but any chance we can have the kselftest
> improved to cover the default case and the autorelease=on case?
> 
No problem, I had the same thought.

> I'm thinking out loud here: if we make autorelease a property of the
> socket like I say in the other thread, does changing the value at
> runtime blow everything up. My thinking is that no, what's important
> is that the sk->devmem_info.autorelease **never** gets toggled for any
> active sockets, but as long as the value is constant, everything
> should work fine, yes?

I agree, autorelease can be toggled so long as the xarray is empty
and there are no outstanding urefs (to avoid sock_devmem_dontneed from
doing the wrong thing with the tokens).

Best,
Bobby

      reply	other threads:[~2025-10-29 15:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-23 20:58 [PATCH net-next v5 0/4] net: devmem: improve cpu cost of RX token management Bobby Eshleman
2025-10-23 20:58 ` [PATCH net-next v5 1/4] net: devmem: rename tx_vec to vec in dmabuf binding Bobby Eshleman
2025-10-28  0:33   ` Mina Almasry
2025-10-23 20:58 ` [PATCH net-next v5 2/4] net: devmem: refactor sock_devmem_dontneed for autorelease split Bobby Eshleman
2025-10-28  0:36   ` Mina Almasry
2025-10-28 18:33     ` Bobby Eshleman
2025-10-23 20:58 ` [PATCH net-next v5 3/4] net: devmem: use niov array for token management Bobby Eshleman
2025-10-28  1:20   ` Mina Almasry
2025-10-28 20:49     ` Bobby Eshleman
2025-10-29  2:04       ` Mina Almasry
2025-10-29 14:46         ` Bobby Eshleman
2025-10-23 20:58 ` [PATCH net-next v5 4/4] net: add per-netns sysctl for devmem autorelease Bobby Eshleman
2025-10-28  1:22   ` Mina Almasry
2025-10-28 21:14     ` Bobby Eshleman
2025-10-29  2:09       ` Mina Almasry
2025-10-29 15:00         ` Bobby Eshleman [this message]

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=aQIsBlf4O7cyrXq8@devvm11784.nha0.facebook.com \
    --to=bobbyeshleman@gmail.com \
    --cc=almasrymina@google.com \
    --cc=bobbyeshleman@meta.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=willemb@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).