From: Eric Dumazet <dada1@cosmosbay.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Arjan van de Ven <arjan@infradead.org>,
paulmck@linux.vnet.ibm.com, dipankar@in.ibm.com,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Question about usage of RCU in the input layer
Date: Sat, 21 Mar 2009 10:13:38 +0100 [thread overview]
Message-ID: <49C4AFC2.500@cosmosbay.com> (raw)
In-Reply-To: <200903202246.15772.dmitry.torokhov@gmail.com>
Dmitry Torokhov a écrit :
> On Thursday 19 March 2009 20:20:32 Arjan van de Ven wrote:
>>> I don't claim to understand the code in question, so it is entirely
>>> possible that the following is irrelevant. But one other reason for
>>> synchronize_rcu() is:
>>>
>>> 1. Make change.
>>>
>>> 2. synchronize_rcu()
>>>
>>> 3. Now you are guaranteed that all CPUs/tasks/whatever
>>> currently running either are not messing with you on the one hand, or
>>> have seen the change on the other.
>> ok so this is for the case where someone is already iterating the list.
>>
>> I don't see anything in the code that assumes this..
>
> This is something that input core guarantees to its users: by the time
> input core calls hander->start() or, in its absence, by the time
> input_register_handle() returns, events from input drivers will be
> passed into the handle being registered, i.e. the presence of the
> new item in the list is noticed by all CPUs.
>
> Now, it is possible to stop using RCU primitives in the input core
> but I think that you'd want to figure out why synchronize_rcu()
> takes so long first, otheriwse you may find another "abuser"
> down the road.
>
If a cpu does a loop, it nearly impossible that synchronize_rcu() can
be fast.
We had same problem in ksoftirqd(), where I had to add a call
to rcu_qsctr_inc() to unblock other threads blocked in synchronize_rcu()
http://git2.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=64ca5ab913f1594ef316556e65f5eae63ff50cee
If a driver does a loop with no call to scheduler, it might have same problem
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-03-21 9:14 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-19 4:58 Question about usage of RCU in the input layer Arjan van de Ven
2009-03-19 7:23 ` Dmitry Torokhov
2009-03-19 14:02 ` Arjan van de Ven
2009-03-19 8:56 ` Dipankar Sarma
2009-03-19 14:18 ` Arjan van de Ven
2009-03-20 2:07 ` Paul E. McKenney
2009-03-20 3:20 ` Arjan van de Ven
2009-03-20 4:45 ` Paul E. McKenney
2009-03-20 5:28 ` Eric Dumazet
2009-03-20 6:01 ` Dipankar Sarma
2009-03-20 6:35 ` Eric Dumazet
2009-03-20 13:50 ` Arjan van de Ven
2009-03-20 14:31 ` Paul E. McKenney
2009-03-20 18:13 ` Arjan van de Ven
2009-03-21 1:27 ` Paul E. McKenney
2009-03-21 4:58 ` Arjan van de Ven
2009-03-21 18:58 ` Paul E. McKenney
2009-03-21 19:51 ` Arjan van de Ven
2009-03-21 20:26 ` Eric Dumazet
2009-03-21 21:07 ` Paul E. McKenney
2009-03-22 3:40 ` Arjan van de Ven
2009-03-22 4:38 ` Paul E. McKenney
2009-03-22 4:51 ` Arjan van de Ven
2009-03-22 5:18 ` Paul E. McKenney
2009-03-22 5:53 ` Arjan van de Ven
2009-03-22 16:53 ` Paul E. McKenney
2009-03-22 19:46 ` Arjan van de Ven
2009-03-22 20:52 ` Paul E. McKenney
2009-03-22 22:44 ` Arjan van de Ven
2009-03-22 23:03 ` Paul E. McKenney
2009-03-22 23:16 ` Arjan van de Ven
2009-03-23 1:27 ` Paul E. McKenney
2009-04-03 1:27 ` Paul E. McKenney
2009-03-21 21:13 ` Arjan van de Ven
2009-03-20 22:21 ` Paul E. McKenney
2009-03-21 5:46 ` Dmitry Torokhov
2009-03-21 9:13 ` Eric Dumazet [this message]
2009-03-21 18:58 ` Paul E. McKenney
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=49C4AFC2.500@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=arjan@infradead.org \
--cc=dipankar@in.ibm.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
/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).