On Sun, Sep 05, 2004 at 10:58:07AM -0700, Linus Torvalds wrote: > > > On Sun, 5 Sep 2004, Arjan van de Ven wrote: > > > > well... we have a reverse mapping now. What is stopping us from doing > > physical defragmentation ? > > Nothing but replacement policy, really, and the fact that not everything > is rmappable. > > I think we should _normally_ honor replacement policy, the way we do now. yes it absolutely is quite a heavy hammer. However right now the alternative (free a LOT of memory and hope it collapses into higher order ones) is even heavier, freeing the wrong 8 pages is less of a disturbance than freeing 8000 of the mostly wrong pages ;) I absolutely agree this heavy hammer only should trigger if there is a request for a higher order page that isn't there. Doing it from a special thread does make sense, makes it relatively easy to keep track of such wakeups and more importantly rate limit them etc.