lkml.org 
[lkml]   [2019]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 10/16] locking/rwsem: Wake up almost all readers in wait queue
On Sat, 13 Apr 2019, Waiman Long wrote:
>+/*
>+ * We limit the maximum number of readers that can be woken up for a
>+ * wake-up call to not penalizing the waking thread for spending too
>+ * much time doing it.
>+ */
>+#define MAX_READERS_WAKEUP 0x100

Although with wake_q this is not really so... Could it at least be
rewritten, dunno something like so:

/*
* Magic number to batch-wakeup waiting readers, even when writers
* are also present in the queue. This both limits the amount of
* work the waking thread must do (albeit wake_q) and also prevents
* any potential counter overflow, however unlikely.
*/

I'm still not crazy about this artificial limit for the readers-only
case, but won't argue. I certainly like the reader/writer case.

Thanks,
Davidlohr

\
 
 \ /
  Last update: 2019-04-16 18:51    [W:0.397 / U:3.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site