[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190416165038.xfjserwdhli6p222@linux-r8p5>
Date: Tue, 16 Apr 2019 09:50:38 -0700
From: Davidlohr Bueso <dave@...olabs.net>
To: Waiman Long <longman@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Will Deacon <will.deacon@....com>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org, x86@...nel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Tim Chen <tim.c.chen@...ux.intel.com>,
huang ying <huang.ying.caritas@...il.com>
Subject: Re: [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
Powered by blists - more mailing lists