linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Vitaly Wool <vitalywool@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>, Linux-MM <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Dan Streetman <ddstreet@ieee.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH/RFC] z3fold: use per-page read/write lock
Date: Mon, 7 Nov 2016 08:06:53 -0800	[thread overview]
Message-ID: <20161107160652.GJ26852@two.firstfloor.org> (raw)
In-Reply-To: <CAMJBoFNWV92c5B3HLJ=6wgNNUJFpTUgu3qf1mWgYxTEhfaA_LA@mail.gmail.com>

> I understand the reinvention part but you're not quite accurate here
> with the numbers.
> 
> E. g. on x86_64:
> (gdb) p sizeof(rwlock_t)
> $1 = 8

I was talking about spinlocks which are 4 bytes.  Just use a spinlock then. 
rwlocks are usually a bad idea anyways because they often scale far worse than
spinlocks due to the bad cache line bouncing behavior, and it doesn't
make much difference unless your critical section is very long.

-Andi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2016-11-07 16:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-05 13:49 [PATCH/RFC] z3fold: use per-page read/write lock Vitaly Wool
2016-11-05 23:38 ` Andi Kleen
2016-11-06  9:42   ` Vitaly Wool
2016-11-07 16:06     ` Andi Kleen [this message]
2016-11-10 19:38 ` 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=20161107160652.GJ26852@two.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=akpm@linux-foundation.org \
    --cc=ddstreet@ieee.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=vitalywool@gmail.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;
as well as URLs for NNTP newsgroup(s).