All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH v2 2/2] batman-adv: Simple (re)broadcast avoidance
Date: Thu, 04 Aug 2016 09:29:20 +0200	[thread overview]
Message-ID: <3736273.XKRaZoI53k@bentobox> (raw)
In-Reply-To: <20160803234329.GD16866@otheros>


[-- Attachment #1.1: Type: text/plain, Size: 1393 bytes --]

On Donnerstag, 4. August 2016 01:43:29 CEST Linus Lüssing wrote:
[...]
> So the regular purging routines will break the cycle in the end
> when they reduce the refcount of the hardif_neigh_node to zero.

Ok, lets go through it with following idea:

1. the cycle exists (including the missing batadv_orig_node::ifinfo_list
   in my earlier example graph)
2. batadv_purge_orig is called via the worker (for some reason with a large delay)
3. _batadv_purge_orig goes through all entries in the orig hashtable
4. batadv_purge_orig_node is called
5. batadv_has_timed_out returns "hey, you are old - go away"
6. batadv_purge_orig_node now only does for this orig_entry:
   - batadv_gw_node_delete(bat_priv, orig_node);
   - hlist_del_rcu(&orig_node->hash_entry);
   - batadv_tt_global_del_orig(orig_node->bat_priv,
							  orig_node, -1,
							  "originator timed out");
   - batadv_orig_node_put(orig_node);

So the most cleanup work (batadv_orig_node_release) is only done when
the orig_node refcnt reaches zero.

The batadv_purge_orig_ifinfo, batadv_purge_orig_neighbors and the
rest from batadv_purge_orig_node is only done when the originator
has not yet reached its timeout. I would therefore guess it working
because you are lucky and your batadv_purge_orig_neighbors and
batadv_purge_orig_ifinfo sometimes(tm) solve this problem for you.

Kind regards,
	Sven

[-- Attachment #1.2: cycle.dot --]
[-- Type: text/vnd.graphviz, Size: 757 bytes --]

digraph {
	
edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"];
node [fontname="Helvetica",fontsize="10",shape=record];

	"batadv_orig_node" -> "batadv_orig_ifinfo" [label=" last_bonding_candidate", style="dashed",color="green"];
"batadv_orig_node" -> "batadv_orig_ifinfo" [label=" ifinfo_list", style="dashed",color="green"];
"batadv_hardif_neigh_node" -> "batadv_orig_node" [label=" orig_node", style="dashed",color="blue"];
"batadv_orig_ifinfo" -> "batadv_neigh_node" [label=" router", style="dashed",color="green"];
"batadv_neigh_node" -> "batadv_hardif_neigh_node" [label=" hardif_neigh", style="dashed",color="green"];
"batadv_orig_node" -> "batadv_neigh_node" [label=" neigh_list", style="dashed",color="green"]
}

[-- Attachment #1.3: cycle.png --]
[-- Type: image/png, Size: 20736 bytes --]

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-08-04  7:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01 20:38 [B.A.T.M.A.N.] [PATCH v2 1/2] batman-adv: Remove unused skb_reset_mac_header() Linus Lüssing
2016-08-01 20:38 ` [B.A.T.M.A.N.] [PATCH v2 2/2] batman-adv: Simple (re)broadcast avoidance Linus Lüssing
2016-08-03 19:59   ` Sven Eckelmann
2016-08-03 21:25     ` Linus Lüssing
2016-08-03 23:43       ` Linus Lüssing
2016-08-04  5:56         ` Sven Eckelmann
2016-08-04  6:09           ` Sven Eckelmann
2016-08-06  1:11           ` Linus Lüssing
2016-08-06  8:13             ` Sven Eckelmann
2016-08-06 19:58               ` Linus Lüssing
2016-08-04  7:29         ` Sven Eckelmann [this message]
2016-08-06  1:04           ` Linus Lüssing

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=3736273.XKRaZoI53k@bentobox \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.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 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.