[linux-mm-cc] [PATCH 2/4] send callback when swap slot is freed

Hugh Dickins hugh.dickins at tiscali.co.uk
Mon Sep 21 07:17:48 EDT 2009

On Sun, 20 Sep 2009, Nitin Gupta wrote:
> Ok, lets discard all this.

I think we don't have the right infrastructure even for discard yet ;)

> I will soon start working on a generic notifier based
> interface for various swap events: swapon, swapoff, swap slot free that I hope would
> be more acceptable. I will now surely miss this merge window but I hope the end result
> would be better.

Don't worry about missing the merge window, I think it was already missed.
But beware of overdesign: who will be using these notifiers than you?

That's a rhetorical question: I just don't want you expending your time
on something fancy, then see it rejected next time around.  If you can
convince that what you come up with will be generally useful, great,
it'll go in; but I'm not interested in window dressing.

> The issue of swap_lock is still bugging me but I think atomic notifier list should
> be acceptable for swap slot free event, at least for the initial revision. If this
> particular event finds more users then we will have to work on reducing contention
> on swap_lock (per-swap file lock?).

The swap_lock in swap_free is troubling, and argues strongly against
pretending a general interface; but I quite understand your difficulty
in doing without it, it was awkward when I tried to discard near there.


More information about the linux-mm-cc mailing list