From: Andrea Arcangeli <andrea@suse.de>
To: William Lee Irwin III <wli@holomorphy.com>,
linux-kernel@vger.kernel.org, riel@surriel.com,
hch@infradead.org, phillips@bonn-fries.net
Subject: Re: 2.4.19pre2aa1
Date: Fri, 8 Mar 2002 01:11:45 +0100 [thread overview]
Message-ID: <20020308011145.A1356@dualathlon.random> (raw)
In-Reply-To: <20020307092119.A25470@dualathlon.random> <20020307104942.GC786@holomorphy.com> <20020307180300.B25470@dualathlon.random> <20020307201819.GF786@holomorphy.com>
In-Reply-To: <20020307201819.GF786@holomorphy.com>
On Thu, Mar 07, 2002 at 12:18:19PM -0800, William Lee Irwin III wrote:
> On Thu, Mar 07, 2002 at 06:03:00PM +0100, Andrea Arcangeli wrote:
> > For the other points I think you shouldn't really complain (both at
> > runtime and in code style as well, please see how clean it is with the
> > wait_table_t thing), I made a definitive improvement to your code, the
> > only not obvious part is the hashfn but I really cannot see yours
> > beating mine because of the total random input, infact it could be the
> > other way around due the fact if something there's the probability the
> > pages are physically consecutive and I take care of that fine.
>
>
> I don't know whose definition of clean code this is:
>
> +static inline wait_queue_head_t * wait_table_hashfn(struct page * page, wait_table_t * wait_table)
> +{
> +#define i (((unsigned long) page)/(sizeof(struct page) & ~ (sizeof(struct page) - 1)))
> +#define s(x) ((x)+((x)>>wait_table->shift))
> + return wait_table->head + (s(i) & (wait_table->size-1));
> +#undef i
> +#undef s
> +}
>
>
> I'm not sure I want to find out.
The above is again the hashfunction, the hashfn code doesn't need to be
nice, the API around wait_table_hashfn has to instead. See the above
wait_table_t typedef.
During some further auditing I also noticed now that you introduced
a certain usused wake_up_page. That's buggy, if you use it you'll
deadlock. Also it would be cleaner if __lock_page wasn't using the
exclusive waitqueue and that in turn you would keep using wake_up for
unlock_page. By the time you share the waitqueue nothing can be wake one
any longer, this is probably the worst drawback of the wait_table
memory-saving patch. Infact I was considering to solve the collisions
with additional memory, rather than by having to drop the wake-one
behaviour when many threads are working on the same chunk of the file
that your design solution requires. quite frankly I don't think this was
an urgent thing to change in 2.4 (it only saves some memory and even if
64G will now boot with CONFIG_1G, the lowmem will be way too much
unbalanced to be good for general purpose).
Andrea
next prev parent reply other threads:[~2002-03-08 0:12 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-07 8:21 2.4.19pre2aa1 Andrea Arcangeli
2002-03-07 10:49 ` 2.4.19pre2aa1 William Lee Irwin III
2002-03-07 11:27 ` 2.4.19pre2aa1 Daniel Phillips
2002-03-07 11:47 ` 2.4.19pre2aa1 William Lee Irwin III
2002-03-07 11:46 ` 2.4.19pre2aa1 Daniel Phillips
2002-03-07 17:03 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-07 20:18 ` 2.4.19pre2aa1 William Lee Irwin III
2002-03-07 20:38 ` 2.4.19pre2aa1 Richard B. Johnson
2002-03-08 0:22 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-08 0:26 ` 2.4.19pre2aa1 Rik van Riel
2002-03-08 0:11 ` Andrea Arcangeli [this message]
2002-03-07 11:34 ` 2.4.19pre2aa1 Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2002-03-08 2:40 2.4.19pre2aa1 rwhron
2002-03-12 4:19 2.4.19pre2aa1 wli
2002-03-12 5:31 ` 2.4.19pre2aa1 wli
2002-03-12 6:36 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-12 6:06 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-12 10:46 ` 2.4.19pre2aa1 Rik van Riel
2002-03-12 11:47 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-12 11:48 ` 2.4.19pre2aa1 wli
2002-03-12 12:21 ` 2.4.19pre2aa1 Daniel Phillips
2002-03-12 14:25 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-12 14:32 ` 2.4.19pre2aa1 Daniel Phillips
2002-03-15 17:20 ` 2.4.19pre2aa1 Horst von Brand
2002-03-15 16:43 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-12 11:29 ` 2.4.19pre2aa1 wli
2002-03-12 12:56 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-12 13:20 ` 2.4.19pre2aa1 Rik van Riel
2002-03-12 13:33 ` 2.4.19pre2aa1 Richard B. Johnson
2002-03-12 14:17 ` 2.4.19pre2aa1 wli
2002-03-12 14:30 ` 2.4.19pre2aa1 Richard B. Johnson
2002-03-13 2:18 ` 2.4.19pre2aa1 wli
2002-03-13 19:06 ` 2.4.19pre2aa1 Richard B. Johnson
2002-03-13 22:10 ` 2.4.19pre2aa1 wli
2002-03-14 12:18 ` 2.4.19pre2aa1 Richard B. Johnson
2002-03-14 12:47 ` 2.4.19pre2aa1 Daniel Phillips
2002-03-14 13:59 ` 2.4.19pre2aa1 Rik van Riel
2002-03-14 14:02 ` 2.4.19pre2aa1 Daniel Phillips
2002-03-12 14:14 ` 2.4.19pre2aa1 wli
2002-03-12 15:04 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-12 23:31 ` 2.4.19pre2aa1 wli
2002-03-13 0:09 ` 2.4.19pre2aa1 Andrew Morton
2002-03-13 1:06 ` 2.4.19pre2aa1 wli
2002-03-13 1:24 ` 2.4.19pre2aa1 Andrew Morton
2002-03-13 7:37 ` 2.4.19pre2aa1 Daniel Phillips
2002-03-13 7:30 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-13 7:55 ` 2.4.19pre2aa1 Andrew Morton
2002-03-13 8:06 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-13 10:57 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-13 13:51 ` 2.4.19pre2aa1 Rik van Riel
2002-03-13 14:03 ` 2.4.19pre2aa1 Andrea Arcangeli
2002-03-13 19:19 ` 2.4.19pre2aa1 Andrew Morton
2002-03-13 8:12 ` 2.4.19pre2aa1 Daniel Phillips
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=20020308011145.A1356@dualathlon.random \
--to=andrea@suse.de \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=phillips@bonn-fries.net \
--cc=riel@surriel.com \
--cc=wli@holomorphy.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.