All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Lahav Schlesinger <lschlesinger@drivenets.com>
Cc: netdev@vger.kernel.org, kuba@kernel.org, nikolay@nvidia.com
Subject: Re: [PATCH net-next v5] rtnetlink: Support fine-grained netdevice bulk deletion
Date: Wed, 8 Dec 2021 16:43:28 -0700	[thread overview]
Message-ID: <05fe0ea9-56ba-9248-fa05-b359d6166c9f@gmail.com> (raw)
In-Reply-To: <20211208214711.zr4ljxqpb5u7z3op@kgollan-pc>

On 12/8/21 2:47 PM, Lahav Schlesinger wrote:
> No visible changes from what I saw, this API is as fast as group
> deletion. Maybe a few tens of milliseconds slower, but it's lost in the
> noise.
> I'll run more thorough benchmarks to get to a more conclusive conclusion.
> 
> Also just pointing out that the sort will be needed even if we pass an
> array (IFLA_IFINDEX_LIST) instead.
> Feels like CS 101, but do you have a better approach for detecting
> duplicates in an array? I imagine a hash table will be slower as it will
> need to allocate a node object for each device (assuming we don't want
> to add a new hlist_node to 'struct net_device' just for this)

I think marking the dev's and then using a delete loop is going to be
the better approach - avoid the sort and duplicate problem. I use that
approach for nexthop deletes:

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/net/ipv4/nexthop.c#n1849

Find a hole in net_device struct in an area used only for control path
and add 'bool grp_delete' (or a 1-bit hole). Mark the devices on pass
and delete them on another.

  reply	other threads:[~2021-12-08 23:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-05  9:36 [PATCH net-next v5] rtnetlink: Support fine-grained netdevice bulk deletion Lahav Schlesinger
2021-12-05 10:28 ` Nikolay Aleksandrov
2021-12-06  8:25 ` Nicolas Dichtel
2021-12-06 15:20   ` David Ahern
2021-12-07  8:27     ` Nicolas Dichtel
2021-12-07 12:48   ` Lahav Schlesinger
2021-12-08  7:44     ` Nicolas Dichtel
2021-12-07  4:12 ` David Ahern
2021-12-07 15:37   ` Jakub Kicinski
2021-12-08 21:50     ` Lahav Schlesinger
2021-12-08 21:47   ` Lahav Schlesinger
2021-12-08 23:43     ` David Ahern [this message]
2021-12-09  0:04       ` Jakub Kicinski
2021-12-09  0:18         ` David Ahern
2021-12-09  0:45           ` Jakub Kicinski
2021-12-09  0:47             ` David Ahern
2022-01-04  8:21             ` Lahav Schlesinger
2022-01-04 14:55               ` Jakub Kicinski

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=05fe0ea9-56ba-9248-fa05-b359d6166c9f@gmail.com \
    --to=dsahern@gmail.com \
    --cc=kuba@kernel.org \
    --cc=lschlesinger@drivenets.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@nvidia.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 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.