forked from raspberrypi/linux
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipc/msg: avoid waking sender upon full queue
Blocked tasks queued in q_senders waiting for their message to fit in the queue are blindly awoken every time we think there's a remote chance this might happen. This could cause numerous (and expensive -- thundering herd-ish) bogus wakeups if the queue is still really full. Adding to the scheduling cost/overhead, there's also the fact that we need to take the ipc object lock and requeue ourselves in the q_senders list. By keeping track of the blocked sender's message size, we can know previously if the wakeup ought to occur or not. Otherwise, to maintain the current wakeup order we just move it to the tail. This is exactly what occurs right now if the sender needs to go back to sleep. The case of EIDRM is left completely untouched, as we need to wakeup all the tasks, and shouldn't be playing games in the first place. This patch was seen to save on the 'msgctl10' ltp testcase ~15% in context switches (avg out of ten runs). Although these tests are really about functionality (as opposed to performance), is does show the direct benefits of the optimization. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/1469748819-19484-6-git-send-email-dave@stgolabs.net Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Manfred Spraul <manfred@colorfullife.com> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
- mesa-ci-2021-04-01-5.11
- mesa-ci-2021-02-17-5.11
- mesa-ci-2021-01-27-5.11rc5
- drm-vc4-next-2017-01-31
- drm-vc4-next-2016-12-09
- drm-vc4-next-2016-11-16
- drm-vc4-fixes-2017-01-23
- drm-next-2020-10-15
- cheza-pagetables-2020-09-04
- cheza-pagetables-2020-09-02
- bcm2835-soc-next-2019-10-15
- bcm2835-soc-next-2018-11-27
- bcm2835-soc-next-2017-08-24
- bcm2835-soc-next-2017-08-15
- bcm2835-maintainers-next-2019-10-15
- bcm2835-maintainers-next-2017-06-08
- bcm2835-maintainers-next-2017-03-21
- bcm2835-dt-next-fixes-2017-11-15
- bcm2835-dt-next-2019-10-15
- bcm2835-dt-next-2019-08-15
- bcm2835-dt-next-2019-06-01
- bcm2835-dt-next-2019-03-04
- bcm2835-dt-next-2019-02-01
- bcm2835-dt-next-2019-01-29
- bcm2835-dt-next-2018-11-27
- bcm2835-dt-next-2018-09-09
- bcm2835-dt-next-2018-07-03
- bcm2835-dt-next-2018-04-30
- bcm2835-dt-next-2018-03-13
- bcm2835-dt-next-2018-02-28
- bcm2835-dt-next-2017-12-19
- bcm2835-dt-next-2017-10-06
- bcm2835-dt-next-2017-08-15
- bcm2835-dt-next-2017-08-07
- bcm2835-dt-next-2017-06-12
- bcm2835-dt-next-2017-06-08
- bcm2835-dt-next-2017-03-30
- bcm2835-dt-next-2017-03-21
- bcm2835-dt-next-2017-01-31
- bcm2835-dt-next-2017-01-17
- bcm2835-dt-next-2016-11-18
- bcm2835-dt-fixes-2017-10-06
- bcm2835-dt-fixes-2017-05-16
- bcm2835-dt-64-next-2019-02-01
- bcm2835-dt-64-next-2019-01-29
- bcm2835-dt-64-next-2018-09-09
- bcm2835-dt-64-next-2017-06-08
- bcm2835-dt-64-next-2016-11-18
- bcm2835-drivers-next-2019-03-12
- bcm2835-drivers-next-2019-03-04
- bcm2835-drivers-next-2019-02-01
- bcm2835-drivers-next-2019-01-29
- bcm2835-drivers-next-2018-11-27
- bcm2835-drivers-next-2018-07-03
- bcm2835-drivers-next-2017-12-19
- bcm2835-defconfig-next-2019-08-15
- bcm2835-defconfig-next-2018-11-27
- bcm2835-defconfig-next-2018-09-09
- bcm2835-defconfig-next-2018-07-03
- bcm2835-defconfig-next-2018-04-30
- bcm2835-defconfig-next-2018-02-28
- bcm2835-defconfig-next-2017-08-07
- bcm2835-defconfig-next-2017-06-12
- bcm2835-defconfig-next-2017-03-21
- bcm2835-defconfig-next-2016-11-18
- bcm2835-defconfig-64-next-2019-08-15
- bcm2835-defconfig-64-next-2018-07-03
- bcm2835-defconfig-64-next-2018-04-30
- bcm2835-defconfig-64-next-2017-03-21
- bcm2835-defconfig-64-next-2016-11-18
Showing
1 changed file
with
43 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters