[lkml]   [2009]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] swap: send callback when swap slot is freed
On 08/13/2009 04:18 AM, Hugh Dickins wrote:
> On Wed, 12 Aug 2009, Nitin Gupta wrote:
>> Currently, we have "swap discard" mechanism which sends a discard bio request
>> when we find a free cluster during scan_swap_map(). This callback can come a
>> long time after swap slots are actually freed.
>> This delay in callback is a great problem when (compressed) RAM [1] is used
>> as a swap device. So, this change adds a callback which is called as
>> soon as a swap slot becomes free. For above mentioned case of swapping
>> over compressed RAM device, this is very useful since we can immediately
>> free memory allocated for this swap page.
>> This callback does not replace swap discard support. It is called with
>> swap_lock held, so it is meant to trigger action that finishes quickly.
>> However, swap discard is an I/O request and can be used for taking longer
>> actions.
>> Links:
>> [1]
> Please keep this with compcache for the moment (it has no other users).

Oh, I missed this one.

This small patch can be considered as first step for merging compcache
to mainline :) Actually, it requires callbacks for swapon, swapoff too
but that, I think, should be done in a separate patches.

BTW, last time compcache was not accepted due to lack of performance
numbers. Now the project has lot more data for various cases:
Still need to collect data for worst-case behaviors and such...


 \ /
  Last update: 2009-08-13 04:43    [W:0.172 / U:1.648 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site