Re: [PATCH 1/3] input: evdev: use multi-reader buffer to save space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dmitry,

> On Fri, May 28, 2010 at 05:10:32PM +0200, Henrik Rydberg wrote:
>> In preparation of larger buffer needs, convert the current per-client
>> circular buffer to a single buffer with multiple clients. Since there
>> is only one writer but potentially many readers, use the somewhat
>> discouraged rwlock_t pattern.
> 
> rwlock is completely unsuitable here:
> 
> 1. You must absiolutely not starve writers since they are quite likely
> are interrupt handlers. If anything they should get priority.

Thanks, I overlooked the starvation argument here.

> 2. The amount of time the thing is locked is very miniscule, I'd say
> that regular spinlocks will still give better performance.

I still have a feeling it should be possible to do this lock-less, but I can see
all docs and your comments pointing towards using the spinlock, so consider it
changed.

> 
> Also, use of atomic is funky, I do not think it does whta you think it
> would... Could you explain more why you are using it?

The use of atomic here serves a declarative purpose, I imagine the assembly code
is more or less identical to the current evdev code. I personally think it is
good to be able to see which variables are involved in a thread-to-thread
exchange. Removing it is not a problem. Is it just me being an old fart, not
understanding that the atomic int has been assumed for the last half decade, or
why is it considered funky?

Cheers,
Henrik

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux