Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1355648 > unrolled thread

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

Started byMinchan Kim <minchan@kernel.org>
First post2016-03-11 08:40 +0100
Last post2016-03-11 08:40 +0100
Articles 3 on this page of 23 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v1 00/19] Support non-lru page migration Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
    [PATCH v1 13/19] zsmalloc: factor page chain functionality out Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
      Re: [PATCH v1 13/19] zsmalloc: factor page chain functionality out xuyiping <xuyiping@hisilicon.com> - 2016-03-12 04:20 +0100
        Re: [PATCH v1 13/19] zsmalloc: factor page chain functionality out Minchan Kim <minchan@kernel.org> - 2016-03-14 06:00 +0100
    [PATCH v1 08/19] zsmalloc: remove unused pool param in obj_free Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
    [PATCH v1 12/19] zsmalloc: move struct zs_meta from mapping to freelist Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
    [PATCH v1 17/19] zsmalloc: use single linked list for page chain Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
    [PATCH v1 07/19] zsmalloc: reordering function parameter Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
      Re: [PATCH v1 07/19] zsmalloc: reordering function parameter Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-15 07:20 +0100
    [PATCH v1 05/19] zsmalloc: use first_page rather than page Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
      Re: [PATCH v1 05/19] zsmalloc: use first_page rather than page Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-15 07:20 +0100
    [PATCH v1 06/19] zsmalloc: clean up many BUG_ON Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
    [PATCH v1 04/19] mm/balloon: use general movable page feature into balloon Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
    [PATCH v1 15/19] zsmalloc: zs_compact refactoring Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
    [PATCH v1 01/19] mm: use put_page to free page instead of putback_lru_page Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
      Re: [PATCH v1 01/19] mm: use put_page to free page instead of  putback_lru_page Vlastimil Babka <vbabka@suse.cz> - 2016-03-14 09:50 +0100
        Re: [PATCH v1 01/19] mm: use put_page to free page instead of  putback_lru_page Minchan Kim <minchan@kernel.org> - 2016-03-15 02:20 +0100
          Re: [PATCH v1 01/19] mm: use put_page to free page instead of  putback_lru_page Vlastimil Babka <vbabka@suse.cz> - 2016-03-15 20:10 +0100
    [PATCH v1 18/19] zsmalloc: migrate tail pages in zspage Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
    [PATCH v1 02/19] mm/compaction: support non-lru movable page migration Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100
      Re: [PATCH v1 02/19] mm/compaction: support non-lru movable page  migration kbuild test robot <lkp@intel.com> - 2016-03-11 09:20 +0100
        Re: [PATCH v1 02/19] mm/compaction: support non-lru movable page  migration Minchan Kim <minchan@kernel.org> - 2016-03-11 09:40 +0100
    [PATCH v1 14/19] zsmalloc: separate free_zspage from putback_zspage Minchan Kim <minchan@kernel.org> - 2016-03-11 08:40 +0100

Page 2 of 2 — ← Prev page 1 [2]


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

Fromkbuild test robot <lkp@intel.com>
Date2016-03-11 09:20 +0100
SubjectRe: [PATCH v1 02/19] mm/compaction: support non-lru movable page migration
Message-ID<rbqsG-3iZ-15@gated-at.bofh.it>
In reply to#1355662

[Multipart message — attachments visible in raw view] — view raw

Hi Minchan,

