linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Tiny one-line fix to swap readahead
@ 1998-12-08 22:59 Stephen C. Tweedie
  1998-12-10 19:22 ` Stephen C. Tweedie
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen C. Tweedie @ 1998-12-08 22:59 UTC (permalink / raw)
  To: Alan Cox; +Cc: Stephen Tweedie, linux-mm, Rik van Riel

Hi,

I just noticed this when experimenting with a slightly different swapin
optimisation: swapping in entire 64k aligned blocks rather than doing
strict readahead.  A side effect was that a swapin in the first free
pages of the swap file tried to swapin the swap header, which is marked
SWAP_MAP_BAD.  This breaks.

Now the readahead code in Rik's own patches won't try to do this, but it
_will_ have the same problem if you ever readahead past a bad page in
the swap file.  The trick is to fix the test in mm/page_alloc.c,
function swapin_readahead:

	      if (!swapdev->swap_map[offset] ||
		  swapdev->swap_map[offset] == SWAP_MAP_BAD ||  <<<< new line
		  test_bit(offset, swapdev->swap_lockmap))
		      continue;

Sorry this isn't a diff, but my other changes to this file mean that I
don't have a patch handy against plain ac*.

--Stephen
--
This is a majordomo managed list.  To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-12-10 19:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-08 22:59 Tiny one-line fix to swap readahead Stephen C. Tweedie
1998-12-10 19:22 ` Stephen C. Tweedie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox