From: Manfred Spraul <manfred@colorfullife.com>
To: LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Chris Mason <chris.mason@oracle.com>,
Zach Brown <zach.brown@oracle.com>,
Jens Axboe <jens.axboe@oracle.com>, Nick Piggin <npiggin@suse.de>,
Manfred Spraul <manfred@colorfullife.com>
Subject: [PATCH 0/3] ipc/sem.c: Optimization for reducing spinlock contention
Date: Wed, 28 Apr 2010 21:06:25 +0200 [thread overview]
Message-ID: <1272481588-1941-1-git-send-email-manfred@colorfullife.com> (raw)
Hi,
I've cleaned up the patches I sent a week ago:
- they pass now checkpatch.pl
- some comments updated/added
- a bug with semctl(,,SETALL,) is fixed
- tested against LTP
Andrew: Could you add them the next -mm?
The following series of patches tries to fix the spinlock contention
reported by Chris Manson: His benchmark exposes problems of the current
code:
- In the worst case, the algorithm used by update_queue() is O(N^2).
Bulk wake-up calls can enter this worst case.
The patch series fix that.
Note that the benchmark app doesn't expose the problem, it just should
be fixed: Real world apps might do the wake-ups in another order
than perfect FIFO.
- The part of the code that runs within the semaphore array spinlock
is significantly larger than necessary.
The patch series fixes that. This change is responsible for the
main improvement.
- The cacheline with the spinlock is also used for a variable that
is read in the hot path (sem_base) and for a variable that is
unnecessarily written to multiple times (sem_otime).
The last step of the series cacheline-aligns the spinlock.
--
Manfred
next reply other threads:[~2010-04-28 19:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-28 19:06 Manfred Spraul [this message]
2010-04-28 19:06 ` [PATCH 1/2] ipc/sem.c: Optimize update_queue() for bulk wakeup calls Manfred Spraul
2010-04-28 19:06 ` [PATCH 2/2] ipc/sem.c: move wake_up_process out of the spinlock section Manfred Spraul
2010-04-28 19:06 ` [PATCH 3/3] [PATCH] ipc/sem.c: cacheline align the ipc spinlock for semaphores Manfred Spraul
2010-05-11 21:21 ` [PATCH 2/2] ipc/sem.c: move wake_up_process out of the spinlock section Andrew Morton
2010-05-12 17:34 ` Manfred Spraul
2010-05-12 18:18 ` Manfred Spraul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1272481588-1941-1-git-send-email-manfred@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=akpm@linux-foundation.org \
--cc=chris.mason@oracle.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@suse.de \
--cc=zach.brown@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®