[auto build test ERROR on v4.5-rc7]
[cannot apply to next-20160310]
[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/Minchan-Kim/Support-non-lru-page-migration/20160311-153649
config: x86_64-nfsroot (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   In file included from mm/compaction.c:12:0:
>> include/linux/compaction.h:87:20: error: static declaration of 'isolate_movable_page' follows non-static declaration
    static inline bool isolate_movable_page(struct page *page, isolate_mode_t mode)
                       ^
   In file included from mm/compaction.c:11:0:
   include/linux/migrate.h:36:13: note: previous declaration of 'isolate_movable_page' was here
    extern bool isolate_movable_page(struct page *page, isolate_mode_t mode);
                ^
   In file included from mm/compaction.c:12:0:
>> include/linux/compaction.h:92:20: error: static declaration of 'putback_movable_page' follows non-static declaration
    static inline void putback_movable_page(struct page *page)
                       ^
   In file included from mm/compaction.c:11:0:
   include/linux/migrate.h:37:13: note: previous declaration of 'putback_movable_page' was here
    extern void putback_movable_page(struct page *page);
                ^

vim +/isolate_movable_page +87 include/linux/compaction.h

    81	
    82	static inline bool compaction_deferred(struct zone *zone, int order)
    83	{
    84		return true;
    85	}
    86	
  > 87	static inline bool isolate_movable_page(struct page *page, isolate_mode_t mode)
    88	{
    89		return false;
    90	}
    91	
  > 92	static inline void putback_movable_page(struct page *page)
    93	{
    94	}
    95	#endif /* CONFIG_COMPACTION */

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


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

FromMinchan Kim <minchan@kernel.org>
Date2016-03-11 09:40 +0100
SubjectRe: [PATCH v1 02/19] mm/compaction: support non-lru movable page migration
Message-ID<rbqM1-3qq-5@gated-at.bofh.it>
In reply to#1355684
Hi kbuild,

On Fri, Mar 11, 2016 at 04:11:19PM +0800, kbuild test robot wrote:
> Hi Minchan,
> 
> [auto build test ERROR on v4.5-rc7]
> [cannot apply to next-20160310]
> [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/Minchan-Kim/Support-non-lru-page-migration/20160311-153649
> config: x86_64-nfsroot (attached as .config)
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from mm/compaction.c:12:0:
> >> include/linux/compaction.h:87:20: error: static declaration of 'isolate_movable_page' follows non-static declaration
>     static inline bool isolate_movable_page(struct page *page, isolate_mode_t mode)
>                        ^
>    In file included from mm/compaction.c:11:0:
>    include/linux/migrate.h:36:13: note: previous declaration of 'isolate_movable_page' was here
>     extern bool isolate_movable_page(struct page *page, isolate_mode_t mode);
>                 ^
>    In file included from mm/compaction.c:12:0:
> >> include/linux/compaction.h:92:20: error: static declaration of 'putback_movable_page' follows non-static declaration
>     static inline void putback_movable_page(struct page *page)
>                        ^
>    In file included from mm/compaction.c:11:0:
>    include/linux/migrate.h:37:13: note: previous declaration of 'putback_movable_page' was here
>     extern void putback_movable_page(struct page *page);
>                 ^
> 
> vim +/isolate_movable_page +87 include/linux/compaction.h
> 
>     81	
>     82	static inline bool compaction_deferred(struct zone *zone, int order)
>     83	{
>     84		return true;
>     85	}
>     86	
>   > 87	static inline bool isolate_movable_page(struct page *page, isolate_mode_t mode)
>     88	{
>     89		return false;
>     90	}
>     91	
>   > 92	static inline void putback_movable_page(struct page *page)
>     93	{
>     94	}
>     95	#endif /* CONFIG_COMPACTION */
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Actually, I made patchset based on v4.5-rc6 but the problem you found is
still problem in v4.5-rc6, too. Thanks for catching it fast.

I should apply following patch to fix the problem.

diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index 6f040ad379ce..4cd4ddf64cc7 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -84,14 +84,6 @@ static inline bool compaction_deferred(struct zone *zone, int order)
 	return true;
 }
 
-static inline bool isolate_movable_page(struct page *page, isolate_mode_t mode)
-{
-	return false;
-}
-
-static inline void putback_movable_page(struct page *page)
-{
-}
 #endif /* CONFIG_COMPACTION */
 
 #if defined(CONFIG_COMPACTION) && defined(CONFIG_SYSFS) && defined(CONFIG_NUMA)

Thanks.

[toc] | [prev] | [next] | [standalone]


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

FromMinchan Kim <minchan@kernel.org>
Date2016-03-11 08:40 +0100
Subject[PATCH v1 14/19] zsmalloc: separate free_zspage from putback_zspage
Message-ID<rbpPZ-2Oc-47@gated-at.bofh.it>
In reply to#1355648
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 migration.

Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 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 +945,8 @@ static void reset_page(struct page *page)
 	page_mapcount_reset(page);
 }
 
-static void free_zspage(struct page *first_page)
+static void free_zspage(struct zs_pool *pool, struct size_class *class,
+			struct page *first_page)
 {
 	struct page *nextp, *tmp, *head_extra;
 
@@ -968,6 +969,11 @@ static void free_zspage(struct page *first_page)
 	}
 	reset_page(head_extra);
 	__free_page(head_extra);
+
+	zs_stat_dec(class, OBJ_ALLOCATED, get_maxobj_per_zspage(
+			class->size, class->pages_per_zspage));
+	atomic_long_sub(class->pages_per_zspage,
+				&pool->pages_allocated);
 }
 
 /* Initialize a newly allocated zspage */
