[PATCH v1 15/19] zsmalloc: zs_compact refactoring

2016-03-10 Thread Minchan Kim
ocated objects in the zspage with pinning tag so user cannot free using object. With those functions, this patch redesign compaction. Those functions will be used for implementing zspage runtime migrations, too. Signed-off-by: Minchan Kim --- mm/zsmalloc.c

[PATCH v1 16/19] zsmalloc: migrate head page of zspage

2016-03-10 Thread Minchan Kim
, too right before calling ->migratepage so such race doesn't exist any more. Signed-off-by: Minchan Kim --- mm/zsmalloc.c | 291 +++--- 1 file changed, 280 insertions(+), 11 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc

[PATCH v1 19/19] zram: use __GFP_MOVABLE for memory allocation

2016-03-10 Thread Minchan Kim
ode 0, zone DMA214 66 87 29 10 3 0 0 0 0 0 Node 0, zoneDMA32 1612 3139 3154 2469 1745990384 94 7 0 0 As you can see, compaction made so many high-order pages. Yay! Signed-off-by: Minchan Kim --- driver

[PATCH v1 17/19] zsmalloc: use single linked list for page chain

2016-03-10 Thread Minchan Kim
be replaced in run-time calculation. So, this patch change page->lru list for chaining with singly linked list via page->freelist squeeze and introduces get_first_obj_ofs to get first object offset in a page. With that, it could maintain page chaining without using page->lru. Signed

[PATCH v1 12/19] zsmalloc: move struct zs_meta from mapping to freelist

2016-03-10 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 d

[PATCH v1 14/19] zsmalloc: separate free_zspage from putback_zspage

2016-03-10 Thread Minchan Kim
zspage migration. Signed-off-by: Minchan Kim --- mm/zsmalloc.c | 46 +++--- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f86f8aaeb902..49ae6531b7ad 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -945,7

[PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping

2016-03-10 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:

[PATCH v1 13/19] zsmalloc: factor page chain functionality out

2016-03-10 Thread Minchan Kim
d-off-by: Minchan Kim --- mm/zsmalloc.c | 78 ++- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index bfc6a048afac..f86f8aaeb902 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -977,7 +

[PATCH v1 10/19] zsmalloc: squeeze inuse into page->mapping

2016-03-10 Thread Minchan Kim
could squeeze inuse object count to page->mapping. Signed-off-by: Minchan Kim --- mm/zsmalloc.c | 103 -- 1 file changed, 71 insertions(+), 32 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index ca663c82c1fc..954e8758a78d 100644

[PATCH v1 02/19] mm/compaction: support non-lru movable page migration

2016-03-10 Thread Minchan Kim
4. If migration fails, putback function of subsystem should clear PG_isolated via ClearPageIsolated. Cc: Vlastimil Babka Cc: Mel Gorman Cc: Hugh Dickins Cc: dri-de...@lists.freedesktop.org Cc: virtualization@lists.linux-foundation.org Signed-off-by: Gioh Kim Signed-off-by: Minch

[PATCH v1 09/19] zsmalloc: keep max_object in size_class

2016-03-10 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 | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index b4fb11831acb

[PATCH v1 04/19] mm/balloon: use general movable page feature into balloon

2016-03-10 Thread Minchan Kim
nctions and make balloon compaction simple. Cc: virtualization@lists.linux-foundation.org Cc: Rafael Aquini Cc: Konstantin Khlebnikov Signed-off-by: Gioh Kim Signed-off-by: Minchan Kim --- drivers/virtio/virtio_balloon.c| 4 ++ include/linux/balloon_compaction.h | 47 ---

[PATCH v1 03/19] fs/anon_inodes: new interface to create new inode

2016-03-10 Thread Minchan Kim
f-by: Gioh Kim Signed-off-by: Minchan Kim --- fs/anon_inodes.c| 6 ++ include/linux/anon_inodes.h | 1 + 2 files changed, 7 insertions(+) diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c index 80ef38c73e5a..1d51f96acdd9 100644 --- a/fs/anon_inodes.c +++ b/fs/anon_inodes.c @@ -162

[PATCH v1 07/19] zsmalloc: reordering function parameter

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

[PATCH v1 06/19] zsmalloc: clean up many BUG_ON

2016-03-10 Thread Minchan Kim
tions so higher functions can rely on the assertion in the primitive function. 4. Don't use assertion if following instruction can trigger Oops Signed-off-by: Minchan Kim --- mm/zsmalloc.c | 42 +++--- 1 file changed, 15 insertions(+), 27 deletions(-) di

[PATCH v1 05/19] zsmalloc: use first_page rather than page

2016-03-10 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. Signed-off-

[PATCH v1 08/19] zsmalloc: remove unused pool param in obj_free

2016-03-10 Thread Minchan Kim
Let's remove unused pool param in obj_free 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 156edf909046..b4fb11831acb 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1435,8 +1

[PATCH v1 01/19] mm: use put_page to free page instead of putback_lru_page

2016-03-10 Thread Minchan Kim
Mel Gorman Cc: Hugh Dickins Cc: Naoya Horiguchi Signed-off-by: Minchan Kim --- mm/migrate.c | 49 ++--- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 3ad0fea5c438..bf31ea9ffaf8 100644 --- a/mm/migrate.

[PATCH v1 00/19] Support non-lru page migration

2016-03-10 Thread Minchan Kim
ed list for page chain zsmalloc: migrate tail pages in zspage zram: use __GFP_MOVABLE for memory allocation Gioh Kim (1): fs/anon_inodes: new interface to create new inode Minchan Kim (18): mm: use put_page to free page instead of putback_lru_page mm/compaction: support non-lru movable pag

Re: [PATCH 2/2] virtio_balloon: fix race between migration and ballooning

2016-01-10 Thread Minchan Kim
On Sun, Jan 10, 2016 at 11:40:17PM +0200, Michael S. Tsirkin wrote: > On Mon, Jan 04, 2016 at 09:27:47AM +0900, Minchan Kim wrote: > > > I think this will cause deadlocks. > > > > > > pages_lock now nests within page lock, balloon_page_putback > > > nests

Re: [PATCH 2/2] virtio_balloon: fix race between migration and ballooning

2016-01-08 Thread Minchan Kim
On Fri, Jan 08, 2016 at 02:56:14PM -0500, Rafael Aquini wrote: > On Fri, Jan 01, 2016 at 11:36:13AM +0200, Michael S. Tsirkin wrote: > > On Mon, Dec 28, 2015 at 08:35:13AM +0900, Minchan Kim wrote: > > > In balloon_page_dequeue, pages_lock should cover the loop > > > (i

Re: [PATCH 2/2] virtio_balloon: fix race between migration and ballooning

2016-01-03 Thread Minchan Kim
On Fri, Jan 01, 2016 at 11:36:13AM +0200, Michael S. Tsirkin wrote: > On Mon, Dec 28, 2015 at 08:35:13AM +0900, Minchan Kim wrote: > > In balloon_page_dequeue, pages_lock should cover the loop > > (ie, list_for_each_entry_safe). Otherwise, the cursor page could > > be isola

[PATCH 1/2] virtio_balloon: fix race by fill and leak

2015-12-27 Thread Minchan Kim
so struct virtio_balloon fields could be overwritten by race of fill_balloon(e,g, vb->*pfns could be critical). This patch fixes it in my test. Cc: Signed-off-by: Minchan Kim --- drivers/virtio/virtio_balloon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virti

[PATCH 2/2] virtio_balloon: fix race between migration and ballooning

2015-12-27 Thread Minchan Kim
ce buffer: (ftrace buffer empty) Kernel Offset: disabled Cc: Signed-off-by: Minchan Kim --- mm/balloon_compaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c index d3116be5a00f..300117f1a08f 100644 --- a/mm/balloon_com

Re: [PATCH 2/4] mm/compaction: enable mobile-page migration

2015-08-10 Thread Minchan Kim
On Fri, Jul 31, 2015 at 07:43:09PM +0900, Minchan Kim wrote: > Hi Gioh, > > On Mon, Jul 13, 2015 at 05:35:17PM +0900, Gioh Kim wrote: > > From: Gioh Kim > > > > Add framework to register callback functions and check page mobility. > > There are some modes f

Re: [PATCH 2/4] mm/compaction: enable mobile-page migration

2015-07-31 Thread Minchan Kim
Hi Gioh, On Mon, Jul 13, 2015 at 05:35:17PM +0900, Gioh Kim wrote: > From: Gioh Kim > > Add framework to register callback functions and check page mobility. > There are some modes for page isolation so that isolate interface > has arguments of page address and isolation mode while putback > int

Re: [RFCv3 0/5] enable migration of driver pages

2015-07-07 Thread Minchan Kim
>>page. > >>>> > >>>>My ARM-based platform occured severe fragmentation problem after long-term > >>>>(several days) test. Sometimes even order-3 page allocation failed. It has > >>>>memory size 512MB ~ 1024MB. 30% ~ 40% memory is con

Re: [RFC 0/4] enable migration of non-LRU pages

2015-06-09 Thread Minchan Kim
times even order-3 page allocation failed. It has > memory size 512MB ~ 1024MB. 30% ~ 40% memory is consumed for graphic > processing > and 20~30 memory is reserved for zram. > > I found that many pages of GPU driver and zram are non-movable pages. So I > reported Minchan Kim, the mai

Re: [PATCH] add generic callbacks into compaction

2015-04-06 Thread Minchan Kim
+ if (unlikely(isolated_migratable_page(page))) > + page->mapping->a_ops->putbackpage(page); > else > putback_lru_page(page); As I said, how about having putback_lru_page for page->mapping->a_ops->putb

Re: [PATCH v7 3/4] mm: introduce putback_movable_pages()

2012-08-12 Thread Minchan Kim
ages(). > > Signed-off-by: Rafael Aquini Reviewed-by: Minchan Kim Thanks for your good work, Rafael. -- Kind regards, Minchan Kim ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v7 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-08-12 Thread Minchan Kim
e them movable by memory > compaction procedures. > > Signed-off-by: Rafael Aquini Reviewed-by: Minchan Kim -- Kind regards, Minchan Kim ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v6 1/3] mm: introduce compaction and migration for virtio ballooned pages

2012-08-08 Thread Minchan Kim
gt; @@ -79,7 +79,10 @@ void putback_lru_pages(struct list_head *l) > list_del(&page->lru); > dec_zone_page_state(page, NR_ISOLATED_ANON + > page_is_file_cache(page)); > - putback_lru_page(page); > + if (unlikely(movable_balloon_page(page))) > + WARN_ON(!putback_balloon_page(page)); > + else > + putback_lru_page(page); > } Don't hack putback_lru_pages. It's a function for handling LRU pages and is used by several places. Plz, don't add complexity to unrelavant parts. You can define a new function putback_migratepages should be used as pair with isolate_migratepages_range so that both functions are aware of balloon page. IMHO, it's better abstraction rather than hook of generic function. Otherwise, Looks good to me. Thanks. -- Kind regards, Minchan Kim ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v4 1/3] mm: introduce compaction and migration for virtio ballooned pages

