Re: 2.4.14 + Bug in swap_out.

From: Hugh Dickins (hugh@veritas.com)
Date: Wed Nov 21 2001 - 10:34:46 EST


On Wed, 21 Nov 2001, Rik van Riel wrote:
> On 21 Nov 2001, Eric W. Biederman wrote:
>
> > We only hold a ref count for the duration of swap_out_mm.
> > Not for the duration of the value in swap_mm.

Exactly.

> In that case, why can't we just take the next mm from
> init_mm and just "roll over" our mm to the back of the
> list once we're done with it ?

No. That's how it used to be, that's what I changed it from.

fork and exec are well ordered in how they add to the mmlist,
and that ordering (children after parent) suited swapoff nicely,
to minimize duplication of a swapent while it's being unused;
except swap_out randomized the order by cycling init_mm around it.

I agree that mmput would look nicer without the reference to swap_mm.
If you want to make a change here, I'd suggest replacing swap_mm
pointer by full dummy marker swap_mm, then mmput wouldn't need to
worry about it at all.

I didn't do it that way because I couldn't see where to initialize
the swap_mm structure without touching each architecture separately;
and I also wondered if there might be some stats gathering utility
out there which would get confused by finding a non-mm in the mmlist.

Hugh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Nov 23 2001 - 21:00:27 EST