All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@web.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: prepare and schedule initial OGM without rtnl_lock()
Date: Wed, 17 Jul 2013 22:53:29 +0200	[thread overview]
Message-ID: <20130717205329.GB25473@Linus-Debian> (raw)
In-Reply-To: <1373852774-3802-1-git-send-email-linus.luessing@web.de>

Ok, please ignore this patch for now. I'm going to do it
differently with the multicast patches which won't need an
rtnl-lock.

Cheers, Linus

On Mon, Jul 15, 2013 at 03:46:14AM +0200, Linus Lüssing wrote:
> There is no need to hold the rtnl-lock during the preparation of the
> initial OGM of a hard interface.
> 
> Besides, it is a little uggly to have batadv_schedule_bat_ogm() executed
> with an rtnl-lock on its first run but without an rtnl-lock in its
> rearmed versions as it makes additions to batadv_schedule_bat_ogm() that
> require an rtnl-lock difficult.
> 
> Signed-off-by: Linus Lüssing <linus.luessing@web.de>
> ---
> 
> the compat code for the multicast-basic patchset needs an rtnl-lock
> somewhere within batadv_schedule_bat_ogm()
> 
> 
>  hard-interface.c |   21 ++++++++++++++++++++-
>  types.h          |    2 ++
>  2 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/hard-interface.c b/hard-interface.c
> index c5f871f..c7ad8ae 100644
> --- a/hard-interface.c
> +++ b/hard-interface.c
> @@ -470,7 +470,7 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
>  			   hard_iface->net_dev->name);
>  
>  	/* begin scheduling originator messages on that interface */
> -	batadv_schedule_bat_ogm(hard_iface);
> +	queue_work(batadv_event_workqueue, &hard_iface->init_ogm_work);
>  
>  out:
>  	return 0;
> @@ -554,6 +554,23 @@ static void batadv_hardif_remove_interface_finish(struct work_struct *work)
>  	batadv_hardif_free_ref(hard_iface);
>  }
>  
> +/**
> + * batadv_hardif_init_ogm - initialize the ogm scheduler
> + * @work: work queue item
> + *
> + * Prepare and queue the initial OGM on this hard interface to get its ogm
> + * scheduler into gear.
> + */
> +static void batadv_hardif_init_ogm(struct work_struct *work)
> +{
> +	struct batadv_hard_iface *hard_iface;
> +
> +	hard_iface = container_of(work, struct batadv_hard_iface,
> +				  init_ogm_work);
> +
> +	batadv_schedule_bat_ogm(hard_iface);
> +}
> +
>  static struct batadv_hard_iface *
>  batadv_hardif_add_interface(struct net_device *net_dev)
>  {
> @@ -583,6 +600,8 @@ batadv_hardif_add_interface(struct net_device *net_dev)
>  	INIT_LIST_HEAD(&hard_iface->list);
>  	INIT_WORK(&hard_iface->cleanup_work,
>  		  batadv_hardif_remove_interface_finish);
> +	INIT_WORK(&hard_iface->init_ogm_work,
> +		  batadv_hardif_init_ogm);
>  
>  	hard_iface->num_bcasts = BATADV_NUM_BCASTS_DEFAULT;
>  	if (batadv_is_wifi_netdev(net_dev))
> diff --git a/types.h b/types.h
> index 0d5b24b..a8b5725 100644
> --- a/types.h
> +++ b/types.h
> @@ -62,6 +62,7 @@ struct batadv_hard_iface_bat_iv {
>   * @rcu: struct used for freeing in an RCU-safe manner
>   * @bat_iv: BATMAN IV specific per hard interface data
>   * @cleanup_work: work queue callback item for hard interface deinit
> + * @init_ogm_work: work queue callback item for ogm scheduler initialization
>   */
>  struct batadv_hard_iface {
>  	struct list_head list;
> @@ -76,6 +77,7 @@ struct batadv_hard_iface {
>  	struct rcu_head rcu;
>  	struct batadv_hard_iface_bat_iv bat_iv;
>  	struct work_struct cleanup_work;
> +	struct work_struct init_ogm_work;
>  };
>  
>  /**
> -- 
> 1.7.10.4
> 

      reply	other threads:[~2013-07-17 20:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15  1:46 [B.A.T.M.A.N.] [PATCH] batman-adv: prepare and schedule initial OGM without rtnl_lock() Linus Lüssing
2013-07-17 20:53 ` Linus Lüssing [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=20130717205329.GB25473@Linus-Debian \
    --to=linus.luessing@web.de \
    --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.