@@ -1557,13 +1563,8 @@ void zs_free(struct zs_pool *pool, unsigned long handle)
 	spin_lock(&class->lock);
 	obj_free(class, obj);
 	fullness = fix_fullness_group(class, first_page);
-	if (fullness == ZS_EMPTY) {
-		zs_stat_dec(class, OBJ_ALLOCATED, get_maxobj_per_zspage(
-				class->size, class->pages_per_zspage));
-		atomic_long_sub(class->pages_per_zspage,
-				&pool->pages_allocated);
-		free_zspage(first_page);
-	}
+	if (fullness == ZS_EMPTY)
+		free_zspage(pool, class, first_page);
 	spin_unlock(&class->lock);
 	unpin_tag(handle);
 
@@ -1750,7 +1751,7 @@ static struct page *isolate_target_page(struct size_class *class)
  * @class: destination class
  * @first_page: target page
  *
- * Return @fist_page's fullness_group
+ * Return @first_page's updated fullness_group
  */
 static enum fullness_group putback_zspage(struct zs_pool *pool,
 			struct size_class *class,
@@ -1762,15 +1763,6 @@ static enum fullness_group putback_zspage(struct zs_pool *pool,
 	insert_zspage(class, fullness, first_page);
 	set_zspage_mapping(first_page, class->index, fullness);
 
-	if (fullness == ZS_EMPTY) {
-		zs_stat_dec(class, OBJ_ALLOCATED, get_maxobj_per_zspage(
-			class->size, class->pages_per_zspage));
-		atomic_long_sub(class->pages_per_zspage,
-				&pool->pages_allocated);
-
-		free_zspage(first_page);
-	}
-
 	return fullness;
 }
 
@@ -1833,23 +1825,31 @@ static void __zs_compact(struct zs_pool *pool, struct size_class *class)
 			if (!migrate_zspage(pool, class, &cc))
 				break;
 
-			putback_zspage(pool, class, dst_page);
+			VM_BUG_ON_PAGE(putback_zspage(pool, class,
+				dst_page) == ZS_EMPTY, dst_page);
 		}
 
 		/* Stop if we couldn't find slot */
 		if (dst_page == NULL)
 			break;
 
-		putback_zspage(pool, class, dst_page);
-		if (putback_zspage(pool, class, src_page) == ZS_EMPTY)
+		VM_BUG_ON_PAGE(putback_zspage(pool, class,
+				dst_page) == ZS_EMPTY, dst_page);
+		if (putback_zspage(pool, class, src_page) == ZS_EMPTY) {
 			pool->stats.pages_compacted += class->pages_per_zspage;
-		spin_unlock(&class->lock);
+			spin_unlock(&class->lock);
+			free_zspage(pool, class, src_page);
+		} else {
+			spin_unlock(&class->lock);
+		}
+
 		cond_resched();
 		spin_lock(&class->lock);
 	}
 
 	if (src_page)
-		putback_zspage(pool, class, src_page);
+		VM_BUG_ON_PAGE(putback_zspage(pool, class,
+				src_page) == ZS_EMPTY, src_page);
 
 	spin_unlock(&class->lock);
 }
-- 
1.9.1

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web