From: Stephen Hemminger <shemminger@osdl.org>
To: Jarek Poplawski <jarkao2@o2.pl>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH] locking bug in fib_semantics.c
Date: Thu, 24 Aug 2006 07:18:16 -0700 [thread overview]
Message-ID: <44EDB528.9070005@osdl.org> (raw)
In-Reply-To: <44ED87CF.20702@o2.pl>
Jarek Poplawski wrote:
> On 23-08-2006 20:31, Stephen Hemminger wrote:
>> On Tue, 22 Aug 2006 12:35:56 +0200
>> Jarek Poplawski <jarkao2@o2.pl> wrote:
> ...
>>> I've found it at last but on that occasion I've got some
>>> doubt according to rcu_read_lock and rcu_call treatment:
>>> isn't it "illegal to block while in an RCU read-side
>>> section"? And I think it takes place in:
>>>
>>
>> No, it is perfectly okay for a cpu to acquire a lock
>> while in an RCU section, it just can't acquire a mutex/semaphore that
>> will put it to sleep. That is caught by the might_sleep() check.
>
> Then I've wrongly understood it can't sleep while in RCU
> and that enabled bh can make it sleep.
>
>>> fib_lookup(): from tb_insert (fn_hash_insert() or
>>> fn_trie_insert()), fib_create_info(), fib_check_nh()
>>> fn_trie_lookup(): like above, inet_addr_type(),
>>> tb_lookup()
>>>
>>> fib_rule_put(): like #1 above or #2 after tb_lookup(),
>>> fib_res_put()
>>>
>>> Shouldn't there be _bh also?
>>
>> fib_rule_put only does something if refcount == 1 in which
>> case it is safe.
>
> It's like above. I've thought (wrongly): fib_rule_put() calls
> call_rcu() and is made to sleep.
>
call_rcu() doesn't sleep, it schedules work in a later context. In that
way call_rcu()
is like other deferred work mechanism (tasklets, timers, workqueues).
prev parent reply other threads:[~2006-08-24 14:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-17 9:36 [PATCH] locking bug in fib_semantics.c Alexey Kuznetsov
2006-08-18 1:29 ` David Miller
2006-08-21 8:16 ` Jarek Poplawski
2006-08-21 8:17 ` David Miller
2006-08-21 11:02 ` Jarek Poplawski
2006-08-22 10:35 ` Jarek Poplawski
2006-08-23 6:34 ` Jarek Poplawski
2006-08-23 18:31 ` Stephen Hemminger
2006-08-24 11:04 ` Jarek Poplawski
2006-08-24 14:18 ` Stephen Hemminger [this message]
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=44EDB528.9070005@osdl.org \
--to=shemminger@osdl.org \
--cc=davem@davemloft.net \
--cc=jarkao2@o2.pl \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.