<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/staging/zsmalloc, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/staging/zsmalloc?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/staging/zsmalloc?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2014-01-31T00:56:55Z</updated>
<entry>
<title>zsmalloc: move it under mm</title>
<updated>2014-01-31T00:56:55Z</updated>
<author>
<name>Minchan Kim</name>
<email>minchan@kernel.org</email>
</author>
<published>2014-01-30T23:45:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bcf1647d0899666f0fb90d176abf63bae22abb7c'/>
<id>urn:sha1:bcf1647d0899666f0fb90d176abf63bae22abb7c</id>
<content type='text'>
This patch moves zsmalloc under mm directory.

Before that, description will explain why we have needed custom
allocator.

Zsmalloc is a new slab-based memory allocator for storing compressed
pages.  It is designed for low fragmentation and high allocation success
rate on large object, but &lt;= PAGE_SIZE allocations.

zsmalloc differs from the kernel slab allocator in two primary ways to
achieve these design goals.

zsmalloc never requires high order page allocations to back slabs, or
"size classes" in zsmalloc terms.  Instead it allows multiple
single-order pages to be stitched together into a "zspage" which backs
the slab.  This allows for higher allocation success rate under memory
pressure.

Also, zsmalloc allows objects to span page boundaries within the zspage.
This allows for lower fragmentation than could be had with the kernel
slab allocator for objects between PAGE_SIZE/2 and PAGE_SIZE.  With the
kernel slab allocator, if a page compresses to 60% of it original size,
the memory savings gained through compression is lost in fragmentation
because another object of the same size can't be stored in the leftover
space.

This ability to span pages results in zsmalloc allocations not being
directly addressable by the user.  The user is given an
non-dereferencable handle in response to an allocation request.  That
handle must be mapped, using zs_map_object(), which returns a pointer to
the mapped region that can be used.  The mapping is necessary since the
object data may reside in two different noncontigious pages.

The zsmalloc fulfills the allocation needs for zram perfectly

[sjenning@linux.vnet.ibm.com: borrow Seth's quote]
Signed-off-by: Minchan Kim &lt;minchan@kernel.org&gt;
Acked-by: Nitin Gupta &lt;ngupta@vflare.org&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: Bob Liu &lt;bob.liu@oracle.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Luigi Semenzato &lt;semenzato@google.com&gt;
Cc: Mel Gorman &lt;mgorman@suse.de&gt;
Cc: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Seth Jennings &lt;sjenning@linux.vnet.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>staging: delete non-required instances of include &lt;linux/init.h&gt;</title>
<updated>2013-12-17T18:08:14Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2013-12-10T20:23:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=885a947e5b08953ebd5fce88be89a0399a7ab918'/>
<id>urn:sha1:885a947e5b08953ebd5fce88be89a0399a7ab918</id>
<content type='text'>
None of these files are actually using any __init type directives
and hence don't need to include &lt;linux/init.h&gt;.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>zsmalloc: add more comment</title>
<updated>2013-12-11T02:20:05Z</updated>
<author>
<name>Nitin Cupta</name>
<email>ngupta@vflare.org</email>
</author>
<published>2013-12-11T02:04:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c3e3e88adccb3119b69484c56798ec616307a94f'/>
<id>urn:sha1:c3e3e88adccb3119b69484c56798ec616307a94f</id>
<content type='text'>
This patch adds lots of comments and it will help others
to review and enhance.

Signed-off-by: Seth Jennings &lt;sjenning@linux.vnet.ibm.com&gt;
Signed-off-by: Nitin Gupta &lt;ngupta@vflare.org&gt;
Signed-off-by: Minchan Kim &lt;minchan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>zsmalloc: add Kconfig for enabling page table method</title>
<updated>2013-12-11T02:20:05Z</updated>
<author>
<name>Minchan Kim</name>
<email>minchan@kernel.org</email>
</author>
<published>2013-12-11T02:04:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1b945aeef0b9cb5e98d682c310272b08198e54b5'/>
<id>urn:sha1:1b945aeef0b9cb5e98d682c310272b08198e54b5</id>
<content type='text'>
Zsmalloc has two methods 1) copy-based and 2) pte based to
access objects that span two pages.
You can see history why we supported two approach from [1].

But it was bad choice that adding hard coding to select arch
which want to use pte based method because there are lots of
SoC in an architecure and they can have different cache size,
CPU speed and so on so it would be better to expose it to user
as selectable Kconfig option like Andrew Morton suggested.

[1] https://lkml.org/lkml/2012/7/11/58

Acked-by: Nitin Gupta &lt;ngupta@vflare.org&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Minchan Kim &lt;minchan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: zsmalloc: Ensure handle is never 0 on success</title>
<updated>2013-11-25T20:52:45Z</updated>
<author>
<name>Olav Haugan</name>
<email>ohaugan@codeaurora.org</email>
</author>
<published>2013-11-22T17:30:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=67296874eb1cc80317bf2a8fba22b494e21eb29b'/>
<id>urn:sha1:67296874eb1cc80317bf2a8fba22b494e21eb29b</id>
<content type='text'>
zsmalloc encodes a handle using the pfn and an object
index. On hardware platforms with physical memory starting
at 0x0 the pfn can be 0. This causes the encoded handle to be
0 and is incorrectly interpreted as an allocation failure.

This issue affects all current and future SoCs with physical
memory starting at 0x0. All MSM8974 SoCs which includes
Google Nexus 5 devices are affected.

To prevent this false error we ensure that the encoded handle
will not be 0 when allocation succeeds.

Signed-off-by: Olav Haugan &lt;ohaugan@codeaurora.org&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>zsmalloc: Fix "map_vm_area" undefined reference errors.</title>
<updated>2013-10-11T22:23:13Z</updated>
<author>
<name>Majunath Goudar</name>
<email>csmanjuvijay@gmail.com</email>
</author>
<published>2013-10-08T10:32:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=8addac75a1ab0d8bd5fd25dbbc58e02ddfb089c9'/>
<id>urn:sha1:8addac75a1ab0d8bd5fd25dbbc58e02ddfb089c9</id>
<content type='text'>
This patch adds a MMU dependency to configure the ZSMALLOC in
drivers/staging/zsmalloc/Kconfig. Without this patch, build
system can lead to build failure. This was observed during
randconfig testing, in which ZSMALLOC was enabled w/o MMU being
enabled. Following was the error:

LD      vmlinux
drivers/built-in.o: In function `__zs_map_object':
drivers/staging/zsmalloc/zsmalloc-main.c:650: undefined reference to `map_vm_area'
make: *** [vmlinux] Error 1

Signed-off-by: Manjunath Goudar &lt;csmanjuvijay@gmail.com&gt;
Cc: Nitin Gupta &lt;ngupta@vflare.org&gt;
Cc: Seth Jennings &lt;sjenning@linux.vnet.ibm.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Joerg Roedel &lt;joro@8bytes.org&gt;
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: zsmalloc: access page-&gt;private by using page_private macro</title>
<updated>2013-07-23T21:52:19Z</updated>
<author>
<name>Sunghan Suh</name>
<email>sunghan.suh@samsung.com</email>
</author>
<published>2013-07-12T07:08:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e842b976a88a39b447fc34bd0fcb3c0be0a1d9d9'/>
<id>urn:sha1:e842b976a88a39b447fc34bd0fcb3c0be0a1d9d9</id>
<content type='text'>
Signed-off-by: Sunghan Suh &lt;sunghan.suh@samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging/zsmalloc: Fixed up incorrect formatted comments</title>
<updated>2013-05-21T17:30:10Z</updated>
<author>
<name>Sara Bird</name>
<email>sara.bird.iar@gmail.com</email>
</author>
<published>2013-05-20T19:18:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=396b7fd6f9668c04f20ee6daca3054f5c5ec1056'/>
<id>urn:sha1:396b7fd6f9668c04f20ee6daca3054f5c5ec1056</id>
<content type='text'>
The existing comments are using an odd style. Fixed them up to adhere
to the StyleGuide. No code changes.

Signed-off-by: Sara Bird &lt;sara.bird.iar@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Staging: Fixes string split across lines in zsmalloc zsmalloc-main</title>
<updated>2013-05-20T17:43:10Z</updated>
<author>
<name>Marlies Ruck</name>
<email>marlies.ruck@gmail.com</email>
</author>
<published>2013-05-15T20:56:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=93ad5ab50476aa7e2b33aac31f41d0efc9f729d7'/>
<id>urn:sha1:93ad5ab50476aa7e2b33aac31f41d0efc9f729d7</id>
<content type='text'>
Fixes the following checkpatch warning:
WARNING: quoted string split across lines

Signed-off-by: Marlies Ruck &lt;marlies.ruck@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging/zsmalloc: don't use pgtable-mapping from modules</title>
<updated>2013-04-23T17:34:20Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2013-04-23T16:30:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=796ce5a7e4ef88ee0bfbeaa80070a51570650d57'/>
<id>urn:sha1:796ce5a7e4ef88ee0bfbeaa80070a51570650d57</id>
<content type='text'>
Building zsmalloc as a module does not work on ARM because it uses
an interface that is not exported:

ERROR: "flush_tlb_kernel_range" [drivers/staging/zsmalloc/zsmalloc.ko] undefined!

Since this is only used as a performance optimization and only on ARM,
we can avoid the problem simply by not using that optimization when
building zsmalloc it is a loadable module.

flush_tlb_kernel_range is often an inline function, but out of the
architectures that use an extern function, only powerpc exports
it.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Seth Jennings &lt;sjenning@linux.vnet.ibm.com&gt;
Cc: Nitin Gupta &lt;ngupta@vflare.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
