[PATCH 0/3] ramzswap: Eliminate stale data from compressed memory (v2)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Nitin Gupta
Date: Friday, May 7, 2010 - 12:25 am

(tested on mainline but should apply to linux-next cleanly)

 * Changelog: v2 vs initial patches
   - directly add swap free callback to block_device_operations
     instead of using 'notifiers' for various swap events.

ramzswap driver creates RAM based block devices which can be
used (only) as swap disks. Pages swapped to these disks are
compressed and stored in memory itself.

However, these devices do not get any notification when a swap
slot is freed (swap_map[i] reaches 0). So, we cannot free memory
allocated corresponding to this swap slot. Such stale data can
quickly accumulate in (compressed) memory defeating the whole
purpose of such devices.

To overcome this problem, we now add a callback in struct
block_device_operations which is called as soon as a swap
slot is freed.

Nitin Gupta (3):
  Add flag to identify block swap devices
  Add swap slot free callback to block_device_operations
  ramzswap: Handler for swap slot free callback

 drivers/staging/ramzswap/TODO           |    5 -----
 drivers/staging/ramzswap/ramzswap_drv.c |   22 +++++++++++++---------
 include/linux/blkdev.h                  |    2 ++
 include/linux/swap.h                    |    1 +
 mm/swapfile.c                           |    5 +++++
 5 files changed, 21 insertions(+), 14 deletions(-)
 delete mode 100644 drivers/staging/ramzswap/TODO

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/3] ramzswap: Eliminate stale data from compressed ..., Nitin Gupta, (Fri May 7, 12:25 am)
[PATCH 1/3] Add flag to identify block swap devices, Nitin Gupta, (Fri May 7, 12:25 am)
Re: [PATCH 1/3] Add flag to identify block swap devices, Nigel Cunningham, (Fri May 7, 2:32 am)