From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net-next v2 16/21] net/ipv6: Add gfp_flags to route add functions Date: Wed, 18 Apr 2018 10:30:54 -0700 Message-ID: <70692d90-1a96-01e3-776c-51b3a27138b0@gmail.com> References: <20180418003327.19992-1-dsahern@gmail.com> <20180418003327.19992-17-dsahern@gmail.com> <7dd4a7ae-f940-70fd-fab8-3376d4662f70@gmail.com> <77bf271b-7a66-8b53-ea6f-be86bb65590c@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: davem@davemloft.net, idosch@idosch.org, roopa@cumulusnetworks.com, weiwan@google.com, kafai@fb.com, yoshfuji@linux-ipv6.org To: David Ahern , Eric Dumazet , netdev@vger.kernel.org Return-path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:36602 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752337AbeDRRa4 (ORCPT ); Wed, 18 Apr 2018 13:30:56 -0400 Received: by mail-pf0-f195.google.com with SMTP id g14so1249871pfh.3 for ; Wed, 18 Apr 2018 10:30:56 -0700 (PDT) In-Reply-To: <77bf271b-7a66-8b53-ea6f-be86bb65590c@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 04/18/2018 10:10 AM, David Ahern wrote: > On 4/18/18 11:06 AM, Eric Dumazet wrote: >> >> >> On 04/17/2018 05:33 PM, David Ahern wrote: >>> Most FIB entries can be added using memory allocated with GFP_KERNEL. >>> Add gfp_flags to ip6_route_add and addrconf_dst_alloc. Code paths that >>> can be reached from the packet path (e.g., ndisc and autoconfig) or >>> atomic notifiers use GFP_ATOMIC; paths from user context (adding >>> addresses and routes) use GFP_KERNEL. >>> >>> Signed-off-by: David Ahern >>> --- >> >> >> Hmmm.... >> >> ipv6_ifa_notify() calls __ipv6_ifa_notify() under rcu_read_lock_bh()/rcu_read_unlock_bh() >> >> So using GFP_KERNEL in __ipv6_ifa_notify() is certainly not allowed. >> >> > > Thanks for catching that. Will add fix to my followup set. > BTW, I am not sure why we use rcu_read_lock_bh()/rcu_read_unlock_bh() there :/ Maybe it is no longer needed.