netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	David Ahern <dsahern@kernel.org>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2-next 2/3] ip link: Drop cache entry on name changes
Date: Mon, 7 Jan 2019 17:26:27 -0700	[thread overview]
Message-ID: <4fb7c451-c9bf-4551-e713-e513a44e9efd@gmail.com> (raw)
In-Reply-To: <20190107160650.16d956d0@hermes.lan>

On 1/7/19 5:06 PM, Stephen Hemminger wrote:
> On Mon,  7 Jan 2019 14:55:51 -0800
> David Ahern <dsahern@kernel.org> wrote:
> 
>> +int iplink_parse(int argc, char **argv, struct iplink_req *req, char **type,
>> +		 bool *name_change);
> 
> Not a real fan of adding another by reference return value flag.
> It makes the logic flow more complex.
> 
> Is there another way? Caching in general is dicey anyway.
> 

The details of the link change are buried inside of the req argument. It
does not make sense to decode the message to see if the devices
referenced by ifi_index == IFLA_NAME.

The alternative is to just negate caching of ifi_index regardless of
what the request is doing.

If the caching only gained 5 or 10% we would not be having this
discussion - I would not have sent patches. The gain here is significant
and the caching aligns with the whole intent of batch files.

  reply	other threads:[~2019-01-08  0:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 22:55 [PATCH iproute2-next 0/3] Improve batch times by caching link lookups David Ahern
2019-01-07 22:55 ` [PATCH iproute2-next 1/3] ll_map: Add function to remove link cache entry by index David Ahern
2019-01-07 22:55 ` [PATCH iproute2-next 2/3] ip link: Drop cache entry on name changes David Ahern
2019-01-08  0:06   ` Stephen Hemminger
2019-01-08  0:26     ` David Ahern [this message]
2019-01-07 22:55 ` [PATCH iproute2-next 3/3] Improve batch times by caching link lookups David Ahern
2019-01-08  0:05   ` Stephen Hemminger
2019-01-08  0:28     ` David Ahern

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=4fb7c451-c9bf-4551-e713-e513a44e9efd@gmail.com \
    --to=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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).