From: Eric Dumazet <dada1@cosmosbay.com>
To: David Howells <dhowells@redhat.com>
Cc: Nick Piggin <npiggin@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
Andi Kleen <ak@suse.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [patch] generic rwsems
Date: Fri, 13 Apr 2007 16:29:09 +0200 [thread overview]
Message-ID: <20070413162909.c436a732.dada1@cosmosbay.com> (raw)
In-Reply-To: <30644.1176471112@redhat.com>
On Fri, 13 Apr 2007 14:31:52 +0100
David Howells <dhowells@redhat.com> wrote:
> Break the counter down like this:
>
> 0x00000000 - not locked; queue empty
> 0x40000000 - locked by writer; queue empty
> 0xc0000000 - locket by writer; queue occupied
> 0x0nnnnnnn - n readers; queue empty
> 0x8nnnnnnn - n readers; queue occupied
If space considerations are that important, we could then reserve one bit for the 'wait_lock spinlock'
0x20000000 : one cpu gained control of 'wait_list'
This would save 4 bytes on 32 bit platforms.
64 bit platforms could have a limit of 2^60 threads, instead of the way too small 2^28 one ;)
(we loose the debug version of spinlock of course)
Another possibility to save space would be to move wait_lock/wait_list outside of rw_semaphore, in a hashed global array.
This would save 12/16 bytes per rw_semaphore (inode structs are probably the most demanding)
--
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>
next prev parent reply other threads:[~2007-04-13 14:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-13 10:04 Nick Piggin
2007-04-13 10:25 ` Nick Piggin
2007-04-13 10:53 ` Andi Kleen
2007-04-13 11:20 ` Nick Piggin
2007-04-13 11:44 ` David Howells
2007-04-13 12:13 ` Christoph Hellwig
2007-04-13 12:09 ` David Howells
2007-04-13 12:43 ` Nick Piggin
2007-04-13 13:22 ` William Lee Irwin III
2007-04-13 13:31 ` David Howells
2007-04-13 14:03 ` Nick Piggin
2007-04-13 14:29 ` Eric Dumazet [this message]
2007-04-13 14:49 ` David Howells
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=20070413162909.c436a732.dada1@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
--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