linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/3] make vm aware of zram-swap
@ 2014-09-04  1:39 Minchan Kim
  2014-09-04  1:39 ` [RFC 1/3] zram: generalize swap_slot_free_notify Minchan Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Minchan Kim @ 2014-09-04  1:39 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, linux-mm, Hugh Dickins, Shaohua Li,
	Jerome Marchand, Sergey Senozhatsky, Dan Streetman, Nitin Gupta,
	Luigi Semenzato, Minchan Kim

VM uses nr_swap_pages as one of information when it reclaims
anonymous page because nr_swap_pages means how many freeable
space in swap so VM is able to throttle swap out if it found
there is no more space in swap.

But for zram-swap, there is size gap between virtual disksize
and physical memory to be able to store compressed memory so
nr_swap_pages is not correct parameter to throttle swap.

It causes endless anonymous reclaim(ie, swapout) even if there
is no free space in zram-swap so it makes system unresponsive.

This patch adds new hint SWAP_GET_FREE so zram can return how
many of freeable space to VM. With using that, VM can know whether
zram is full and substract remained freeable space from
nr_swap_pages to make it less than 0. IOW, from now on, VM sees
there is no more space of zram so that it will stop anonymous
reclaiming until swap_entry_free free a page which increases
nr_swap_pages again.

With this patch, user will see OOM when zram-swap is full
instead of hang with no response.

Minchan Kim (3):
  zram: generalize swap_slot_free_notify
  mm: add swap_get_free hint for zram
  zram: add swap_get_free hint

 Documentation/filesystems/Locking |  7 ++----
 drivers/block/zram/zram_drv.c     | 36 +++++++++++++++++++++++++--
 include/linux/blkdev.h            |  8 ++++--
 mm/page_io.c                      |  7 +++---
 mm/swapfile.c                     | 52 +++++++++++++++++++++++++++++++++++----
 5 files changed, 93 insertions(+), 17 deletions(-)

-- 
2.0.0


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

end of thread, other threads:[~2014-09-19  6:14 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-04  1:39 [RFC 0/3] make vm aware of zram-swap Minchan Kim
2014-09-04  1:39 ` [RFC 1/3] zram: generalize swap_slot_free_notify Minchan Kim
2014-09-04  1:39 ` [RFC 2/3] mm: add swap_get_free hint for zram Minchan Kim
2014-09-13 19:01   ` Dan Streetman
2014-09-15  0:30     ` Minchan Kim
2014-09-15 14:53       ` Dan Streetman
2014-09-16  0:33         ` Minchan Kim
2014-09-16 15:09           ` Dan Streetman
2014-09-17  7:14             ` Minchan Kim
2014-09-04  1:39 ` [RFC 3/3] zram: add swap_get_free hint Minchan Kim
2014-09-04  6:26   ` Heesub Shin
2014-09-04 23:59     ` Minchan Kim
2014-09-13 19:39       ` Dan Streetman
2014-09-15  0:57         ` Minchan Kim
2014-09-15 16:00           ` Dan Streetman
2014-09-16  1:21             ` Minchan Kim
2014-09-16 15:58               ` Dan Streetman
2014-09-17  7:44                 ` Minchan Kim
2014-09-17 16:28                   ` Dan Streetman
2014-09-19  6:14                     ` Minchan Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).