[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250416185513.1291-1-kuniyu@amazon.com>
Date: Wed, 16 Apr 2025 11:55:09 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <pabeni@...hat.com>
CC: <davem@...emloft.net>, <dsahern@...nel.org>, <edumazet@...gle.com>,
<horms@...nel.org>, <kuba@...nel.org>, <kuni1840@...il.com>,
<kuniyu@...zon.com>, <netdev@...r.kernel.org>
Subject: Re: [PATCH RESEND v2 net-next 07/14] ipv6: Preallocate rt->fib6_nh->rt6i_pcpu in ip6_route_info_create().
From: Paolo Abeni <pabeni@...hat.com>
Date: Wed, 16 Apr 2025 11:37:54 +0200
> On 4/16/25 11:21 AM, Paolo Abeni wrote:
> > On 4/14/25 8:14 PM, Kuniyuki Iwashima wrote:
> >> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> >> index ce060b59d41a..404da01a7502 100644
> >> --- a/net/ipv6/route.c
> >> +++ b/net/ipv6/route.c
> >> @@ -3664,10 +3664,12 @@ int fib6_nh_init(struct net *net, struct fib6_nh *fib6_nh,
> >> goto out;
> >>
> >> pcpu_alloc:
> >> - fib6_nh->rt6i_pcpu = alloc_percpu_gfp(struct rt6_info *, gfp_flags);
> >> if (!fib6_nh->rt6i_pcpu) {
> >> - err = -ENOMEM;
> >> - goto out;
> >> + fib6_nh->rt6i_pcpu = alloc_percpu_gfp(struct rt6_info *, gfp_flags);
> >
> > 'rt6i_pcpu' has just been pre-allocated, why we need to try again the
> > allocation here?
>
> Ah, I missed the shared code with ipv4. The next patch clarifies thing
> to me. I guess it would be better to either squash the patches or add a
> comment here (or in the commit message).
Sure, will add description in the commit message.
From: Paolo Abeni <pabeni@...hat.com>
Date: Wed, 16 Apr 2025 11:23:32 +0200
> On 4/14/25 8:14 PM, Kuniyuki Iwashima wrote:
> > ip6_route_info_create_nh() will be called under RCU.
> >
> > Then, fib6_nh_init() is also under RCU, but per-cpu memory allocation
> > is very likely to fail with GFP_ATOMIC while bluk-adding IPv6 routes
>
> oops, I forgot a very minor nit: ^^^^ bulk
OMG (Oh My Grammarly) :)
Powered by blists - more mailing lists