{"push_id":572944472,"size":1,"distinct_size":1,"ref":"refs/heads/zramsixth","head":"7446a967a76e88df3b4b8f5b530b887e3eef962a","before":"36f92be445e99685d704eb8d54b86a984c81179d","commits":[{"sha":"7446a967a76e88df3b4b8f5b530b887e3eef962a","author":{"email":"a15ba919a159c9a831d26c40bda2f108afe9f008@gmail.com","name":"Paul"},"message":"ZSMALLOC, ZSWAP (FRONTSWAP), ZCACHE, ZRAM\n\nSigned-off-by: Paul <javelinanddart@gmail.com>\n\nstaging: zsmalloc: remove x86 dependency\n\nThis patch replaces the page table assisted object mapping\nmethod, which has x86 dependencies, with a arch-independent\nmethod that does a simple copy into a temporary per-cpu\nbuffer.\n\nWhile a copy seems like it would be worse than mapping the pages,\ntests demonstrate the copying is always faster and, in the case of\nrunning inside a KVM guest, roughly 4x faster.\n\nSigned-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zsmalloc: add single-page object fastpath in unmap\n\nImprove zs_unmap_object() performance by adding a fast path for\nobjects that don't span pages.\n\nSigned-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zsmalloc: add details to zs_map_object boiler plate\n\nAdd information on the usage limits of zs_map_object()\n\nSigned-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nConflicts:\n\tdrivers/staging/zsmalloc/zsmalloc-main.c\n\nstaging: zsmalloc: zsmalloc: use unsigned long instead of void *\n\nWe should use unsigned long as handle instead of void * to avoid any\nconfusion. Without this, users may just treat zs_malloc return value as\na pointer and try to deference it.\n\nThis patch passed compile test(zram, zcache and ramster) and zram is\ntested on qemu.\n\nchangelog\n  * from v2\n\t- remove hval pointed out by Nitin\n\t- based on next-20120607\n  * from v1\n\t- change zcache's zv_create return value\n\t- baesd on next-20120604\n\nCc: Dan Magenheimer <dan.magenheimer@oracle.com>\nAcked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nAcked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nSigned-off-by: Minchan Kim <minchan@kernel.org>\nAcked-by: Nitin Gupta <ngupta@vflare.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nConflicts:\n\tdrivers/staging/zsmalloc/zsmalloc-main.c\n\nstaging: zram: fix random data read\n\nfd1a30de makes a bug that it uses (struct page *) as zsmalloc's handle\nalthough it's a uncompressed page so that it can access random page,\nreturn random data or even crashed by get_first_page in zs_map_object.\n\nCc: Seth Jennings <sjenning@linux.vnet.ibm.com>\nCc: Jerome Marchand <jmarchan@redhat.com>\nSigned-off-by: Minchan Kim <minchan@kernel.org>\nAcked-by: Nitin Gupta <ngupta@vflare.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zram: remove special handle of uncompressed page\n\nxvmalloc can't handle PAGE_SIZE page so that zram have to\nhandle it specially but zsmalloc can do it so let's remove\nunnecessary special handling code.\n\nQuote from Nitin\n\"I think page vs handle distinction was added since xvmalloc could not\nhandle full page allocation. Now that zsmalloc allows full page\nallocation, we can just use it for both cases. This would also allow\nremoving the ZRAM_UNCOMPRESSED flag. The only downside will be slightly\nslower code path for full page allocation but this event is anyways\nsupposed to be rare, so should be fine.\"\n\n1. This patch reduces code very much.\n\n drivers/staging/zram/zram_drv.c   |  104 +++++--------------------------------\n drivers/staging/zram/zram_drv.h   |   17 +-----\n drivers/staging/zram/zram_sysfs.c |    6 +--\n 3 files changed, 15 insertions(+), 112 deletions(-)\n\n2. change pages_expand with bad_compress so it can count\n   bad compression(above 75%) ratio.\n\n3. remove zobj_header which is for back-reference for defragmentation\n   because firstly, it's not used at the moment and zsmalloc can't handle\n   bigger size than PAGE_SIZE so zram can't do it any more without redesign.\n\nCc: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Minchan Kim <minchan@kernel.org>\nAcked-by: Nitin Gupta <ngupta@vflare.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zram: conventions pr_warning -> pr_warn()\n\nPorting zram to use the pr_warn() function instead of the deprecated\npr_warning().\n\nSigned-off-by: Sam Hansen <solid.se7en@gmail.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zram: conventions, __aligned() attribute\n\nUsing the __aligned() attribute in favor of __attribute__((aligned(size)))\n\nSigned-off-by: Sam Hansen <solid.se7en@gmail.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zram/zcache: swtich Kconfig dependency from X86 to ZSMALLOC\n\nThis patch switches zcache and zram dependency to ZSMALLOC\nrather than X86.  There is no net change since ZSMALLOC\ndepends on X86, however, this prevent further changes to\nthese files as zsmalloc dependencies change.\n\nSigned-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nmm: frontswap: add frontswap header file\n\nFrontswap is the alter ego of cleancache, the \"yang\" to cleancache's\n\"yin\"... and more precisely frontswap is the provider of anonymous\npages to transcendent memory to nicely complement cleancache's providing\nof clean pagecache pages to transcendent memory.  For optimal use\nof transcendent memory, both are necessary... because a kernel\nunder memory pressure first reclaims clean pagecache pages and,\nwhen under more memory pressure, starts swapping anonymous pages.\n\nFrontswap and cleancache (which was merged at 3.0) are the \"frontends\"\nand the only necessary changes to the core kernel for transcendent memory;\nall other supporting code -- the \"backends\" -- is implemented as drivers.\nSee the LWN.net article \"Transcendent memory in a nutshell\" for a detailed\noverview of frontswap and related kernel parts:\nhttps://lwn.net/Articles/454795/\n\nFrontswap code was first posted publicly in January 2009 and on LKML in\nMay 2009, and has remained functionally stable for nearly three years now.\nIt is barely invasive, touching only the swap subsystem and adds less\nthan 100 lines of code to existing swap subsystem code files.\nIt has improved syntactically substantially between V1 and this posting\nof V14, thanks to the review of a few kernel developers, and has adapted\neasily to at least one major swap subsystem change.  As of 3.4, there are\nthree in-tree users of frontswap patiently waiting for this patchset and\nfor CONFIG_FRONTSWAP to be enabled: zcache (staging driver merged at\n2.6.39), Xen tmem (merged at 3.0 and 3.1) and RAMster (staging driver\nmerged at 3.4).  In addition, a RFC has been posted for a KVM backend.\nThe frontswap patchset has been in linux-next since next-110603.  Earlier\nversions of frontswap already ship in the Oracle Unbreakable Enterprise Kernel\nand SuSE SLES.\n\nThis patch, 1of4, provides the header file for the core code for frontswap\nthat interfaces between the hooks in the swap subsystem and a frontswap\nbackend via frontswap_ops.\n\nmm: frontswap: core swap subsystem hooks and headers\n\nThis patch, 2of4, contains the changes to the core swap subsystem.\nThis includes:\n\n(1) makes available core swap data structures (swap_lock, swap_list and\nswap_info) that are needed by frontswap.c but we don't need to expose them\nto the dozens of files that include swap.h so we create a new swapfile.h\njust to extern-ify these and modify their declarations to non-static\n\n(2) adds frontswap-related elements to swap_info_struct.  Frontswap_map\npoints to vzalloc'ed one-bit-per-swap-page metadata that indicates\nwhether the swap page is in frontswap or in the device and frontswap_pages\ncounts how many pages are in frontswap.\n\n(3) adds hooks in the swap subsystem and extends try_to_unuse so that\nfrontswap_shrink can do a \"partial swapoff\".\n\nNote that a failed frontswap_map allocation is safe... failure is noted\nby lack of \"FS\" in the subsequent printk.\n\nmm: frontswap: core frontswap functionality\n\nThis patch, 3of4, provides the core frontswap code that interfaces between\nthe hooks in the swap subsystem and a frontswap backend via frontswap_ops.\n\nmm: frontswap: config and doc files\n\nThis patch 4of4 adds configuration and documentation files including a FAQ.\n\n[v14: updated docs/FAQ to use zcache and RAMster as examples]\n[v10: no change]\n[v9: akpm@linux-foundation.org: sysfs->debugfs; no longer need Doc/ABI file]\n[v8: rebase to 3.0-rc4]\n[v7: rebase to 3.0-rc3]\n[v6: rebase to 3.0-rc1]\n[v5: change config default to n]\n[v4: rebase to 2.6.39]\nSigned-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>\nAcked-by: Jan Beulich <JBeulich@novell.com>\nAcked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nCc: Jeremy Fitzhardinge <jeremy@goop.org>\nCc: Hugh Dickins <hughd@google.com>\nCc: Johannes Weiner <hannes@cmpxchg.org>\nCc: Nitin Gupta <ngupta@vflare.org>\nCc: Matthew Wilcox <matthew@wil.cx>\nCc: Chris Mason <chris.mason@oracle.com>\nCc: Rik Riel <riel@redhat.com>\nCc: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nfrontswap: s/put_page/store/g s/get_page/load\n\nSounds so much more natural.\n\nSuggested-by: Andrea Arcangeli <aarcange@redhat.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nstaging: zcache: don't limit number of pools per client\n\nCurrently the amount of pools each client can use is limited to 16, this is\nand arbitrary limit which isn't really required by current implementation.\n\nThis places and arbitrary limit on the number of mounted filesystems that\ncan use cleancache.\n\nThis patch removes that limit and uses IDR to do sparse mapping of pools\nin each client.\n\nSigned-off-by: Sasha Levin <levinsasha928@gmail.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zcache: fix refcount leak\n\nIn zcache_get_pool_by_id, the refcount of zcache_host is not increased, but\nit is always decreased in zcache_put_pool\n\nAcked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>\nAcked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zcache: fix a compile warning\n\nFix:\n\ndrivers/staging/zcache/zcache-main.c: In function ‘zcache_comp_op’:\ndrivers/staging/zcache/zcache-main.c:112:2: warning: ‘ret’ may be used uninitial\n\nSigned-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>\nAcked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zcache: remove unnecessary config option dependence\n\nzcache is enabled only if one of CONFIG_CLEANCACHE and CONFIG_FRONTSWAP is\nenabled, see the Kconfig:\n\tdepends on (CLEANCACHE || FRONTSWAP) && CRYPTO=y && X86\nSo, we can remove the check in the source code\n\nAcked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>\nAcked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zcache: mark zbud_init/zcache_comp_init as __init\n\nThese functions are called only when system is initializing, so mark __init\nfor them to free memory\n\nAcked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>\nAcked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zcache: cleanup zbud_init\n\nNeed not set global parameters to 0\n\nAcked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>\nAcked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zcache: optimize zcache_do_preload\n\nzcache_do_preload is called in zcache_put_page where IRQ is disabled, so, need\nnot care preempt\n\nAcked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>\nAcked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zcache: cleanup zcache_do_preload and zcache_put_page\n\nCleanup the code for zcache_do_preload and zcache_put_page\n\nAcked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>\nAcked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zcache: introduce get_zcache_client\n\nIntroduce get_zcache_client to remove the common code\n\nAcked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>\nAcked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zcache: cleanup the code between tmem_obj_init and tmem_obj_find\n\ntmem_obj_find and insertion tmem-obj have the some logic, we can integrate\nthe code\n\nSigned-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>\nAcked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zsmalloc: add mapping modes\n\nThis patch improves mapping performance in zsmalloc by getting\nusage information from the user in the form of a \"mapping mode\"\nand using it to avoid unnecessary copying for objects that span\npages.\n\nSigned-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zcache: fix spelling of comment\n\nFix spelling in tmem.c:\nTranscedent -> Transcendent\n\nSigned-off-by: Marcus Karlsson <mk@acc.umu.se>\nAcked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zcache: fix cleancache race condition with shrinker\n\nThis patch fixes a race condition that results in memory\ncorruption when using cleancache.\n\nThe race exists between the zcache shrinker handler,\nshrink_zcache_memory() and cleancache_get_page().\n\nIn most cases, the shrinker will both evict a zbpg\nfrom its buddy list and flush it from tmem before a\ncleancache_get_page() occurs on that page. A subsequent\ncleancache_get_page() will fail in the tmem layer.\n\nIn the rare case that two occur together and the\ncleancache_get_page() path gets through the tmem\nlayer before the shrinker path can flush tmem,\nzbud_decompress() does a check to see if the zbpg is a\n\"zombie\", i.e. not on a buddy list, which means the shrinker\nis in the process of reclaiming it. If the zbpg is a zombie,\nzbud_decompress() returns -EINVAL.\n\nHowever, this return code is being ignored by the caller,\nzcache_pampd_get_data_and_free(), which results in the\ncaller of cleancache_get_page() thinking that the page has\nbeen properly retrieved when it has not.\n\nThis patch modifies zcache_pampd_get_data_and_free() to\nconvey the failure up the stack so that the caller of\ncleancache_get_page() knows the page retrieval failed.\n\nThis needs to be applied to stable trees as well.\nzcache-main.c was named zcache.c before v3.1, so\nI'm not sure how you want to handle trees earlier\nthan that.\n\nSigned-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nCc: stable <stable@vger.kernel.org>\nReviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nReviewed-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zram: correct obsolete comment on max_zpage_size\n\nZram doesn't use xv_malloc any more so it doesn't have\nlimitation about zobj_header.\n\nSigned-off-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zram: Fix handling of incompressible pages\n\nChange 130f315a (staging: zram: remove special handle of uncompressed page)\nintroduced a bug in the handling of incompressible pages which resulted in\nmemory allocation failure for such pages.\n\nWhen a page expands on compression, say from 4K to 4K+30, we were trying to\ndo zsmalloc(pool, 4K+30). However, the maximum size which zsmalloc can\nallocate is PAGE_SIZE (for obvious reasons), so such allocation requests\nalways return failure (0).\n\nFor a page that has compressed size larger than the original size (this may\nhappen with already compressed or random data), there is no point storing\nthe compressed version as that would take more space and would also require\ntime for decompression when needed again. So, the fix is to store any page,\nwhose compressed size exceeds a threshold (max_zpage_size), as-it-is i.e.\nwithout compression.  Memory required for storing this uncompressed page can\nthen be requested from zsmalloc which supports PAGE_SIZE sized allocations.\n\nLastly, the fix checks that we do not attempt to \"decompress\" the page which\nwe stored in the uncompressed form -- we just memcpy() out such pages.\n\nSigned-off-by: Nitin Gupta <ngupta@vflare.org>\nReported-by: viechweg@gmail.com\nReported-by: paerley@gmail.com\nReported-by: wu.tommy@gmail.com\nAcked-by: Minchan Kim <minchan@kernel.org>\nCc: stable <stable@vger.kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zram: factor-out zram_decompress_page() function\n\nzram_bvec_read() shared decompress functionality with zram_read_before_write() function.\nFactor-out and make commonly used zram_decompress_page() function, which also simplified\nerror handling in zram_bvec_read().\n\nSigned-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>\nReviewed-by: Nitin Gupta <ngupta@vflare.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zram: handle mem suffixes in disk size zram_sysfs parameter\n\nUse memparse() to allow mem suffixes in disksize sysfs number.\nExamples:\n    echo 256K > /sys/block/zram0/disksize\n    echo 512M > /sys/block/zram0/disksize\n    echo 1G > /sys/block/zram0/disksize\n\nSigned-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>\nReviewed-by: Nitin Gupta <ngupta@vflare.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: Add angle bracket before and after the URL\n\nAdd missing angle bracket before and after the URL.\n\nSigned-off-by: Masanari Iida <standby24x7@gmail.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zram: fix invalid memory references during disk write\n\nFixes a bug introduced by commit c8f2f0db1 (\"zram: Fix handling\nof incompressible pages\") which caused invalid memory references\nduring disk write. Invalid references could occur in two cases:\n - Incoming data expands on compression: In this case, reference was\nmade to kunmap()'ed bio page.\n - Partial (non PAGE_SIZE) write with incompressible data: In this\ncase, reference was made to a kfree()'ed buffer.\n\nFixes bug 50081:\nhttps://bugzilla.kernel.org/show_bug.cgi?id=50081\n\nSigned-off-by: Nitin Gupta <ngupta@vflare.org>\nCc: stable <stable@vger.kernel.org>\nReported-by: Mihail Kasadjikov <hamer.mk@gmail.com>\nReported-by: Tomas M <tomas@slax.org>\nReviewed-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zram: simplify num_devices paramater\n\nSimplify dealing with num_devices when initializing zram.\nAlso cleanup some of the output messages.\n\nSigned-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zram: show correct disksize\n\nThe ->disksize variable stores values in units of bytes,\nprint the correct size in Kb\n\nSigned-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zsmalloc: prevent mappping in interrupt context\n\nBecause we use per-cpu mapping areas shared among the\npools/users, we can't allow mapping in interrupt context\nbecause it can corrupt another users mappings.\n\nSigned-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nAcked-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\narch/arm/mach-msm/Kconfig: decouple QCACHE from MSM board selection\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nmsm_ion.c: fix zcache compatibility issues\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nzcache-main: enable zcache by default\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nstaging: zram: drop zram_stat_dec/inc functions\n\nsync with kernel.org @ this commit\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nzram: Fix deadlock bug in partial read/write\n\nNow zram allocates new page with GFP_KERNEL in zram I/O path\nif IO is partial. Unfortunately, It may cause deadlock with\nreclaim path like below.\n\nwrite_page from fs\nfs_lock\nallocation(GFP_KERNEL)\nreclaim\npageout\n\t\t\t\twrite_page from fs\n\t\t\t\tfs_lock <-- deadlock\n\nThis patch fixes it by using GFP_NOIO.  In read path, we\nreorganize code flow so that kmap_atomic is called after the\nGFP_NOIO allocation.\n\nCc: stable@vger.kernel.org\nAcked-by: Jerome Marchand <jmarchand@redhat.com>\nAcked-by: Nitin Gupta <ngupta@vflare.org>\n[ penberg@kernel.org: don't use GFP_ATOMIC ]\nSigned-off-by: Pekka Enberg <penberg@kernel.org>\nSigned-off-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nzram: force disksize setting before using zram\n\nNow zram document syas \"set disksize is optional\"\nbut partly it's wrong. When you try to use zram firstly after\nbooting, you must set disksize, otherwise zram can't work because\nzram gendisk's size is 0. But once you do it, you can use zram freely\nafter reset because reset doesn't reset to zero paradoxically.\nSo in this time, disksize setting is optional.:(\nIt's inconsitent for user behavior and not straightforward.\n\nThis patch forces always setting disksize firstly before using zram.\nYes. It changes current behavior so someone could complain when\nhe upgrades zram. Apparently it could be a problem if zram is mainline\nbut it still lives in staging so behavior could be changed for right\nway to go. Let them excuse.\n\nAcked-by: Jerome Marchand <jmarchand@redhat.com>\nAcked-by: Nitin Gupta <ngupta@vflare.org>\nAcked-by: Dan Magenheimer <dan.magenheimer@oracle.com>\nSigned-off-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nzram: give up lazy initialization of zram metadata\n\n1) User of zram normally do mkfs.xxx or mkswap before using\n   the zram block device(ex, normally, do it at booting time)\n   It ends up allocating such metadata of zram before real usage so\n   benefit of lazy initialzation would be mitigated.\n\n2) Some user want to use zram when memory pressure is high.(ie, load zram\n   dynamically, NOT booting time). It does make sense because people don't\n   want to waste memory until memory pressure is high(ie, where zram is really\n   helpful time). In this case, lazy initialzation could be failed easily\n   because we will use GFP_NOIO instead of GFP_KERNEL for avoiding deadlock.\n   So the benefit of lazy initialzation would be mitigated, too.\n\n3) Metadata overhead is not critical and Nitin has a plan to diet it.\n   4K : 12 byte(64bit machine) -> 64G : 192M so 0.3% isn't big overhead\n   If insane user use such big zram device up to 20, it could consume 6% of ram\n   but efficieny of zram will cover the waste.\n\nSo this patch gives up lazy initialization and instead we initialize metadata\nat disksize setting time.\n\nAcked-by: Jerome Marchand <jmarchand@redhat.com>\nAcked-by: Nitin Gupta <ngupta@vflare.org>\nSigned-off-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nzram: fix warning of print format\n\nkbuild bot whinges due to print format mistmatch caused by\nzram: force disksize setting before using zram.\n\nThis patch fixes it.\n\nReported-by: Wu Fengguang <fengguang.wu@intel.com>\nSigned-off-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zsmalloc: add page table mapping method This patchset provides page mapping via the page table. On some archs, most notably ARM, this method has been demonstrated to be faster than copying.\n\nThe logic controlling the method selection (copy vs page table)\nis controlled by the definition of USE_PGTABLE_MAPPING which\nis/can be defined for any arch that performs better with page\ntable mapping.\n\nSigned-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nAcked-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\nsync with kernel.org @ this commit\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nzsmalloc: collapse internal .h into .c\n\nThe patch collapses in the internal zsmalloc_int.h into\nthe zsmalloc-main.c file.\n\nThis is done in preparation for the promotion to mm/ where\nseparate internal headers are discouraged.\n\nSigned-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Minchan Kim <minchan@kernel.org>\nAcked-by: Nitin Gupta <ngupta@vflare.org>\nReviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zsmalloc: comment zs_create_pool function\n\nJust as with zs_malloc() and zs_map_object(), it is worth\nformally commenting the zs_create_pool() function.\n\nSigned-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zsmalloc: make CLASS_DELTA relative to PAGE_SIZE\n\nRight now ZS_SIZE_CLASS_DELTA is hardcoded to be 16.  This\ncreates 254 classes for systems with 4k pages. However, on\nPPC64 with 64k pages, it creates 4095 classes which is far\ntoo many.\n\nThis patch makes ZS_SIZE_CLASS_DELTA relative to PAGE_SIZE\nso that regardless of the page size, there will be the same\nnumber of classes.\n\nAcked-by: Nitin Gupta <ngupta@vflare.org>\nAcked-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nAcked-by: Dan Magenheimer <dan.magenheimer@oracle.com>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zsmalloc: Fix TLB coherency and build problem\n\nRecently, Matt Sealey reported he fail to build zsmalloc caused by\nusing of local_flush_tlb_kernel_range which are architecture dependent\nfunction so !CONFIG_SMP in ARM couldn't implement it so it ends up\nbuild error following as.\n\n  MODPOST 216 modules\n  LZMA    arch/arm/boot/compressed/piggy.lzma\n  AS      arch/arm/boot/compressed/lib1funcs.o\nERROR: \"v7wbi_flush_kern_tlb_range\"\n[drivers/staging/zsmalloc/zsmalloc.ko] undefined!\nmake[1]: *** [__modpost] Error 1\nmake: *** [modules] Error 2\nmake: *** Waiting for unfinished jobs....\n\nThe reason we used that function is copy method by [1]\nwas really slow in ARM but at that time.\n\nMore severe problem is ARM can prefetch speculatively on other CPUs\nso under us, other TLBs can have an entry only if we do flush local\nCPU. Russell King pointed that. Thanks!\nWe don't have many choices except using flush_tlb_kernel_range.\n\nMy experiment in ARMv7 processor 4 core didn't make any difference with\nzsmapbench[2] between local_flush_tlb_kernel_range and flush_tlb_kernel_range\nbut still page-table based is much better than copy-based.\n\n* bigger is better.\n\n1. local_flush_tlb_kernel_range: 3918795 mappings\n2. flush_tlb_kernel_range : 3989538 mappings\n3. copy-based: 635158 mappings\n\nThis patch replace local_flush_tlb_kernel_range with\nflush_tlb_kernel_range which are avaialbe in all architectures\nbecause we already have used it in vmalloc allocator which are\ngeneric one so build problem should go away and performane loss\nshoud be void.\n\n[1] f553646, zsmalloc: add page table mapping method\n[2] https://github.com/spartacus06/zsmapbench\n\nCc: stable@vger.kernel.org\nCc: Dan Magenheimer <dan.magenheimer@oracle.com>\nCc: Russell King <linux@arm.linux.org.uk>\nCc: Konrad Rzeszutek Wilk <konrad@darnok.org>\nCc: Nitin Gupta <ngupta@vflare.org>\nCc: Seth Jennings <sjenning@linux.vnet.ibm.com>\nReported-by: Matt Sealey <matt@genesi-usa.com>\nSigned-off-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nstaging: zsmalloc: Fix link error on ARM\n\ncommit d95abbbb291bf5bce078148f53603ce9c0aa1d44 upstream.\n\nTesting the arm chromebook config against the upstream\nkernel produces a linker error for the zsmalloc module from\nstaging. The symbol flush_tlb_kernel_range is not available\nthere. Fix this by removing the reimplementation of\nunmap_kernel_range in the zsmalloc module and using the\nfunction directly. The unmap_kernel_range function is not\nusable by modules, so also disallow building the driver as a\nmodule for now.\n\nSigned-off-by: Joerg Roedel <joro@8bytes.org>\nAcked-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n\nlowmemorykiller: adapt enhanced LMK Routine from Samsung's JF series kernel\n\nfor use on HTC One kernel\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nzram: optimize for Android use adapted from Samsung JF Kernels\n\nfor use on HTC One\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nzram swap: LMK and memcontrol update from Samsung SGS 4 update 2 source drop\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nmm: frontswap: remove casting from function calls through ops structure\n\nRemoves unneeded casts.\n\nReviewed-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Sasha Levin <levinsasha928@gmail.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nmm: frontswap: trivial coding convention issues\n\nReviewed-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Sasha Levin <levinsasha928@gmail.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nmm: frontswap: split out __frontswap_curr_pages\n\nCode was duplicated in two functions, clean it up.\n\nAlso, assert that the deduplicated code runs under the swap spinlock.\n\nReviewed-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Sasha Levin <levinsasha928@gmail.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nmm: frontswap: split out __frontswap_unuse_pages\n\nAn attempt at making frontswap_shrink shorter and more readable. This patch\nsplits out walking through the swap list to find an entry with enough\npages to unuse.\n\nAlso, assert that the internal __frontswap_unuse_pages is called under swap\nlock, since that part of code was previously directly happen inside the lock.\n\nSigned-off-by: Sasha Levin <levinsasha928@gmail.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nmm: frontswap: split frontswap_shrink further to simplify locking\n\nSplit frontswap_shrink to simplify the locking in the original code.\n\nAlso, assert that the function that was split still runs under the\nswap spinlock.\n\nSigned-off-by: Sasha Levin <levinsasha928@gmail.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nmm: frontswap: make all branches of if statement in put page consistent\n\nCurrently it has a complex structure where different things are compared\nat each branch. Simplify that and make both branches look similar.\n\nReviewed-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Sasha Levin <levinsasha928@gmail.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nmm: frontswap: remove unnecessary check during initialization\n\nThe check whether frontswap is enabled or not is done in the API functions in\nthe frontswap header, before they are passed to the internal\ndouble-underscored frontswap functions.\n\nRemove the check from __frontswap_init for consistency.\n\nReviewed-by: Minchan Kim <minchan@kernel.org>\nSigned-off-by: Sasha Levin <levinsasha928@gmail.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nmm: frontswap: split out function to clear a page out\n\nSigned-off-by: Sasha Levin <levinsasha928@gmail.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nmm: frontswap: remove unneeded headers\n\nSigned-off-by: Sasha Levin <levinsasha928@gmail.com>\n[v1: Rebased with tracing removed]\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nmm/frontswap: cleanup doc and comment error\n\nSigned-off-by: Wanpeng Li <liwp.linux@gmail.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nmm/frontswap: fix uninit'ed variable warning\n\nFixes uninitialized variable warning on 'type' in frontswap_shrink().\ntype is set before use by __frontswap_unuse_pages() called by\n__frontswap_shrink() called by frontswap_shrink() before use by\ntry_to_unuse().\n\nSigned-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nmm: frontswap: fix a wrong if condition in frontswap_shrink\n\npages_to_unuse is set to 0 to unuse all frontswap pages\nBut that doesn't happen since a wrong condition in frontswap_shrink\ncancel it.\n\n-v2: Add comment to explain return value of __frontswap_shrink,\nas suggested by Dan Carpenter, thanks\n\nSigned-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nfrontswap: support exclusive gets if tmem backend is capable\n\nTmem, as originally specified, assumes that \"get\" operations\nperformed on persistent pools never flush the page of data out\nof tmem on a successful get, waiting instead for a flush\noperation.  This is intended to mimic the model of a swap\ndisk, where a disk read is non-destructive.  Unlike a\ndisk, however, freeing up the RAM can be valuable.  Over\nthe years that frontswap was in the review process, several\nreviewers (and notably Hugh Dickins in 2010) pointed out that\nthis would result, at least temporarily, in two copies of the\ndata in RAM: one (compressed for zcache) copy in tmem,\nand one copy in the swap cache.  We wondered if this could\nbe done differently, at least optionally.\n\nThis patch allows tmem backends to instruct the frontswap\ncode that this backend performs exclusive gets.  Zcache2\nalready contains hooks to support this feature.  Other\nbackends are completely unaffected unless/until they are\nupdated to support this feature.\n\nWhile it is not clear that exclusive gets are a performance\nwin on all workloads at all times, this small patch allows for\nexperimentation by backends.\n\nP.S. Let's not quibble about the naming of \"get\" vs \"read\" vs\n\"load\" etc.  The naming is currently horribly inconsistent between\ncleancache and frontswap and existing tmem backends, so will need\nto be straightened out as a separate patch.  \"Get\" is used\nby the tmem architecture spec, existing backends, and\nall documentation and presentation material so I am\nusing it in this patch.\n\nSigned-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>\nSigned-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>\n\nRevert \"staging: zram: drop zram_stat_dec/inc functions\"\n\nThis reverts commit 843ef984019b0fb933d9bb01263e9c29fc9603c7.\n\ndecompressor: Add LZ4 decompressor module\n\nDate\tTue, 26 Feb 2013 15:24:27 +0900\n\nThis patch adds support for LZ4 decompression in the Linux Kernel.\nLZ4 Decompression APIs for kernel are based on LZ4 implementation\nby Yann Collet.\n\nLZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html\nLZ4 source repository : http://code.google.com/p/lz4/\n\nSigned-off-by: Kyungsik Lee <kyungsik.lee@lge.com>\n\nv2:\n- Clean up code\n- Enable unaligned access for ARM v6 and above with\n  CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS\n- Add lz4_decompress() for faster decompression with\n  uncompressed output size\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nlib: Add support for LZ4-compressed kernel\n\nDate\tTue, 26 Feb 2013 15:24:28 +0900\n\nThis patch adds support for extracting LZ4-compressed kernel images,\nas well as LZ4-compressed ramdisk images in the kernel boot process.\n\nThis depends on the patch below\ndecompressor: Add LZ4 decompressor module\n\nSigned-off-by: Kyungsik Lee <kyungsik.lee@lge.com>\n\nv2:\n- Clean up code\n- Use lz4_decompress() for LZ4-compressed kernel during boot-process\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\narm: Add support for LZ4-compressed kernel\n\nDate\tTue, 26 Feb 2013 15:24:29 +0900\n\nThis patch integrates the LZ4 decompression code to the arm pre-boot code.\nAnd it depends on two patchs below\n\nlib: Add support for LZ4-compressed kernel\ndecompressor: Add LZ4 decompressor module\n\nSigned-off-by: Kyungsik Lee <kyungsik.lee@lge.com>\n\nv2:\n- Apply CFLAGS, -Os to decompress.o to improve decompress\n  performance during boot-up process\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nlib: Add lz4 compressor module\n\nFrom\tChanho Min <>\n\nThis patch adds support for LZ4 compression in the Linux Kernel.\nLZ4 Compression APIs for kernel are based on LZ4 implementation\nby Yann Collet and changed with kernel coding style.\n\nLZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html\nLZ4 source repository : http://code.google.com/p/lz4/\nsvn revision : r90\n\nTwo APIs are added:\nlz4_compress() support basic lz4 compression whereas lz4hc_compress() support\nhigh compression or CPU performance get lower but compression ratio get higher.\nAlso, we require the pre-allocated working memory with the defined size and\ndestination buffer must be allocated with the size of lz4_compressbound.\n\nSigned-off-by: Chanho Min <chanho.min@lge.com>\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\ncrypto: Add lz4 Cryptographic API\n\nFrom\tChanho Min <>\n\nThis patch adds support for lz4 and lz4hc compression algorithm\nusing the lib/lz4/* codebase.\nSigned-off-by: Chanho Min <chanho.min@lge.com>\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nlib/lz4/lz4_compress: fix macro usage error\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nLZ4: compression/decompression signedness mismatch (v2)\n\nLZ4 compression and decompression functions require different\nin signedness input/output parameters: unsigned char for\ncompression and signed char for decompression.\n\nChange decompression API to require \"(const) unsigned char *\".\n\nv2: minor coding style fix.\n\nSigned-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nstaging: zram: add Crypto API support\n\nDate\tTue, 30 Jul 2013 14:30:48 +0200\n\nCurrent version of zram does not allow any substitution of a default\ncompression algorithm. Therefore, I decided to change the existing\nimplementation of page compression by adding Crypto API compability.\n\nAll direct calls to lzo1x compression/decompression methods are now\nreplaced by calls consistent with Crypto. Also, I removed \"workmem\"\nfield from struct zram_meta, as it was there for lzo1x purposes only\nand is no longer needed. Finally, I added a set of functions required\nby Crypto API to work properly.\n\nIn order to substitute the default algorithm (lzo), change the value\nof zram.compressor module parameter to a proper name (e.g. lz4).\n\nSigned-off-by: Piotr Sarna <p.sarna@partner.samsung.com>\nAcked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>\nSigned-off-by: Kyungmin Park <kyungmin.park@samsung.com>\n\nbackported to Linux 3.4 by faux123\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nstaging: zram: add per-cpu support to Crypto\n\nDate\tTue, 30 Jul 2013 14:30:49 +0200\n\nSince original zram code did not implement any per-cpu operations,\nmy previous patch (staging: zram: add Crypto API support) did not\ninclude them either.\n\nThis patch complements the first one with per-cpu support for Crypto,\nallocating tfms buffer separately for each online processor.\nChanges are based on zswap and zcache per-cpu code.\n\nBasic tests (concurrent writing several 10-40MB chunks to zram) performed\non an ARM-based EXYNOS4412 Quad-Core showed that per-cpu code provides\nnoticeable time saving, ranging between 30-40% for LZO and LZ4 compressors.\nSample data (LZO): writing 160MB, 40MB per thread took 0.60s with per-cpu\ncode included and approximately 0.80s without per-cpu support.\n\nSigned-off-by: Piotr Sarna <p.sarna@partner.samsung.com>\nAcked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>\nSigned-off-by: Kyungmin Park <kyungmin.park@samsung.com>\n\nbackported to Linux 3.4 by faux123\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nzram_drv: switch default compressor to new lz4\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nzcache-main.c: use MACRO define instead of hardcoded default of lzo\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>\n\nzcache-main: switch to lz4 as default\n\nSigned-off-by: Paul Reioux <reioux@gmail.com>","distinct":true,"url":"https://api.github.com/repos/javelinanddart/android_kernel_sense_ville/commits/7446a967a76e88df3b4b8f5b530b887e3eef962a"}]}