mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Low <jason.low2@hp.com>
To: peterz@infradead.org, torvalds@linux-foundation.org,
	paulmck@linux.vnet.ibm.com, mingo@kernel.org, Waiman.Long@hp.com,
	davidlohr@hp.com, linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, riel@redhat.com, rostedt@goodmis.org,
	akpm@linux-foundation.org, hpa@zytor.com,
	tim.c.chen@linux.intel.com, konrad.wilk@oracle.com, aswin@hp.com,
	scott.norton@hp.com, chegu_vinod@hp.com, jason.low2@hp.com
Subject: [PATCH 0/4] MCS spinlocks: Cancellable MCS spinlock rework
Date: Mon,  7 Jul 2014 11:50:15 -0700	[thread overview]
Message-ID: <1404759019-4268-1-git-send-email-jason.low2@hp.com> (raw)

The main purpose of this patchset is to reduce the size of the
cancellable MCS spinlock and reduce the overhead of rwsem
(currently the largest lock in the kernel).

The overhead of the cancellable MCS lock is a pointer to a per-cpu  node
structure which requires 64 bits on 64 bit systems. Instead of a pointer
to the per-cpu node, we can instead store the CPU # corresponding to the
node in atomic_t. This reduces the overhead by 32 bits on 64 bit systems.

This then opens the opportunity to reduce the size of the rw_semaphore
structure (one of the current users of this MCS lock) by moving around some
of its fields. Due to padding, we would reduce the size of that structure
by 64 bits (on 64 bit systems). This makes it more in line with the size
of the mutex structure.

Jason Low (4):
  MCS spinlocks: Rename optimistic_spin_queue to optimistic_spin_node
  MCS spinlocks: Convert osq lock to atomic_t to reduce overhead
  MCS spinlocks: Micro-optimize osq_unlock()
  rwsem: Reduce the size of struct rw_semaphore

 include/linux/mutex.h         |    4 +-
 include/linux/osq_lock.h      |   19 ++++++++++++
 include/linux/rwsem.h         |   11 +++----
 kernel/locking/mcs_spinlock.c |   62 ++++++++++++++++++++++++++++++----------
 kernel/locking/mcs_spinlock.h |    9 +++--
 kernel/locking/mutex.c        |    2 +-
 kernel/locking/rwsem-xadd.c   |    2 +-
 7 files changed, 79 insertions(+), 30 deletions(-)
 create mode 100644 include/linux/osq_lock.h


             reply	other threads:[~2014-07-07 18:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 18:50 Jason Low [this message]
2014-07-07 18:50 ` [PATCH 1/4] MCS spinlocks: Rename optimistic_spin_queue to optimistic_spin_node Jason Low
2014-07-07 18:50 ` [PATCH 2/4] MCS spinlocks: Convert osq lock to atomic_t to reduce overhead Jason Low
2014-07-08 13:38   ` Steven Rostedt
2014-07-08 16:44     ` Jason Low
2014-07-07 18:50 ` [PATCH 3/4] MCS spinlocks: Micro-optimize osq_unlock() Jason Low
2014-07-07 18:50 ` [PATCH 4/4] rwsem: Reduce the size of struct rw_semaphore Jason Low
2014-07-11  9:29   ` Peter Zijlstra
2014-07-07 19:06 ` [PATCH 0/4] MCS spinlocks: Cancellable MCS spinlock rework Peter Zijlstra

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=1404759019-4268-1-git-send-email-jason.low2@hp.com \
    --to=jason.low2@hp.com \
    --cc=Waiman.Long@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=aswin@hp.com \
    --cc=chegu_vinod@hp.com \
    --cc=davidlohr@hp.com \
    --cc=hpa@zytor.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=scott.norton@hp.com \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=torvalds@linux-foundation.org \
    /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®