All of lore.kernel.org
 help / color / mirror / Atom feed
From: Seth Jennings <sjenning@linux.vnet.ibm.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	Nitin Gupta <ngupta@vflare.org>,
	Konrad Rzeszutek Wilk <konrad@darnok.org>,
	Shaohua Li <shli@kernel.org>
Subject: Re: [RFC] mm: remove swapcache page early
Date: Wed, 27 Mar 2013 12:19:11 -0500	[thread overview]
Message-ID: <51532A0F.3010402@linux.vnet.ibm.com> (raw)
In-Reply-To: <1364350932-12853-1-git-send-email-minchan@kernel.org>

On 03/26/2013 09:22 PM, Minchan Kim wrote:
> Swap subsystem does lazy swap slot free with expecting the page
> would be swapped out again so we can't avoid unnecessary write.
> 
> But the problem in in-memory swap is that it consumes memory space
> until vm_swap_full(ie, used half of all of swap device) condition
> meet. It could be bad if we use multiple swap device, small in-memory swap
> and big storage swap or in-memory swap alone.
> 
> This patch changes vm_swap_full logic slightly so it could free
> swap slot early if the backed device is really fast.

Great idea!

> For it, I used SWP_SOLIDSTATE but It might be controversial.

The comment for SWP_SOLIDSTATE is that "blkdev seeks are cheap". Just
because seeks are cheap doesn't mean the read itself is also cheap.
For example, QUEUE_FLAG_NONROT is set for mmc devices, but some of
them can be pretty slow.

> So let's add Ccing Shaohua and Hugh.
> If it's a problem for SSD, I'd like to create new type SWP_INMEMORY
> or something for z* family.

Afaict, setting SWP_SOLIDSTATE depends on characteristics of the
underlying block device (i.e. blk_queue_nonrot()).  zram is a block
device but zcache and zswap are not.

Any idea by what criteria SWP_INMEMORY would be set?

Also, frontswap backends (zcache and zswap) are a caching layer on top
of the real swap device, which might actually be rotating media.  So
you have the issue of to different characteristics, in-memory caching
on top of rotation media, present in a single swap device.

Thanks,
Seth

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Seth Jennings <sjenning@linux.vnet.ibm.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Hugh Dickins <hughd@google.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	Nitin Gupta <ngupta@vflare.org>,
	Konrad Rzeszutek Wilk <konrad@darnok.org>,
	Shaohua Li <shli@kernel.org>
Subject: Re: [RFC] mm: remove swapcache page early
Date: Wed, 27 Mar 2013 12:19:11 -0500	[thread overview]
Message-ID: <51532A0F.3010402@linux.vnet.ibm.com> (raw)
In-Reply-To: <1364350932-12853-1-git-send-email-minchan@kernel.org>

On 03/26/2013 09:22 PM, Minchan Kim wrote:
> Swap subsystem does lazy swap slot free with expecting the page
> would be swapped out again so we can't avoid unnecessary write.
> 
> But the problem in in-memory swap is that it consumes memory space
> until vm_swap_full(ie, used half of all of swap device) condition
> meet. It could be bad if we use multiple swap device, small in-memory swap
> and big storage swap or in-memory swap alone.
> 
> This patch changes vm_swap_full logic slightly so it could free
> swap slot early if the backed device is really fast.

Great idea!

> For it, I used SWP_SOLIDSTATE but It might be controversial.

The comment for SWP_SOLIDSTATE is that "blkdev seeks are cheap". Just
because seeks are cheap doesn't mean the read itself is also cheap.
For example, QUEUE_FLAG_NONROT is set for mmc devices, but some of
them can be pretty slow.

> So let's add Ccing Shaohua and Hugh.
> If it's a problem for SSD, I'd like to create new type SWP_INMEMORY
> or something for z* family.

Afaict, setting SWP_SOLIDSTATE depends on characteristics of the
underlying block device (i.e. blk_queue_nonrot()).  zram is a block
device but zcache and zswap are not.

Any idea by what criteria SWP_INMEMORY would be set?

Also, frontswap backends (zcache and zswap) are a caching layer on top
of the real swap device, which might actually be rotating media.  So
you have the issue of to different characteristics, in-memory caching
on top of rotation media, present in a single swap device.

Thanks,
Seth


  parent reply	other threads:[~2013-03-27 17:20 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-27  2:22 [RFC] mm: remove swapcache page early Minchan Kim
2013-03-27  2:22 ` Minchan Kim
2013-03-27  5:03 ` Kyungmin Park
2013-03-27  5:03   ` Kyungmin Park
2013-03-27  5:15 ` Kamezawa Hiroyuki
2013-03-27  5:15   ` Kamezawa Hiroyuki
2013-03-27  7:05   ` Minchan Kim
2013-03-27  7:05     ` Minchan Kim
2013-03-27 17:19 ` Seth Jennings [this message]
2013-03-27 17:19   ` Seth Jennings
2013-03-28  1:36   ` Minchan Kim
2013-03-28  1:36     ` Minchan Kim
2013-03-27 21:41 ` Hugh Dickins
2013-03-27 21:41   ` Hugh Dickins
2013-03-27 22:24   ` Dan Magenheimer
2013-03-27 22:24     ` Dan Magenheimer
2013-03-27 23:16     ` Hugh Dickins
2013-03-27 23:16       ` Hugh Dickins
2013-03-28  1:18       ` Minchan Kim
2013-03-28  1:18         ` Minchan Kim
2013-03-28  1:54         ` Shaohua Li
2013-03-28  1:54           ` Shaohua Li
2013-03-28 17:35       ` Dan Magenheimer
2013-03-28 17:35         ` Dan Magenheimer
2013-03-28  1:07     ` Minchan Kim
2013-03-28  1:07       ` Minchan Kim
2013-03-28 18:19       ` Dan Magenheimer
2013-03-28 18:19         ` Dan Magenheimer
2013-03-29  1:18         ` Minchan Kim
2013-03-29  1:18           ` Minchan Kim
2013-03-29 20:01           ` Hugh Dickins
2013-03-29 20:01             ` Hugh Dickins
2013-04-02  2:04             ` Minchan Kim
2013-04-02  2:04               ` Minchan Kim
2013-04-02  5:13               ` Hugh Dickins
2013-04-02  5:13                 ` Hugh Dickins
2013-04-02  5:56                 ` Minchan Kim
2013-04-02  5:56                   ` Minchan Kim
2013-03-28  0:36   ` Minchan Kim
2013-03-28  0:36     ` Minchan Kim
2013-04-02 13:40   ` Simon Jeons
2013-04-02 13:40     ` Simon Jeons
2013-04-07  7:26     ` Simon Jeons
2013-04-07  7:26       ` Simon Jeons
2013-04-08  1:48       ` Minchan Kim
2013-04-08  1:48         ` Minchan Kim
2013-04-08  1:51         ` Simon Jeons
2013-04-08  1:51           ` Simon Jeons
     [not found] <<1364350932-12853-1-git-send-email-minchan@kernel.org>
2013-03-27 21:20 ` Dan Magenheimer
2013-03-27 21:20   ` Dan Magenheimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51532A0F.3010402@linux.vnet.ibm.com \
    --to=sjenning@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.magenheimer@oracle.com \
    --cc=hughd@google.com \
    --cc=konrad@darnok.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=shli@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.