From: Jamie Lokier <jamie@shareable.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Hugh Dickins <hugh@veritas.com>,
Ulrich Drepper <drepper@redhat.com>,
Jamie Lokier <lk@tantalophile.demon.co.uk>,
Andrew Morton <akpm@osdl.org>,
Stephen Hemminger <shemminger@osdl.org>,
torvalds@transmeta.com,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Re: today's futex changes
Date: Mon, 8 Sep 2003 18:51:40 +0100 [thread overview]
Message-ID: <20030908175140.GC27097@mail.jlokier.co.uk> (raw)
In-Reply-To: <20030908102309.0AC4E2C013@lists.samba.org>
Rusty Russell wrote:
> + u32 hash = jhash2((u32*)&key->both.word,
Have you checked the code size?
That does more work and has more code than is needed, especially on
32-bit archs. On 32-bit, jhash_3words() is much better because it
reduces to a single call to __jhash_mix(), instead of the two done by
jhash2 (only one is required for good hashing afaict).
It is probably worth adding a jhash_3longs() to jhash.h, which does
one call to __hash_mix() on 32-bit, two calls on 64-bit, and avoids
the loop in both cases.
[ Aside: For hashing individual integers, I prefer to use Thomas Wang's:
http://www.concentric.net/~Ttwang/tech/inthash.htm
He mentions Jenkin's function, and derived an integer mixing function
from correspondence with Jenkins.
For hashing 3 words together, Jenkins' hash does seem a bit more
compact - if you don't call __jhash_mix() multiple times that is! ]
> - if (unlikely((vma->vm_flags & (VM_IO|VM_READ)) != VM_READ))
> - return (vma->vm_flags & VM_IO) ? -EPERM : -EACCES;
> + if (unlikely(vma->vm_flags & VM_IO))
> + return -EPERM;
> + if (unlikely(vma->vm_flags & (VM_READ|VM_WRITE)) != (VM_READ|VM_WRITE))
> + return -EACCES;
Is there a good reason to disallow read-only waiters?
I agree with Hugh that it seems like a regression.
> + /* A spurious wakeup. Should never happen. */
> + BUG();
:)
The rest of your changes seem fine. I particularly appreciate your
grammatical improvements to my comment :)
-- Jamie
next prev parent reply other threads:[~2003-09-08 17:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-05 20:24 Ulrich Drepper
2003-09-05 22:24 ` Stephen Hemminger
2003-09-06 16:28 ` [PATCH] " Hugh Dickins
2003-09-06 17:32 ` Ulrich Drepper
2003-09-06 17:44 ` Jamie Lokier
2003-09-06 17:46 ` Jamie Lokier
2003-09-06 18:21 ` Hugh Dickins
2003-09-08 6:45 ` Rusty Russell
2003-09-08 17:33 ` Hugh Dickins
2003-09-08 17:51 ` Hugh Dickins
2003-09-09 1:37 ` Rusty Russell
2003-09-08 17:51 ` Jamie Lokier [this message]
2003-09-08 18:26 ` Jamie Lokier
2003-09-09 3:58 ` Rusty Russell
2003-09-10 11:39 ` Jamie Lokier
2003-09-10 22:00 ` Rusty Russell
2003-09-11 16:29 ` Jamie Lokier
2003-09-08 19:02 ` Andrew Morton
2003-09-08 20:07 ` Jamie Lokier
2003-09-08 19:59 ` Andrew Morton
2003-09-08 20:11 ` Linus Torvalds
2003-09-09 4:12 ` Rusty Russell
2003-09-08 17:04 ` Stephen Hemminger
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=20030908175140.GC27097@mail.jlokier.co.uk \
--to=jamie@shareable.org \
--cc=akpm@osdl.org \
--cc=drepper@redhat.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lk@tantalophile.demon.co.uk \
--cc=rusty@rustcorp.com.au \
--cc=shemminger@osdl.org \
--cc=torvalds@transmeta.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
all inboxes | Powered by JetHome®