lkml.org 
[lkml]   [2014]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -tip/master 7/7] Documentation: Update locking/mutex-design.txt disadvantages
From
Date
On Sun, 2014-07-27 at 22:18 -0700, Davidlohr Bueso wrote:
> Fortunately Jason was able to reduce some of the overhead we
> had introduced in the original rwsem optimistic spinning -
> an it is now the same size as mutexes. Update the documentation
> accordingly.
>
> Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
> ---
> Documentation/locking/mutex-design.txt | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/locking/mutex-design.txt b/Documentation/locking/mutex-design.txt
> index ee231ed..60c482d 100644
> --- a/Documentation/locking/mutex-design.txt
> +++ b/Documentation/locking/mutex-design.txt
> @@ -145,9 +145,9 @@ Disadvantages
>
> Unlike its original design and purpose, 'struct mutex' is larger than
> most locks in the kernel. E.g: on x86-64 it is 40 bytes, almost twice
> -as large as 'struct semaphore' (24 bytes) and 8 bytes shy of the
> -'struct rw_semaphore' variant. Larger structure sizes mean more CPU
> -cache and memory footprint.
> +as large as 'struct semaphore' (24 bytes) and tied, along with rwsems,

My suggestion here is for the above to say 'struct rw_semaphore' instead
of rwsems.

Acked-by: Jason Low <jason.low2@hp.com>

> +for the largest lock in the kernel. Larger structure sizes mean more
> +CPU cache and memory footprint.
>
> When to use mutexes
> -------------------




\
 
 \ /
  Last update: 2014-07-28 21:01    [W:0.166 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site