Revert "Revert "msm: mdp: Update sync pt. behaviour""

This reverts commit 27cf9620359280fa6ca2068c7acf2269a0446eeb.
Revert "Revert "msm_fb: Set RR sched policy for Glupdator thread""

This reverts commit 47baafba1143801deb40bae85e1dbb48afae29ef.
Revert "Revert "Merge remote-tracking branch 'cm/cm-10.2' into jb4.3""

This reverts commit 82e7a453416206f24308ca59b0b549d5a2736b6f.
Revert "Revert "msm: kgsl: use kgsl_mmu_device_setstate() if the GPU is already idle""

This reverts commit 60a6bf2cde62f47889da506bbc8044ae7f6de282.
Revert "Revert "msm: kgsl: implement server-side waits""

This reverts commit 9a7cf57e152e5396c0ecfbe69dca03e5048bd70d.
Revert "Revert "msm: kgsl: generate descriptive names for kgsl-timeline""

This reverts commit 87f5114c61b18d292e8b67d714116e043a4edf69.
Revert "Revert "msm: kgsl: show timestamp in sync dump""

This reverts commit 283da6a323954f656e2054cfcc4cc96c587c1845.
Revert "Revert "msm: kgsl: Add a check to free the kgsl_timeline object.""

This reverts commit c45da1118972a6726b500167700940ee96b8077a.
Revert "Revert "adreno: increase cmdbatch timeout to 10 seconds""

This reverts commit b19633637273c5809dc14bc6e3678cfa59f06519.
Revert "Revert "msm: kgsl: Map sync lock variables to every pagetable""

This reverts commit 255d5466fdfd1f5d19f904eb41002d77fc597c9f.
Revert "Revert "kgsl: Add memory barrier to kgsl_iommu_lock_rb_in_tlb iommu operation""

This reverts commit 56b6d176693316d4efb080ecb88e7bac40e9e09b.
Revert "Revert "msm: kgsl: Use the correct length when looking for address collision""

This reverts commit 8deb58d1557db06701ef66e86d0f271b91853b59.
Revert "Revert "msm: kgsl: Prevent race conditions when freeing memory""

This reverts commit c9f6954fcd58209b056c8d1be1e49a0e09534f50.
Revert "Revert "msm: kgsl: Only reference the rb_node after taking spinlock""

This reverts commit b77bd6eca15057e6105c2db53086db5c31fa5a03.
Revert "Revert "msm: kgsl: Only initialize process structure once""

This reverts commit bf3ec92742cb5c9de2656a390e07cc274d3fac71.
Revert "Revert "msm: kgsl: Add a missing mutex unlock""

This reverts commit bab8b1243d5abe958f5d89074442f38d2b7d8896.
Revert "Revert "msm: kgsl: Prevent race conditions when freeing memory""

This reverts commit 7e67e1d21588334ad3cd8d058ba6f8f3d7ee15c6.
mako_hotplug: reduce ovehead by removing pr_info
kgsl: re-create simple_laziness sysfs to fool fauxclcok into supporting Simple
mm: remove compressed copy from zram in-memory

Swap subsystem does lazy swap slot free with expecting the page would be
swapped out again so we can avoid unnecessary write.

But the problem in in-memory swap(ex, zram) 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 makes swap subsystem free swap slot as soon as swap-read is
completed and make the swapcache page dirty so the page should be
written out the swap device to reclaim it.  It means we never lose it.

I tested this patch with kernel compile workload.

1. before

   compile time : 9882.42
   zram max wasted space by fragmentation: 13471881 byte
   memory space consumed by zram: 174227456 byte
   the number of slot free notify: 206684

2. after

   compile time : 9653.90
   zram max wasted space by fragmentation: 11805932 byte
   memory space consumed by zram: 154001408 byte
   the number of slot free notify: 426972

[akpm@linux-foundation.org: tweak comment text]
[artem.savkov@gmail.com: fix BUG due to non-swapcache pages in end_swap_bio_read()]
[akpm@linux-foundation.org: invert unlikely() test, augment comment, 80-col cleanup]
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>
Cc: Shaohua Li <shli@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Change-Id: I8f11fb7f0391954435002e7f290352f311c907d4

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	mm/page_io.c