From: Rusty Russell <rusty@rustcorp.com.au>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: page_launder() bug
Date: Wed, 09 May 2001 12:32:51 +1000 [thread overview]
Message-ID: <m14xJmW-001QgaC@mozart> (raw)
In-Reply-To: Your message of "Sun, 06 May 2001 21:55:26 MST." <15094.10942.592911.70443@pizda.ninka.net>
In message <15094.10942.592911.70443@pizda.ninka.net> you write:
>
> Jonathan Morton writes:
> > >- page_count(page) == (1 + !!page->buffers));
> >
> > Two inversions in a row?
>
> It is the most straightforward way to make a '1' or '0'
> integer from the NULL state of a pointer.
Overall, I'd have to say that this:
- dead_swap_page =
- (PageSwapCache(page) &&
- page_count(page) == (1 + !!page->buffers));
-
Is nicer as:
int dead_swap_page = 0;
if (PageSwapCache(page)
&& page_count(page) == (page->buffers ? 1 : 2))
dead_swap_page = 1;
After all, the second is what the code *means* (1 and 2 are magic
numbers).
That said, anyone who doesn't understand the former should probably
get some more C experience before commenting on others' code...
Rusty.
--
Premature optmztion is rt of all evl. --DK
--
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.eu.org/Linux-MM/
next prev parent reply other threads:[~2001-05-09 2:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-06 21:08 BERECZ Szabolcs
2001-05-06 21:59 ` Jonathan Morton
2001-05-06 22:07 ` BERECZ Szabolcs
2001-05-07 4:55 ` David S. Miller
2001-05-07 5:19 ` Aaron Lehmann
2001-05-07 6:26 ` Tobias Ringstrom
2001-05-07 8:54 ` David S. Miller
2001-05-07 15:12 ` Tobias Ringstrom
2001-05-07 10:52 ` Alan Cox
2001-05-07 13:49 ` Daniel Phillips
2001-05-07 14:52 ` Horst von Brand
2001-05-09 2:32 ` Rusty Russell [this message]
2001-05-09 3:36 ` Jonathan Morton
2001-05-09 8:43 ` Martin Dalecki
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=m14xJmW-001QgaC@mozart \
--to=rusty@rustcorp.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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