diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2008-10-09 18:15:33 -0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 19:00:10 -0400 |
commit | 78236571a538860dc2f0842ff6c7789522eb1e63 (patch) | |
tree | 2d5d2d7aecc2350115b6155e7b2250ba10b832dd /lib | |
parent | 176707997bc3da2c4e32715c35cfebba0334ed68 (diff) |
rfkill: rate-limit rfkill-input workqueue usage (v3)
Limit the number of "expensive" rfkill workqueue operations per second, in
order to not hog system resources too much when faced with a rogue source
of rfkill input events.
The old rfkill-input code (before it was refactored) had such a limit in
place. It used to drop new events that were past the rate limit. This
behaviour was not implemented as an anti-DoS measure, but rather as an
attempt to work around deficiencies in input device drivers which would
issue multiple KEY_FOO events too soon for a given key FOO (i.e. ones that
do not implement mechanical debouncing properly).
However, we can't really expect such issues to be worked around by every
input handler out there, and also by every userspace client of input
devices. It is the input device driver's responsability to do debouncing
instead of spamming the input layer with bogus events.
The new limiter code is focused only on anti-DoS behaviour, and tries to
not lose events (instead, it coalesces them when possible).
The transmitters are updated once every 200ms, maximum. Care is taken not
to delay a request to _enter_ rfkill transmitter Emergency Power Off (EPO)
mode.
If mistriggered (e.g. by a jiffies counter wrap), the code delays processing
*once* by 200ms.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions