summaryrefslogtreecommitdiff
path: root/drivers/staging/zcache
AgeCommit message (Collapse)AuthorFilesLines
2013-05-30drivers: staging: zcache: fix compile errorBob Liu3-6/+6
Fix below compile error: drivers/built-in.o: In function `zcache_pampd_free': >> zcache-main.c:(.text+0xb1c8a): undefined reference to `ramster_pampd_free' >> zcache-main.c:(.text+0xb1cbc): undefined reference to `ramster_count_foreign_pages' drivers/built-in.o: In function `zcache_pampd_get_data_and_free': >> zcache-main.c:(.text+0xb1f05): undefined reference to `ramster_count_foreign_pages' drivers/built-in.o: In function `zcache_cpu_notifier': >> zcache-main.c:(.text+0xb228d): undefined reference to `ramster_cpu_up' >> zcache-main.c:(.text+0xb2339): undefined reference to `ramster_cpu_down' drivers/built-in.o: In function `zcache_pampd_create': >> (.text+0xb26ce): undefined reference to `ramster_count_foreign_pages' drivers/built-in.o: In function `zcache_pampd_create': >> (.text+0xb27ef): undefined reference to `ramster_count_foreign_pages' drivers/built-in.o: In function `zcache_put_page': >> (.text+0xb299f): undefined reference to `ramster_do_preload_flnode' drivers/built-in.o: In function `zcache_flush_page': >> (.text+0xb2ea3): undefined reference to `ramster_do_preload_flnode' drivers/built-in.o: In function `zcache_flush_object': >> (.text+0xb307c): undefined reference to `ramster_do_preload_flnode' drivers/built-in.o: In function `zcache_init': >> zcache-main.c:(.text+0xb3629): undefined reference to `ramster_register_pamops' >> zcache-main.c:(.text+0xb3868): undefined reference to `ramster_init' >> drivers/built-in.o:(.rodata+0x15058): undefined reference to `ramster_foreign_eph_pages' >> drivers/built-in.o:(.rodata+0x15078): undefined reference to `ramster_foreign_pers_pages' Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Bob Liu <bob.liu@oracle.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-20staging: ramster: add how-to documentDan Magenheimer1-0/+366
Add how-to documentation that provides a step-by-step guide for configuring and trying out a ramster cluster. Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-17staging: zcache: Fix incorrect module_param_array typesGeert Uytterhoeven1-4/+4
drivers/staging/zcache/zcache-main.c: In function ‘__check_disable_cleancache’: drivers/staging/zcache/zcache-main.c:1928: warning: return from incompatible pointer type drivers/staging/zcache/zcache-main.c: In function ‘__check_disable_frontswap’: drivers/staging/zcache/zcache-main.c:1929: warning: return from incompatible pointer type drivers/staging/zcache/zcache-main.c: In function ‘__check_disable_frontswap_ignore_nonactive’: drivers/staging/zcache/zcache-main.c:1933: warning: return from incompatible pointer type Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-01staging: zcache: enable zcache to be built/loaded as a moduleDan Magenheimer5-12/+55
Allow zcache to be built/loaded as a module. Note runtime dependency disallows loading if cleancache/frontswap lazy initialization patches are not present. Zsmalloc support has not yet been merged into zcache but, once merged, could now easily be selected via a module_param. If built-in (not built as a module), the original mechanism of enabling via a kernel boot parameter is retained, but this should be considered deprecated. Note that module unload is explicitly not yet supported. Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> [v1: Rebased with different order of patches] [v2: Removed [CLEANCACHE|FRONTSWAP]_HAS_LAZY_INIT ifdef] [v3: Rebased on top of ramster->zcache move] [v4: Redid the Makefile] [v5: s/ZCACHE2/ZCACHE/] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Bob Liu <lliubbo@gmail.com> Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com> Cc: Andor Daam <andor.daam@googlemail.com> Cc: Florian Schmaus <fschmaus@gmail.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Stefan Hengelein <ilendir@googlemail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-05-01staging: zcache: enable ramster to be built/loaded as a moduleDan Magenheimer7-13/+39
Enable module support for ramster. Note runtime dependency disallows loading if cleancache/frontswap lazy initialization patches are not present. If built-in (not built as a module), the original mechanism of enabling via a kernel boot parameter is retained, but this should be considered deprecated. Note that module unload is explicitly not yet supported. [v1: Fixed compile issues since ramster_init now has four arguments] [v2: Fixed rebase on ramster->zcache move] [akpm@linux-foundation.org: use_frontswap_selfshrink cannot be __initdata] Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Bob Liu <lliubbo@gmail.com> Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com> Cc: Andor Daam <andor.daam@googlemail.com> Cc: Florian Schmaus <fschmaus@gmail.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Stefan Hengelein <ilendir@googlemail.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-05-01zcache/tmem: Better error checking on frontswap_register_ops return value.Konrad Rzeszutek Wilk1-1/+4
In the past it either used to be NULL or the "older" backend. Now we also return -Exx error codes. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Bob Liu <lliubbo@gmail.com> Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com> Cc: Andor Daam <andor.daam@googlemail.com> Cc: Dan Magenheimer <dan.magenheimer@oracle.com> Cc: Florian Schmaus <fschmaus@gmail.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Stefan Hengelein <ilendir@googlemail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-05-01cleancache: Make cleancache_init use a pointer for the opsKonrad Rzeszutek Wilk1-4/+4
Instead of using a backend_registered to determine whether a backend is enabled. This allows us to remove the backend_register check and just do 'if (cleancache_ops)' [v1: Rebase on top of b97c4b430b0a (ramster->zcache move] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Bob Liu <lliubbo@gmail.com> Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com> Cc: Andor Daam <andor.daam@googlemail.com> Cc: Dan Magenheimer <dan.magenheimer@oracle.com> Cc: Florian Schmaus <fschmaus@gmail.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Stefan Hengelein <ilendir@googlemail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-05-01frontswap: make frontswap_init use a pointer for the opsKonrad Rzeszutek Wilk1-4/+4
This simplifies the code in the frontswap - we can get rid of the 'backend_registered' test and instead check against frontswap_ops. [v1: Rebase on top of 703ba7fe5e0 (ramster->zcache move] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Bob Liu <lliubbo@gmail.com> Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com> Cc: Andor Daam <andor.daam@googlemail.com> Cc: Dan Magenheimer <dan.magenheimer@oracle.com> Cc: Florian Schmaus <fschmaus@gmail.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Stefan Hengelein <ilendir@googlemail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-13staging: zcache/debug: fix coding styleWanpeng Li1-19/+76
Fix coding style issue: ERROR: space prohibited before that '++' (ctx:WxO) and line beyond 8 characters. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-13staging: ramster/debug: Add CONFIG_RAMSTER_DEBUG Kconfig entryWanpeng Li3-2/+10
Add CONFIG_RAMSTER_DEBUG Kconfig entry. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-13staging: ramster: Add incremental accessory countersWanpeng Li2-16/+83
Add incremental accessory counters that are going to be used for debug fs entries. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-13staging: ramster/debug: Use an array to initialize/use debugfs attributesWanpeng Li1-36/+32
Use an array to initialize/use debugfs attributes, it makes them neater as zcache/debug.c does. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-13staging: ramster: Move debugfs code out of ramster.c fileWanpeng Li4-110/+154
Note that at this point there is no CONFIG_RAMSTER_DEBUG option in the Kconfig. So in effect all of the counters are nop until that option gets introduced in patch: ramster/debug: Add CONFIG_RAMSTER_DEBUG Kconfig entry Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-13staging: ramster: decrease foregin pers pages when count < 0Wanpeng Li1-0/+1
commit 9a5c59687ad ("staging: ramster: Provide accessory functions for counter decrease") forget decrease foregin pers pages, this patch fix it. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-12staging: ramster: Provide accessory functions for counter decreaseWanpeng Li1-13/+19
This patch enables these functions to be wrapped and can disable/enable this with CONFIG_DEBUG_FS. Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-12staging: ramster: Provide accessory functions for counter increaseWanpeng Li1-11/+23
This patch enables these functions to be wrapped and can disable/enable this with CONFIG_DEBUG_FS. Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-11staging: zcache: fix account foregin counters against zero-filled pagesWanpeng Li1-4/+4
zero-filled pages won't be compressed and sent to remote system. Monitor the number ephemeral and persistent pages that Ramster has sent make no sense. This patch skip account foregin counters against zero-filled pages. Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-04staging: zcache: clean TODO listWanpeng Li1-2/+1
Cleanup TODO list since support zero-filled pages more efficiently has already done by this patchset. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-04staging: zcache: introduce zero-filled page stat countWanpeng Li3-0/+24
Introduce zero-filled page statistics to monitor the number of zero-filled pages. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-04staging: zcache: fix static variables defined in debug.h but used in mutiple ↵Wanpeng Li2-31/+63
C files After commit 95bdaee214 ("zcache: Move debugfs code out of zcache-main.c file") be merged, most of knods in zcache debugfs just export zero since these variables are defined in debug.h but are in use in multiple C files zcache-main.c and debug.c, in this case variables can't be treated as shared variables. Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-02staging: zcache: fix zcache writeback in debugfsWanpeng Li1-2/+2
commit 9c0ad59ef ("zcache/debug: Use an array to initialize/use debugfs attributes") use an array to initialize/use debugfs attributes, .name = #x, .val = &zcache_##x. For zcache writeback, this commit set .name = zcache_outstanding_writeback_pages and .name = zcache_writtenback_pages seperately, however, corresponding .val = &zcache_zcache_outstanding_writeback_pages and .val = &zcache_zcache_writtenback_pages, which are not correct. Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-02staging: zcache: fix pers_pageframes|_max aren't exported in debugfsWanpeng Li1-0/+1
Before commit 9c0ad59ef ("zcache/debug: Use an array to initialize/use debugfs attributes"), pers_pageframes|_max are exported in debugfs, but this commit forgot use array export pers_pageframes|_max. This patch add pers_pageframes|_max back. Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-02staging: zcache: handle zcache_[eph|pers]_zpages for zero-filled pageWanpeng Li1-1/+6
Increment/decrement zcache_[eph|pers]_zpages for zero-filled pages, the main point of the counters for zpages and pageframes is to be able to calculate density == zpages/pageframes. A zero-filled page becomes a zpage that "compresses" to zero bytes and, as a result, requires zero pageframes for storage. So the zpages counter should be increased but the pageframes counter should not. [Dan Magenheimer <dan.magenheimer@oracle.com>: patch description] Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-02staging: zcache: zero-filled pages awarenessWanpeng Li1-13/+70
Compression of zero-filled pages can unneccessarily cause internal fragmentation, and thus waste memory. This special case can be optimized. This patch captures zero-filled pages, and marks their corresponding zcache backing page entry as zero-filled. Whenever such zero-filled page is retrieved, we fill the page frame with zero. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-02staging: zcache: introduce zero-filled pages handlerWanpeng Li1-0/+27
Introduce zero-filled pages handler to capture and handle zero pages. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-02drivers: staging: zcache: fix compile warningBob Liu1-1/+1
Fix below compile warning: staging/zcache/zcache-main.c: In function ‘zcache_autocreate_pool’: staging/zcache/zcache-main.c:1393:13: warning: ‘cli’ may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Bob Liu <bob.liu@oracle.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-02drivers: staging: zcache: fix compile errorBob Liu3-4/+10
Because 'ramster_debugfs_init' is not defined if !CONFIG_DEBUG_FS, there is compile error: $ make drivers/staging/zcache/ staging/zcache/ramster/ramster.c: In function ‘ramster_init’: staging/zcache/ramster/ramster.c:981:2: error: implicit declaration of function ‘ramster_debugfs_init’ [-Werror=implicit-function-declaration] This patch fix it and reduce some #ifdef CONFIG_DEBUG_FS in .c files the same way. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Bob Liu <bob.liu@oracle.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-01Merge 3.9-rc5 into staging-nextGreg Kroah-Hartman1-1/+1
This pulls in all of the good fixes we need here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-27drivers/staging/zcache/zcache-main.c: fix buildAndrew Morton1-26/+0
flush_dcache_page() takes a page*, not a void*. It breaks ia64. Remove this and another unused function. Warnings remain: drivers/staging/zcache/zcache-main.c: In function '__check_disable_cleancache': drivers/staging/zcache/zcache-main.c:1837: warning: return from incompatible pointer type drivers/staging/zcache/zcache-main.c: In function '__check_disable_frontswap': drivers/staging/zcache/zcache-main.c:1838: warning: return from incompatible pointer type drivers/staging/zcache/zcache-main.c: In function '__check_disable_frontswap_ignore_nonactive': drivers/staging/zcache/zcache-main.c:1842: warning: return from incompatible pointer type Cc: Dan Magenheimer <dan.magenheimer@oracle.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-19staging: zcache: introduce zero filled pages handlerWanpeng Li1-0/+26
Introduce zero-filled pages handler to capture and handle zero pages. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-19zcache/TODO: Update on two items.Konrad Rzeszutek Wilk1-5/+1
Two of them (zcache DebugFS cleanup) and the module loading capability are now in linux-next for v3.10. Also Bob Liu is full-time going to help on knocking these items off the list. CC: bob.liu@oracle.com Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-19staging: zcache: fix typo "64_BIT"Paul Bolle1-1/+1
Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-18Merge 3.9-rc3 into staging-nextGreg Kroah-Hartman1-15/+10
This resolves the merge error due to removing the ccg staging driver, and picks up the other staging driver fixes that went into 3.9-rc3. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-14zcache: convert to idr_alloc()Tejun Heo1-15/+10
idr_get_new*() and friends are about to be deprecated. Convert to the new idr_alloc() interface. Only compile tested. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Dan Magenheimer <dan.magenheimer@oracle.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-03-11staging: zcache: using strlcpy instead of strncpyChen Gang1-1/+2
for NUL terminated string, need alway set '\0' in the end. Signed-off-by: Chen Gang <gang.chen@asianux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-08staging: zcache/debug: compiler failure on PPC64 and revert commit.Konrad Rzeszutek Wilk2-1/+2
On PPC64 we get this: In file included from drivers/staging/zcache/debug.c:2: drivers/staging/zcache/debug.h: In function 'dec_zcache_obj_count': drivers/staging/zcache/debug.h:16: error: implicit declaration of function 'BUG_ON' This simple patch adds the appropiate header file to finish the compile and reverts "staging: zcache: disable ZCACHE_DEBUG due to build error" (5db5a20a50cfd078c78b13a988f237cca81aedc5) Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-06staging: zcache: disable ZCACHE_DEBUG due to build errorStephen Rothwell1-0/+1
In file included from drivers/staging/zcache/debug.c:2:0: drivers/staging/zcache/debug.h: In function 'dec_zcache_obj_count': drivers/staging/zcache/debug.h:16:2: error: implicit declaration of function 'BUG_ON' [-Werror=implicit-function-declaration] Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05zcache/debug: Coalesce all debug under CONFIG_ZCACHE_DEBUGKonrad Rzeszutek Wilk3-4/+12
and also define this extra attribute in the Kconfig entry. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05zcache: Module license is defined twice.Konrad Rzeszutek Wilk1-2/+0
The other (same license) is at the end of the file. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05zcache: Move the last of the debugfs counters outKonrad Rzeszutek Wilk2-66/+89
We now have in zcache-main only the counters that are are not debugfs related. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05zcache/debug: Use an array to initialize/use debugfs attributes.Konrad Rzeszutek Wilk1-112/+51
It makes it neater and also allows us to piggyback on that in the zcache_dump function. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05zcache: Move debugfs code out of zcache-main.c file.Konrad Rzeszutek Wilk4-256/+328
Note that at this point there is no CONFIG_ZCACHE_DEBUG option in the Kconfig. So in effect all of the counters are nop until that option gets re-introduced in: zcache/debug: Coalesce all debug under CONFIG_ZCACHE_DEBUG Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> [v1: Fixed conflicts due to rebase] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05zcache: Make the debug code use pr_debugKonrad Rzeszutek Wilk1-44/+41
as if you are debugging this driver you would be using 'debug' on the command line anyhow - and this would dump the debug data on the proper loglevel. While at it also remove the unconditional #define ZCACHE_DEBUG. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05zcache: The last of the atomic reads has now an accessory function.Konrad Rzeszutek Wilk1-4/+9
And now we can move the code ([inc|dec]_zcache_[*]) to their own file with a header to make them nops or feed in debugfs. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05zcache: Provide accessory functions for counter decrease.Konrad Rzeszutek Wilk1-39/+57
This way we can have all wrapped with these functions and can disable/enable this with CONFIG_DEBUG_FS. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> [v2: Rebase on top of staging/zcache: Fix/improve zcache writeback code, tie to a config option] [v3: Rebase on top of zcache: Fix compile warnings due to usage of debugfs_create_size_t] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05zcache: Provide accessory functions for counter increaseKonrad Rzeszutek Wilk1-36/+73
This is the first step in moving the debugfs code out of the main file in-to another file. And also allow the code to run without CONFIG_DEBUG_FS defined. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> [v2: Rebase on top staging/zcache: Fix/improve zcache writeback code, tie to a config option] [v3: Rebase on top of zcache: Fix compile warnings due to usage of debugfs_create_size_t] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05zcache: s/int/bool/ on the various options.Konrad Rzeszutek Wilk1-15/+15
There are so many, but this allows us to at least have them right in as bool. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> [v1: Rebase on ramster->zcache move] [v2: Rebase on staging/zcache: Fix/improve zcache writeback code, tie to a config option] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-24mm: rename page struct field helpersMel Gorman1-1/+1
The function names page_xchg_last_nid(), page_last_nid() and reset_page_last_nid() were judged to be inconsistent so rename them to a struct_field_op style pattern. As it looked jarring to have reset_page_mapcount() and page_nid_reset_last() beside each other in memmap_init_zone(), this patch also renames reset_page_mapcount() to page_mapcount_reset(). There are others like init_page_count() but as it is used throughout the arch code a rename would likely cause more conflicts than it is worth. [akpm@linux-foundation.org: fix zcache] Signed-off-by: Mel Gorman <mgorman@suse.de> Suggested-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-18staging/zache checkpatch ERROR: spaces prohibited around thatRobert Berger1-2/+2
zbud.c:106: ERROR: spaces prohibited around that ':' (ctx:VxW) zbud.c:107: ERROR: spaces prohibited around that ':' (ctx:VxW) Signed-off-by: Robert Berger <rber.git@ReliableEmbeddedSystems.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15zcache/zbud: Fix __init mismatchKonrad Rzeszutek Wilk1-1/+1
We get: WARNING: drivers/staging/zcache/zcache.o(.text+0x13a1): Section mismatch in reference from the function zcache_init() to the function .init.text:zbud_init() The function zcache_init() references the function __init zbud_init(). This is often because zcache_init lacks a __init annotation or the annotation of zbud_init is wrong. And this fixes it. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>