Re: [PATCH] swsusp: separate swap-writing/reading code

From: Andrew Morton
Date: Thu Mar 23 2006 - 18:53:58 EST


"Rafael J. Wysocki" <rjw@xxxxxxx> wrote:
>
> > I guess I missed this one somehow. Using a bitmap for allocated swap is really
> > inefficient because the values are usually not fragmented much. Extents would
> > have been a far better choice.
>
> I agree it probably may be improved. Still it seems to be good enough. Further,
> it's more efficient than the previous solution, so I consider it as an improvement.
> Also this code has been tested for quite some time in -mm and appears to
> behave properly, at least we haven't got any bug reports related to it so far.

I think that temporarily allocating 1/32768th of total memory here is
reasonable, especially as it's not all allocated in a contiguous hunk.

> Currently I'm not working on any better solution. If you can provide any
> patches to implement one, please submit them, but I think they'll have to be
> tested for as long as this code, in -mm.

I was a little saddened by the open-coded approach. I'd expect that both
radix-trees and idr-trees could be used in this application. Probably the
former. (Radix-trees should have been designed from day one to store
`unsigned long's, not void*'s, so unless we change that, this application
will need to use typecasts when converting between void*'s and the stored
BITS_PER_LONG bitmaps).

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