[PATCH v2 15/18] zsmalloc: migrate head page of zspage

2016-03-20 Thread Minchan Kim
This patch introduces run-time migration feature for zspage. To begin with, it supports only head page migration for easy review(later patches will support tail page migration). For migration, it supports three functions * zs_page_isolate It isolates a zspage which includes a subpage VM want to

[PATCH v2 14/18] mm/balloon: use general movable page feature into balloon

2016-03-20 Thread Minchan Kim
Now, VM has a feature to migrate non-lru movable pages so balloon doesn't need custom migration hooks in migrate.c and compact.c. Instead, this patch implements page->mapping ->{isolate|migrate|putback} functions. With that, we could remove hooks for ballooning in general migration functions and m

[PATCH v2 17/18] zsmalloc: migrate tail pages in zspage

2016-03-20 Thread Minchan Kim
This patch enables tail page migration of zspage. In this point, I tested zsmalloc regression with micro-benchmark which does zs_malloc/map/unmap/zs_free for all size class in every CPU(my system is 12) during 20 sec. It shows 1% regression which is really small when we consider the benefit of th

[PATCH v2 13/18] mm/compaction: support non-lru movable page migration

2016-03-20 Thread Minchan Kim
We have allowed migration for only LRU pages until now and it was enough to make high-order pages. But recently, embedded system(e.g., webOS, android) uses lots of non-movable pages(e.g., zram, GPU memory) so we have seen several reports about troubles of small high-order allocation. For fixing the

[PATCH v2 18/18] zram: use __GFP_MOVABLE for memory allocation

2016-03-20 Thread Minchan Kim
Zsmalloc is ready for page migration so zram can use __GFP_MOVABLE from now on. I did test to see how it helps to make higher order pages. Test scenario is as follows. KVM guest, 1G memory, ext4 formated zram block device, for i in `seq 1 8`; do dd if=/dev/vda1 of=mnt/test$i.txt bs=128M

[PATCH v2 12/18] zsmalloc: zs_compact refactoring

2016-03-20 Thread Minchan Kim
Currently, we rely on class->lock to prevent zspage destruction. It was okay until now because the critical section is short but with run-time migration, it could be long so class->lock is not a good apporach any more. So, this patch introduces [un]freeze_zspage functions which freeze allocated ob

[PATCH v2 16/18] zsmalloc: use single linked list for page chain

2016-03-20 Thread Minchan Kim
For tail page migration, we shouldn't use page->lru which was used for page chaining because VM will use it for own purpose so that we need another field for chaining. For chaining, singly linked list is enough and page->index of tail page to point first object offset in the page could be replaced

[PATCH v2 10/18] zsmalloc: factor page chain functionality out

