From: Linus Torvalds <torvalds@transmeta.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Linux Kernel List <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org, Marcelo Tosatti <marcelo@conectiva.com.br>,
Rik van Riel <riel@conectiva.com.br>,
Szabolcs Szakacsits <szaka@f-secure.com>
Subject: Re: [patch] swap-speedup-2.4.3-B3
Date: Tue, 24 Apr 2001 09:38:08 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.21.0104240932570.15791-100000@penguin.transmeta.com> (raw)
In-Reply-To: <Pine.LNX.4.30.0104240714200.1227-100000@elte.hu>
On Tue, 24 Apr 2001, Ingo Molnar wrote:
>
> the latest swap-speedup patch can be found at:
Please don't add more of those horrible "wait" arguments.
Make two different versions of a function instead. It's going to clean up
and simplify the code, and there really isn't any reason to do what you're
doing.
You should split up the logic differently: if you want to wait for the
page, then DO so:
page = lookup_swap_cache(..);
if (page) {
wait_for_swap_cache:valid(page);
.. use page ..
}
Note how much more readable and UNDERSTANDABLE the above is, compared to
page = lookup_swap_cache(..., 1);
if (page) {
...
and note also how splitting up the waiting will
- simplify the swap cache lookup function, making it faster for people
who do _NOT_ want to wait.
- make it easier to statically check the correctness of programs by just
eye-balling them ("Hey, he's calling 'wait' with the spinlock held").
- more easily moving the wait around, allowing for more concurrency.
Basically, I don't want to mix synchronous and asynchronous
interfaces. Everything should be asynchronous by default, and waiting
should be explicit.
Linus
--
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-04-24 16:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-23 9:20 [patch] swap-speedup-2.4.3-A1, massive swapping speedup Ingo Molnar
2001-04-23 15:33 ` Rik van Riel
2001-04-23 16:05 ` [patch] swap-speedup-2.4.3-A2 Ingo Molnar
2001-04-23 17:17 ` Linus Torvalds
2001-04-23 16:54 ` Ingo Molnar
2001-04-24 5:44 ` [patch] swap-speedup-2.4.3-B3 Ingo Molnar
2001-04-24 16:38 ` Linus Torvalds [this message]
2001-04-25 2:28 ` Marcelo Tosatti
2001-04-23 16:53 ` [patch] swap-speedup-2.4.3-A1, massive swapping speedup Jonathan Morton
2001-04-23 17:10 ` Linus Torvalds
2001-04-23 22:13 ` Marcelo Tosatti
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=Pine.LNX.4.21.0104240932570.15791-100000@penguin.transmeta.com \
--to=torvalds@transmeta.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=marcelo@conectiva.com.br \
--cc=mingo@elte.hu \
--cc=riel@conectiva.com.br \
--cc=szaka@f-secure.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