[PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

This patch prevents to add a page to swap cache unnecessary when
may_writepage is unset so anoymous lru list isn't full of
Dirty/Swapcache page. So VM can isolate pages from anon lru list,
which ends up setting may_writepage to 1 and could swap out
anon lru pages. When OOM triggers, I confirmed swap space was full.

Reported-by: Luigi Semenzato <semenzato@google.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
[PATCH 2/2] mm: forcely swapout when we are out of page cache

In many occasions VM tries to avoid I/O for saving the power.
But if there isn't reclaimable memory without I/O, we should do I/O
to prevent unnecessary OOM kill although we sacrifice power.

One of example is that we are out of page cache. Remained one is
only anonymous pages, for swapping out, we needs may_writepage = 1.

Reported-by: Luigi Semenzato <semenzato@google.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
[PATCH 1/3] staging, zsmalloc: introduce zs_mem_[read/write]

If object is on boundary of page, zs_map_object() copy content of object
to pre-allocated page and return virtual address of
this pre-allocated page. If user inform zsmalloc of memcpy region,
we can avoid this copy overhead.
This patch implement two API and these get information of memcpy region.
Using this information, we can do memcpy without overhead.

For USE_PGTABLE_MAPPING case, we can avoid flush cache and tlb overhead
via these API.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
[PATCH 3/3] staging, zram: use zs_mem_[read/write]

Now, we have newly introduced APIs which reduce copy overhead of
zsmalloc for objects on page boundary.
So use it in zram.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Fix zram_drv.c compilation error