Search Linux Wireless

Re: [PATCH] mac80211: don't sleep in mesh_path_add allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 15, 2009 at 11:17 AM, Johannes
Berg<johannes@xxxxxxxxxxxxxxxx> wrote:
> On Wed, 2009-07-15 at 11:02 -0700, Andrey Yurovsky wrote:
>> mesh_path_add allocates an mpath and a node but it is called with RCU
>> held.  Use the GFP_ATOMIC flag to prevent these allocations from
>> sleeping since otherwise we can hit the following sleep-while-atomic:
>
> This isn't sufficient, quoting from the function, highlight added:
>
> int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata)
> {
> ...
>        if (grow) {
>                struct mesh_table *oldtbl, *newtbl;
>
>                write_lock(&pathtbl_resize_lock);
>                oldtbl = mesh_paths;
>                newtbl = mesh_table_grow(mesh_paths);
>                if (!newtbl) {
>                        write_unlock(&pathtbl_resize_lock);
>                        return 0;
>                }
>                rcu_assign_pointer(mesh_paths, newtbl);
>                write_unlock(&pathtbl_resize_lock);
>
> *******         synchronize_rcu();
>                mesh_table_free(oldtbl, false);
>        }
> ...
> }
>
> johannes
>

Yes, we'll address growing the issue separately.  Ok, we'll send a new
patch for the allocations as well as growing the table in the future.

  -Andrey
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux