public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ramzswap: Eliminate stale data from compressed memory (v2 resend)
@ 2010-05-17  5:32 Nitin Gupta
  2010-05-17  5:32 ` [PATCH 1/3] Add flag to identify block swap devices Nitin Gupta
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Nitin Gupta @ 2010-05-17  5:32 UTC (permalink / raw)
  To: Greg KH
  Cc: Pekka Enberg, Linus Torvalds, Nigel Cunningham, Andrew Morton,
	Minchan Kim, Hugh Dickins, Cyp, driverdev, linux-kernel

Resending as Greg wanted.

(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


^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH 0/3] ramzswap: Eliminate stale data from compressed memory (v2)
@ 2010-05-07  7:25 Nitin Gupta
  2010-05-07  7:25 ` [PATCH 3/3] ramzswap: Handler for swap slot free callback Nitin Gupta
  0 siblings, 1 reply; 13+ messages in thread
From: Nitin Gupta @ 2010-05-07  7:25 UTC (permalink / raw)
  To: Greg KH
  Cc: Linus Torvalds, Pekka Enberg, Hugh Dickins, Cyp, Minchan Kim,
	Al Viro, Christoph Hellwig, Jens Axboe, Andi Kleen, Andrew Morton,
	driverdev, linux-kernel

(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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-05-18  3:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-17  5:32 [PATCH 0/3] ramzswap: Eliminate stale data from compressed memory (v2 resend) Nitin Gupta
2010-05-17  5:32 ` [PATCH 1/3] Add flag to identify block swap devices Nitin Gupta
2010-05-17 11:50   ` Minchan Kim
2010-05-17 19:35     ` Hugh Dickins
2010-05-17  5:32 ` [PATCH 2/3] Add swap slot free callback to block_device_operations Nitin Gupta
2010-05-17 12:01   ` Minchan Kim
2010-05-18  3:31     ` Nitin Gupta
2010-05-17  5:32 ` [PATCH 3/3] ramzswap: Handler for swap slot free callback Nitin Gupta
2010-05-17 12:03   ` Minchan Kim
2010-05-18  3:24     ` Nitin Gupta
2010-05-17  6:10 ` [PATCH 0/3] ramzswap: Eliminate stale data from compressed memory (v2 resend) Pekka Enberg
2010-05-17  8:45   ` Nitin Gupta
  -- strict thread matches above, loose matches on Subject: below --
2010-05-07  7:25 [PATCH 0/3] ramzswap: Eliminate stale data from compressed memory (v2) Nitin Gupta
2010-05-07  7:25 ` [PATCH 3/3] ramzswap: Handler for swap slot free callback Nitin Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox