From: wenxu <wenxu@ucloud.cn>
To: David Ahern <dsahern@gmail.com>,
davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2] ip_tunnel: Add dst_cache management lwtunnel_state of ip tunnel
Date: Fri, 22 Feb 2019 23:21:14 +0800 [thread overview]
Message-ID: <8b96ffcb-fe29-1c49-a266-3e9d20b60d89@ucloud.cn> (raw)
In-Reply-To: <9277b934-63f6-2f16-bd46-948bc64cc46e@gmail.com>
On 2019/2/22 下午11:03, David Ahern wrote:
> On 2/21/19 11:14 PM, wenxu wrote:
>> build_state in the rcu_read_lock and disable the preempt
>>
>> rcu_read_lock();
>> ops = rcu_dereference(lwtun_encaps[encap_type]);
>> if (likely(ops && ops->build_state && try_module_get(ops->owner))) {
>> found = true;
>> ret = ops->build_state(encap, family, cfg, lws, extack);
>> if (ret)
>> module_put(ops->owner);
>> }
>> rcu_read_unlock();
>>
> Missed that.
>
> Once a reference is taken the rcu_read_lock can be dropped before
> calling build_state allowing the allocations to be GFP_KERNEL.
>
I don't think the rcu_read_lock can be dropped. The whole operation of the reference should be protect
in the rcu_read_lock that ensure the ops will not be destroy (if it will be)
next prev parent reply other threads:[~2019-02-22 15:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 3:00 [PATCH net-next v2] ip_tunnel: Add dst_cache management lwtunnel_state of ip tunnel wenxu
2019-02-22 3:39 ` David Ahern
2019-02-22 4:14 ` wenxu
2019-02-22 15:03 ` David Ahern
2019-02-22 15:21 ` wenxu [this message]
2019-02-22 22:16 ` David Ahern
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=8b96ffcb-fe29-1c49-a266-3e9d20b60d89@ucloud.cn \
--to=wenxu@ucloud.cn \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).