[PATCH 4/9] swap: Simplify shmem_unuse() usage [optional]

Richard Purdie rpurdie at openedhand.com
Fri Mar 2 11:54:35 EST 2007


On Fri, 2007-03-02 at 16:44 +0000, Hugh Dickins wrote:
> Definite NAK to this one from me: I'm sorry the optimization confuses
> you, but it's well commented at both ends, and speeds up shmem swapoff
> very significantly e.g. minutes down to seconds.  There may well be a
> less confusing way of achieving the same effect, with another return
> code from shmem_unuse, and some gotos, but I'm not all that keen.

Currently there is only one site its used in but with the changes, you
end up with two. My concern is that the behaviour of that function is
not obvious to anyone new to the code and I suspect something will get
broken at some point due to that, even if comments are there.

I'd have no problem with a different return code and some gotos and/or
improved logic. The changes these patches make might even make that
easier to implement. I'll take another look at it and see if I can find
a nicer patch.

> Your other patches, well, as ever I hope I'll get to look at them,
> but there are so many people, all much quicker than me, playing in
> mm these days...

I'm open to offers... :)

Cheers,

Richard






More information about the linux-mtd mailing list