On Wed 19 Sep 2018 at 22:09, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Mon, Sep 17, 2018 at 12:19 AM Vlad Buslov <vla...@mellanox.com> wrote: >> @@ -482,16 +483,25 @@ static int tcf_block_insert(struct tcf_block *block, >> struct net *net, >> struct netlink_ext_ack *extack) >> { >> struct tcf_net *tn = net_generic(net, tcf_net_id); >> + int err; >> + >> + idr_preload(GFP_KERNEL); >> + spin_lock(&tn->idr_lock); >> + err = idr_alloc_u32(&tn->idr, block, &block->index, block->index, >> + GFP_NOWAIT); > > > Why GFP_NOWAIT rather than GFP_ATOMIC here?
I checked how idr_preload is used in kernel and in most places following allocation uses GFP_NOWAIT (including idr-test.c). You suggest I should change it to GFP_ATOMIC?