2012-07-23 Thread Minchan Kim
On Mon, Jul 23, 2012 at 11:33:32AM +0900, Minchan Kim wrote: > Hi Rafael, > > On Fri, Jul 20, 2012 at 04:48:59PM -0300, Rafael Aquini wrote: > > Howdy Minchan, > > > > Once again, thanks for raising such valuable feedback over here. > > > > On Wed, Jul 18

Re: [PATCH v4 1/3] mm: introduce compaction and migration for virtio ballooned pages

2012-07-23 Thread Minchan Kim
Hi Rafael, On Fri, Jul 20, 2012 at 04:48:59PM -0300, Rafael Aquini wrote: > Howdy Minchan, > > Once again, thanks for raising such valuable feedback over here. > > On Wed, Jul 18, 2012 at 02:48:24PM +0900, Minchan Kim wrote: > > > +/* __isolate_lru_page() counterp

Re: [PATCH v4 1/3] mm: introduce compaction and migration for virtio ballooned pages

2012-07-18 Thread Minchan Kim
} > out: > if (rc != -EAGAIN) { > /* > -- > 1.7.10.4 The feeling I look at your code in detail is that it makes compaction/migration code rather complicated because compaction/migration assumes source/target would be LRU pages. How often memory balloo

Re: [PATCH v2 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-07-02 Thread Minchan Kim
e callbacks are used at isolate_balloon_page() & > putback_balloon_page(). What do you think? > > I am not strongly against you. It trivial nitpick must not prevent your great work. :) Thanks! -- Kind regards, Minchan Kim ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v2 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-07-02 Thread Minchan Kim
>* Corner case handling: >* 1. When a new swap-cache page is read into, it is added to the LRU > @@ -852,6 +866,20 @@ static int unmap_and_move(new_page_t get_new_page, > unsigned long private, > goto out; > > rc = __un

Re: [PATCH v2 0/4] make balloon pages movable by compaction

2012-07-02 Thread Minchan Kim
ns, we allocates ballooned page as a movable page in guest-side because they can be migrated easily so compaction of guest-side could put together them into either side so that we can get contiguous memory. For it, compaction should be aware of ballooned page. Right? -- Kind rega

Re: [PATCH v2 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-29 Thread Minchan Kim
Hi Rafael, On Fri, Jun 29, 2012 at 02:36:54PM -0300, Rafael Aquini wrote: > On Fri, Jun 29, 2012 at 02:32:11PM +0900, Minchan Kim wrote: > > On 06/29/2012 06:49 AM, Rafael Aquini wrote: > > > > > This patch introduces the helper functions as well as the necessary >

Re: [Question] power management related with cgroup based resource management

2008-10-27 Thread MinChan Kim
essage to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > -- Kinds regards, MinChan Kim ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/virtualization

<    1   2