mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@cam.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Roman Zippel <zippel@linux-m68k.org>,
	hch@infradead.org, alan@lxorguk.ukuu.org.uk, arjan@infradead.org,
	mingo@elte.hu, lkml <linux-kernel@vger.kernel.org>,
	torvalds@osdl.org, arjanv@infradead.org, jes@trained-monkey.org,
	zwane@arm.linux.org.uk, oleg@tv-sign.ru, dhowells@redhat.com,
	bcrl@kvack.org, rostedt@goodmis.org, ak@suse.de,
	rmk+lkml@arm.linux.org.uk
Subject: Re: [patch 0/9] mutex subsystem, -V4
Date: Mon, 26 Dec 2005 10:29:50 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0512261011060.14654@localhost.localdomain> (raw)
In-Reply-To: <20051225150445.0eae9dd7.akpm@osdl.org>

On Sun, 25 Dec 2005, Andrew Morton wrote:

> Ingo has told me offline that he thinks that we can indeed remove the
> current semaphore implementation.
> 
> 90% of existing semaphore users get migrated to mutexes.
> 
> 9% of current semaphore users get migrated to completions.
> 
> The remaining 1% of semaphore users are using the counting feature.  We
> reimplement that in a mostly-arch-independent fashion and then remove the
> current semaphore implementation.  Note that there are no sequencing
> dependencies in all the above.

Great!  I'm glad you're amenable to such changes.  Especially the 
"remove the current semaphore implementation" part many people are 
complaining about for all sorts of reasons.

> Another example: Ingo's VFS stresstest which is hitting i_sem hard: it only
> does ~8000 ops/sec on an 8-way, and it's an artificial microbenchmark which
> is _designed_ to hit that lock hard.  So if/when i_sem is converted to a
> mutex, I figure that the benefits to ARM in that workload will be about a
> 0.01% performance increase.  ie: about two hours' worth of Moore's law in a
> dopey microbenchmark.

There is not only the question of cycles.  There is also kernel text 
size.  And _that_ is significant.  You could argue that only adding a 
function call for every mutex lock/unlock cannot be made smaller.  
However on ARM a function call is quite a costly operation with frame 
pointers, (and frame pointers are on by default on ARM otherwise the 
kernel is undebuggable).  So given that current semaphore fast path is 
inlined to save on the function call overhead, and given that on ARM the 
transition from semaphores to mutexes will shrink that from 8 
instruction down to 3 instructions, or even 2 instructions in some 
cases, will not only save cycles, but a bunch of kernel .text bytes as 
well without compromize on the cycle count.  This is therefore an all 
win situation for ARM.

> Also, there's very little point in adding lots of tricky arch-dependent
> code and generally mucking up the kernel source to squeeze the last drop of
> performance out of the sleeping lock fastpath.  Because if those changes
> actually make a difference, we've already lost - the code needs to be
> changed to use spinlocking.

Consider my text size argument above which is something I believe you 
value more.


Nicolas

  parent reply	other threads:[~2005-12-26 15:29 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-22 11:41 Ingo Molnar
2005-12-22 11:53 ` Christoph Hellwig
2005-12-22 12:45   ` Ingo Molnar
2005-12-22 15:34   ` Nicolas Pitre
2005-12-22 15:40     ` Ingo Molnar
2005-12-22 16:32       ` Nicolas Pitre
2005-12-22 16:44         ` Ingo Molnar
2005-12-22 16:58           ` Russell King
2005-12-22 21:04             ` Ingo Molnar
2005-12-22 21:26               ` Russell King
2005-12-22 21:27               ` Nicolas Pitre
2005-12-22 21:37                 ` [patch 1/2] mutex subsystem: basic per arch fast path primitives Nicolas Pitre
2005-12-22 21:53                   ` Christoph Hellwig
2005-12-22 21:40                 ` [patch 2/2] mutex subsystem: use the per architecture fast path lock_unlock defines Nicolas Pitre
2005-12-22 21:54                 ` [patch 0/9] mutex subsystem, -V4 Ingo Molnar
2005-12-22 16:58           ` Nicolas Pitre
2005-12-22 17:20     ` Christoph Hellwig
2005-12-22 17:33     ` Steven Rostedt
2005-12-22 18:24       ` Nicolas Pitre
2005-12-22 11:54 ` Andrew Morton
2005-12-22 12:20   ` Ingo Molnar
2005-12-22 13:07     ` Andrew Morton
2005-12-22 13:23       ` Arjan van de Ven
2005-12-22 13:44         ` Andrew Morton
2005-12-22 14:11           ` Alan Cox
2005-12-22 23:30             ` Andrew Morton
2005-12-22 23:34               ` Christoph Hellwig
     [not found]                 ` <32801.10.10.10.28.1135295357.squirrel@linux1>
2005-12-22 23:49                   ` Sean
2005-12-22 23:53                     ` Randy.Dunlap
     [not found]                       ` <50572.10.10.10.28.1135296023.squirrel@linux1>
2005-12-23  0:00                         ` Sean
2005-12-23  0:00                       ` Steven Rostedt
     [not found]                 ` <20051222221311.2f6056ec.akpm@osdl.org>
2005-12-23 14:24                   ` Nicolas Pitre
2005-12-23 14:51                     ` Andrew Morton
2005-12-23 14:57                       ` Russell King
2005-12-23 15:04                         ` Xavier Bestel
2005-12-23 15:27                           ` Andrew Morton
2005-12-23 15:00                       ` Steven Rostedt
2006-01-03 17:54                       ` Abhijit Bhopatkar
2005-12-25 16:08                 ` Roman Zippel
2005-12-25 22:54                   ` Ingo Molnar
2005-12-26 21:49                     ` Roman Zippel
2005-12-25 23:04                   ` Andrew Morton
2005-12-25 23:22                     ` Ingo Molnar
2005-12-26 10:35                       ` Andrew Morton
2005-12-26 10:42                         ` Arjan van de Ven
2005-12-26 11:11                           ` Andrew Morton
2005-12-26 17:15                             ` Mike Galbraith
2005-12-26 17:44                               ` Lee Revell
2005-12-27  0:32                             ` David Lang
2005-12-26 18:15                           ` Linus Torvalds
2005-12-27 14:42                         ` Ingo Molnar
2005-12-27 23:02                           ` Andrew Morton
2005-12-26  0:33                     ` Moore's law (was Re: [patch 0/9] mutex subsystem, -V4) Pavel Machek
2006-01-05 15:30                       ` Andi Kleen
2006-01-05 19:08                         ` Pavel Machek
2005-12-26 15:29                     ` Nicolas Pitre [this message]
2005-12-22 15:46           ` [patch 0/9] mutex subsystem, -V4 Thomas Gleixner
2005-12-22 17:40             ` Linus Torvalds
2005-12-22 20:09               ` Steven Rostedt
2005-12-22 17:17           ` Christoph Hellwig
2005-12-22 15:19       ` Nicolas Pitre
2005-12-22 21:43       ` Paul Mackerras

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=Pine.LNX.4.64.0512261011060.14654@localhost.localdomain \
    --to=nico@cam.org \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=arjanv@infradead.org \
    --cc=bcrl@kvack.org \
    --cc=dhowells@redhat.com \
    --cc=hch@infradead.org \
    --cc=jes@trained-monkey.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@tv-sign.ru \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@osdl.org \
    --cc=zippel@linux-m68k.org \
    --cc=zwane@arm.linux.org.uk \
    /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®