2016-03-20 Thread Minchan Kim
For migration, we need to create sub-page chain of zspage dynamically so this patch factors it out from alloc_zspage. As a minor refactoring, it makes OBJ_ALLOCATED_TAG assign more clear in obj_malloc(it could be another patch but it's trivial so I want to put together in this patch). Signed-off-

[PATCH v2 11/18] zsmalloc: separate free_zspage from putback_zspage

2016-03-20 Thread Minchan Kim
Currently, putback_zspage does free zspage under class->lock if fullness become ZS_EMPTY but it makes trouble to implement locking scheme for new zspage migration. So, this patch is to separate free_zspage from putback_zspage and free zspage out of class->lock which is preparation for zspage migrat

[PATCH v2 09/18] zsmalloc: move struct zs_meta from mapping to freelist

2016-03-20 Thread Minchan Kim
For supporting migration from VM, we need to have address_space on every page so zsmalloc shouldn't use page->mapping. So, this patch moves zs_meta from mapping to freelist. Signed-off-by: Minchan Kim --- mm/zsmalloc.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(

[PATCH v2 07/18] zsmalloc: squeeze inuse into page->mapping

2016-03-20 Thread Minchan Kim
Currently, we store class:fullness into page->mapping. The number of class we can support is 255 and fullness is 4 so (8 + 2 = 10bit) is enough to represent them. Meanwhile, the bits we need to store in-use objects in zspage is that 11bit is enough. For example, If we assume that 64K PAGE_SIZE, cl

[PATCH v2 08/18] zsmalloc: squeeze freelist into page->mapping

2016-03-20 Thread Minchan Kim
Zsmalloc stores first free object's position into first_page->freelist in each zspage. If we change it with object index from first_page instead of location, we could squeeze it into page->mapping because the number of bit we need to store offset is at most 11bit. Signed-off-by: Minchan Kim ---

[PATCH v2 06/18] zsmalloc: keep max_object in size_class

2016-03-20 Thread Minchan Kim
Every zspage in a size_class has same number of max objects so we could move it to a size_class. Signed-off-by: Minchan Kim --- mm/zsmalloc.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index a0890e9003e2..8

[PATCH v2 03/18] zsmalloc: clean up many BUG_ON

2016-03-20 Thread Minchan Kim
There are many BUG_ON in zsmalloc.c which is not recommened so change them as alternatives. Normal rule is as follows: 1. avoid BUG_ON if possible. Instead, use VM_BUG_ON or VM_BUG_ON_PAGE 2. use VM_BUG_ON_PAGE if we need to see struct page's fields 3. use those assertion in primitive functions s

[PATCH v2 05/18] zsmalloc: remove unused pool param in obj_free

2016-03-20 Thread Minchan Kim
Let's remove unused pool param in obj_free Reviewed-by: Sergey Senozhatsky Signed-off-by: Minchan Kim --- mm/zsmalloc.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 16556a6db628..a0890e9003e2 100644 --- a/mm/zsmalloc.c +++ b/mm/z

[PATCH v2 02/18] zsmalloc: use first_page rather than page

2016-03-20 Thread Minchan Kim
This patch cleans up function parameter "struct page". Many functions of zsmalloc expects that page paramter is "first_page" so use "first_page" rather than "page" for code readability. Reviewed-by: Sergey Senozhatsky Signed-off-by: Minchan Kim --- mm/zsmalloc.c | 62 +++

[PATCH v2 04/18] zsmalloc: reordering function parameter

2016-03-20 Thread Minchan Kim
This patch cleans up function parameter ordering to order higher data structure first. Reviewed-by: Sergey Senozhatsky Signed-off-by: Minchan Kim --- mm/zsmalloc.c | 50 ++ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/mm/zsmallo

[PATCH v2 00/18] Support non-lru page migration

2016-03-20 Thread Minchan Kim
Recently, I got many reports about perfermance degradation in embedded system(Android mobile phone, webOS TV and so on) and failed to fork easily. The problem was fragmentation caused by zram and GPU driver pages. Their pages cannot be migrated so compaction cannot work well, either so reclaimer e

[PATCH v2 01/18] mm: use put_page to free page instead of putback_lru_page

2016-03-20 Thread Minchan Kim
Procedure of page migration is as follows: First of all, it should isolate a page from LRU and try to migrate the page. If it is successful, it releases the page for freeing. Otherwise, it should put the page back to LRU list. For LRU pages, we have used putback_lru_page for both freeing and putb

[PULL] virtio/vhost: new features, performance improvements, cleanups

2016-03-20 Thread Michael S. Tsirkin
The following changes since commit e1f33be9186363da7955bcb5f0b03e6685544c50: vhost: fix error path in vhost_init_used() (2016-03-02 17:01:49 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus for you to fetch changes up

Re: [net-next v2] virtio_net: replace netdev_alloc_skb_ip_align() with napi_alloc_skb()

2016-03-20 Thread Michael S. Tsirkin
On Fri, Mar 18, 2016 at 04:42:48PM +0100, Paolo Abeni wrote: > This gives small but noticeable rx performance improvement (2-3%) > and will allow exploiting future napi improvement. > > Signed-off-by: Paolo Abeni I am not sure this is necessarily worth doing for this dumb hardware. I queued v1 i

Re: [PATCH] gpu/drm: Use u64_to_user_pointer

2016-03-20 Thread kbuild test robot
Hi Joe, [auto build test WARNING on drm/drm-next] [also build test WARNING on next-20160318] [cannot apply to v4.5] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/Joe-Perches/gpu-drm-Use-u64_t

Re: [net-next v2] virtio_net: replace netdev_alloc_skb_ip_align() with napi_alloc_skb()

2016-03-20 Thread Venkatesh Srinivas via Virtualization
On Fri, Mar 18, 2016 at 8:42 AM, Paolo Abeni wrote: > This gives small but noticeable rx performance improvement (2-3%) > and will allow exploiting future napi improvement. > > Signed-off-by: Paolo Abeni > > -- > v2: replace also netdev_alloc_skb_ip_align() invocation in > add_recvbuf_sm