All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Javier Cardona <javier@cozybit.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	devel@lists.open80211s.org
Subject: Re: mesh RCU issues
Date: Sat, 14 May 2011 01:30:34 +0200	[thread overview]
Message-ID: <1305329434.32461.2.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <BANLkTi=R_Eyz8+iZsk+=Gs4vaNo-0eUVng@mail.gmail.com> (sfid-20110513_222925_238565_758AD262)

On Fri, 2011-05-13 at 13:28 -0700, Javier Cardona wrote:

> >> Isn't the call to del_timer_sync() you are looking for in
> >> mesh_path_node_reclaim() ?
> >
> > Hmm, indeed, but it looks like mesh_path_node_free() also frees a node,
> > no? I'd only found the latter function freeing it and got worried.
> 
> Ah, I see.  Yes, looks like the timer should be deleted there as well.
>  Patch will follow.

Thanks!

> > You'll want to apply
> > http://johannes.sipsolutions.net/patches/kernel/all/LATEST/NNN-mac80211-rcu-annotations.patch to get rid of all the other spurious RCU warnings with CONFIG_SPARSE_RCU.
> 
> (You probably meant CONFIG_SPARSE_RCU_POINTER)

Yeah, sorry.

> I must be doing something wrong because I don't see the RCU warnings
> after making {mesh,mpp}_paths __rcu.  I only see two "different
> address spaces" errors that are fixed in the patch below.
> I do see a bunch of 'warning' errors:
> 
> /home/javier/dev/wireless-testing/arch/x86/include/asm/uaccess_32.h:199:2:
> error: attribute 'warning': unknown attribute

Oh, damn. You're running into a sparse issue: upon encountering an
error, it aborts parsing/checking. So since you're getting an error from
an include file, you never see any warnings from the rest of the file.

> 
> 
> diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
> index 83ce48e..1db8bba 100644
> --- a/net/mac80211/mesh_pathtbl.c
> +++ b/net/mac80211/mesh_pathtbl.c
> @@ -36,8 +36,8 @@ struct mpath_node {
>         struct mesh_path *mpath;
>  };
> 
> -static struct mesh_table *mesh_paths;
> -static struct mesh_table *mpp_paths; /* Store paths for MPP&MAP */
> +static struct mesh_table __rcu *mesh_paths;
> +static struct mesh_table __rcu *mpp_paths; /* Store paths for MPP&MAP */
> 
>  int mesh_paths_generation;
> 
> @@ -513,7 +513,7 @@ void mesh_plink_broken(struct sta_info *sta)
>         for_each_mesh_entry(mesh_paths, p, node, i) {
>                 mpath = node->mpath;
>                 spin_lock_bh(&mpath->state_lock);
> -               if (mpath->next_hop == sta &&
> +               if (rcu_dereference(mpath->next_hop) == sta &&
>                     mpath->flags & MESH_PATH_ACTIVE &&
>                     !(mpath->flags & MESH_PATH_FIXED)) {
>                         mpath->flags &= ~MESH_PATH_ACTIVE;
> @@ -549,7 +549,7 @@ void mesh_path_flush_by_nexthop(struct sta_info *sta)
> 
>         for_each_mesh_entry(mesh_paths, p, node, i) {
>                 mpath = node->mpath;
> -               if (mpath->next_hop == sta)
> +               if (rcu_dereference(mpath->next_hop) == sta)
>                         mesh_path_del(mpath->dst, mpath->sdata);
>         }
>  }
> 
> Thoughts?

I'll try if this is sufficient but it seemed there were more warnings
when I tried.

johannes


  reply	other threads:[~2011-05-13 23:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-12 12:25 mesh RCU issues Johannes Berg
2011-05-12 13:03 ` [PATCH] mac80211: remove pointless mesh path timer RCU code Johannes Berg
2011-05-12 22:26 ` mesh RCU issues Javier Cardona
2011-05-13  7:13   ` Johannes Berg
2011-05-13 20:28     ` Javier Cardona
2011-05-13 23:30       ` Johannes Berg [this message]
2011-05-14  0:00       ` Johannes Berg
2011-05-14  3:52         ` Javier Cardona
2011-05-14  8:24           ` Johannes Berg

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=1305329434.32461.2.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=devel@lists.open80211s.org \
    --cc=javier@cozybit.com \
    --cc=linux-wireless@vger.kernel.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.