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


Groups > linux.kernel > #1232162 > unrolled thread

[PATCH 00/16] Refreshed page-flags patchset

Started by"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
First post2015-09-24 17:00 +0200
Last post2015-09-24 22:30 +0200
Articles 13 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 00/16] Refreshed page-flags patchset "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2015-09-24 17:00 +0200
    [PATCH 12/16] page-flags: define PG_mlocked behavior on compound pages "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2015-09-24 17:00 +0200
    [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2015-09-24 17:00 +0200
      Re: [PATCH 03/16] page-flags: introduce page flags policies wrt  compound pages Konstantin Khlebnikov <khlebnikov@yandex-team.ru> - 2015-09-25 14:30 +0200
        Re: [PATCH 03/16] page-flags: introduce page flags policies wrt  compound pages "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-25 21:20 +0200
          Re: [PATCH 03/16] page-flags: introduce page flags policies wrt  compound pages "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-28 13:10 +0200
            Re: [PATCH 03/16] page-flags: introduce page flags policies wrt  compound pages Konstantin Khlebnikov <khlebnikov@yandex-team.ru> - 2015-09-28 13:50 +0200
              Re: [PATCH 03/16] page-flags: introduce page flags policies wrt  compound pages "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-28 20:00 +0200
    [PATCH 04/16] page-flags: define PG_locked behavior on compound pages "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2015-09-24 17:00 +0200
      Re: [PATCH 04/16] page-flags: define PG_locked behavior on compound  pages Christoph Lameter <cl@linux.com> - 2015-09-24 18:10 +0200
        Re: [PATCH 04/16] page-flags: define PG_locked behavior on compound  pages "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-24 22:30 +0200
    Re: [PATCH 00/16] Refreshed page-flags patchset Christoph Lameter <cl@linux.com> - 2015-09-24 18:20 +0200
      Re: [PATCH 00/16] Refreshed page-flags patchset "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-24 22:30 +0200

#1232162 — [PATCH 00/16] Refreshed page-flags patchset

From"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Date2015-09-24 17:00 +0200
Subject[PATCH 00/16] Refreshed page-flags patchset
Message-ID<qcga6-6cP-5@gated-at.bofh.it>
As requested, here's reworked version of page-flags patchset.
Updated version should fit more naturally into current code base.

Kirill A. Shutemov (16):
  page-flags: trivial cleanup for PageTrans* helpers
  page-flags: move code around
  page-flags: introduce page flags policies wrt compound pages
  page-flags: define PG_locked behavior on compound pages
  page-flags: define behavior of FS/IO-related flags on compound pages
  page-flags: define behavior of LRU-related flags on compound pages
  page-flags: define behavior SL*B-related flags on compound pages
  page-flags: define behavior of Xen-related flags on compound pages
  page-flags: define PG_reserved behavior on compound pages
  page-flags: define PG_swapbacked behavior on compound pages
  page-flags: define PG_swapcache behavior on compound pages
  page-flags: define PG_mlocked behavior on compound pages
  page-flags: define PG_uncached behavior on compound pages
  page-flags: define PG_uptodate behavior on compound pages
  page-flags: look at head page if the flag is encoded in page->mapping
  mm: sanitize page->mapping for tail pages

 fs/cifs/file.c             |   8 +-
 include/linux/page-flags.h | 236 +++++++++++++++++++++++++--------------------
 include/linux/pagemap.h    |  25 ++---
 include/linux/poison.h     |   4 +
 mm/filemap.c               |  15 +--
 mm/huge_memory.c           |   2 +-
 mm/ksm.c                   |   2 +-
 mm/memory-failure.c        |   2 +-
 mm/memory.c                |   2 +-
 mm/migrate.c               |   2 +-
 mm/page_alloc.c            |   6 ++
 mm/shmem.c                 |   4 +-
 mm/slub.c                  |   2 +
 mm/swap_state.c            |   4 +-
 mm/util.c                  |  10 +-
 mm/vmscan.c                |   2 +-
 16 files changed, 182 insertions(+), 144 deletions(-)

-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1232164 — [PATCH 12/16] page-flags: define PG_mlocked behavior on compound pages

From"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Date2015-09-24 17:00 +0200
Subject[PATCH 12/16] page-flags: define PG_mlocked behavior on compound pages
Message-ID<qcga9-6cP-63@gated-at.bofh.it>
In reply to#1232162
Transparent huge pages can be mlocked -- whole compund page at once.
Something went wrong if we're trying to mlock() tail page.
Let's use PF_NO_TAIL.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
 include/linux/page-flags.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index c933416b2f92..31e68a8c2777 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -316,8 +316,10 @@ PAGEFLAG(Unevictable, unevictable, PF_HEAD)
 	TESTCLEARFLAG(Unevictable, unevictable, PF_HEAD)
 
 #ifdef CONFIG_MMU
-PAGEFLAG(Mlocked, mlocked, PF_ANY) __CLEARPAGEFLAG(Mlocked, mlocked, PF_ANY)
-	TESTSCFLAG(Mlocked, mlocked, PF_ANY) __TESTCLEARFLAG(Mlocked, mlocked, PF_ANY)
+PAGEFLAG(Mlocked, mlocked, PF_NO_TAIL)
+	__CLEARPAGEFLAG(Mlocked, mlocked, PF_NO_TAIL)
+	TESTSCFLAG(Mlocked, mlocked, PF_NO_TAIL)
+	__TESTCLEARFLAG(Mlocked, mlocked, PF_NO_TAIL)
 #else
 PAGEFLAG_FALSE(Mlocked) __CLEARPAGEFLAG_NOOP(Mlocked)
 	TESTSCFLAG_FALSE(Mlocked) __TESTCLEARFLAG_FALSE(Mlocked)
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1232165 — [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages

From"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Date2015-09-24 17:00 +0200
Subject[PATCH 03/16] page-flags: introduce page flags policies wrt compound pages
Message-ID<qcga8-6cP-57@gated-at.bofh.it>
In reply to#1232162
This patch adds a third argument to macros which create function
definitions for page flags.  This argument defines how page-flags helpers
behave on compound functions.

For now we define four policies:

- PF_ANY: the helper function operates on the page it gets, regardless
  if it's non-compound, head or tail.

- PF_HEAD: the helper function operates on the head page of the compound
  page if it gets tail page.

- PF_NO_TAIL: only head and non-compond pages are acceptable for this
  helper function.

- PF_NO_COMPOUND: only non-compound pages are acceptable for this helper
  function.

For now we use policy PF_ANY for all helpers, which matches current
behaviour.

We do not enforce the policy for TESTPAGEFLAG, because we have flags
checked for random pages all over the kernel.  Noticeable exception to
this is PageTransHuge() which triggers VM_BUG_ON() for tail page.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
 include/linux/page-flags.h | 154 ++++++++++++++++++++++++++-------------------
 1 file changed, 90 insertions(+), 64 deletions(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 713d3f2c2468..1b3babe5ff69 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -154,49 +154,68 @@ static inline int PageCompound(struct page *page)
 	return test_bit(PG_head, &page->flags) || PageTail(page);
 }
 
+/* Page flags policies wrt compound pages */
+#define PF_ANY(page, enforce)	page
+#define PF_HEAD(page, enforce)	compound_head(page)
+#define PF_NO_TAIL(page, enforce) ({					\
+		if (enforce)						\
+			VM_BUG_ON_PAGE(PageTail(page), page);		\
+		else							\
+			page = compound_head(page);			\
+		page;})
+#define PF_NO_COMPOUND(page, enforce) ({					\
+		if (enforce)						\
+			VM_BUG_ON_PAGE(PageCompound(page), page);	\
+		page;})
+
 /*
  * Macros to create function definitions for page flags
  */
-#define TESTPAGEFLAG(uname, lname)					\
-static inline int Page##uname(const struct page *page)			\
-			{ return test_bit(PG_##lname, &page->flags); }
+#define TESTPAGEFLAG(uname, lname, policy)				\
+static inline int Page##uname(struct page *page)			\
+	{ return test_bit(PG_##lname, &policy(page, 0)->flags); }
 
-#define SETPAGEFLAG(uname, lname)					\
+#define SETPAGEFLAG(uname, lname, policy)				\
 static inline void SetPage##uname(struct page *page)			\
-			{ set_bit(PG_##lname, &page->flags); }
+	{ set_bit(PG_##lname, &policy(page, 1)->flags); }
 
-#define CLEARPAGEFLAG(uname, lname)					\
+#define CLEARPAGEFLAG(uname, lname, policy)				\
 static inline void ClearPage##uname(struct page *page)			\
-			{ clear_bit(PG_##lname, &page->flags); }
+	{ clear_bit(PG_##lname, &policy(page, 1)->flags); }
 
-#define __SETPAGEFLAG(uname, lname)					\
+#define __SETPAGEFLAG(uname, lname, policy)				\
 static inline void __SetPage##uname(struct page *page)			\
-			{ __set_bit(PG_##lname, &page->flags); }
+	{ __set_bit(PG_##lname, &policy(page, 1)->flags); }
 
-#define __CLEARPAGEFLAG(uname, lname)					\
+#define __CLEARPAGEFLAG(uname, lname, policy)				\
 static inline void __ClearPage##uname(struct page *page)		\
-			{ __clear_bit(PG_##lname, &page->flags); }
+	{ __clear_bit(PG_##lname, &policy(page, 1)->flags); }
 
-#define TESTSETFLAG(uname, lname)					\
+#define TESTSETFLAG(uname, lname, policy)				\
 static inline int TestSetPage##uname(struct page *page)			\
-		{ return test_and_set_bit(PG_##lname, &page->flags); }
+	{ return test_and_set_bit(PG_##lname, &policy(page, 1)->flags); }
 
-#define TESTCLEARFLAG(uname, lname)					\
+#define TESTCLEARFLAG(uname, lname, policy)				\
 static inline int TestClearPage##uname(struct page *page)		\
-		{ return test_and_clear_bit(PG_##lname, &page->flags); }
+	{ return test_and_clear_bit(PG_##lname, &policy(page, 1)->flags); }
 
-#define __TESTCLEARFLAG(uname, lname)					\
+#define __TESTCLEARFLAG(uname, lname, policy)				\
 static inline int __TestClearPage##uname(struct page *page)		\
-		{ return __test_and_clear_bit(PG_##lname, &page->flags); }
+	{ return __test_and_clear_bit(PG_##lname, &policy(page, 1)->flags); }
 
-#define PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname)		\
-	SETPAGEFLAG(uname, lname) CLEARPAGEFLAG(uname, lname)
+#define PAGEFLAG(uname, lname, policy)					\
+	TESTPAGEFLAG(uname, lname, policy)				\
+	SETPAGEFLAG(uname, lname, policy)				\
+	CLEARPAGEFLAG(uname, lname, policy)
 
-#define __PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname)		\
-	__SETPAGEFLAG(uname, lname)  __CLEARPAGEFLAG(uname, lname)
+#define __PAGEFLAG(uname, lname, policy)				\
+	TESTPAGEFLAG(uname, lname, policy)				\
+	__SETPAGEFLAG(uname, lname, policy)				\
+	__CLEARPAGEFLAG(uname, lname, policy)
 
-#define TESTSCFLAG(uname, lname)					\
-	TESTSETFLAG(uname, lname) TESTCLEARFLAG(uname, lname)
+#define TESTSCFLAG(uname, lname, policy)				\
+	TESTSETFLAG(uname, lname, policy)				\
+	TESTCLEARFLAG(uname, lname, policy)
 
 #define TESTPAGEFLAG_FALSE(uname)					\
 static inline int Page##uname(const struct page *page) { return 0; }
@@ -225,46 +244,48 @@ static inline int __TestClearPage##uname(struct page *page) { return 0; }
 #define TESTSCFLAG_FALSE(uname)						\
 	TESTSETFLAG_FALSE(uname) TESTCLEARFLAG_FALSE(uname)
 
-
-TESTPAGEFLAG(Locked, locked)
-PAGEFLAG(Error, error) TESTCLEARFLAG(Error, error)
-PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced)
-	__SETPAGEFLAG(Referenced, referenced)
-PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty)
-PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru)
-PAGEFLAG(Active, active) __CLEARPAGEFLAG(Active, active)
-	TESTCLEARFLAG(Active, active)
-__PAGEFLAG(Slab, slab)
-PAGEFLAG(Checked, checked)		/* Used by some filesystems */
-PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned)	/* Xen */
-PAGEFLAG(SavePinned, savepinned);			/* Xen */
-PAGEFLAG(Foreign, foreign);				/* Xen */
-PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved)
-PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked)
-	__SETPAGEFLAG(SwapBacked, swapbacked)
-
-__PAGEFLAG(SlobFree, slob_free)
+TESTPAGEFLAG(Locked, locked, PF_ANY)
+PAGEFLAG(Error, error, PF_ANY) TESTCLEARFLAG(Error, error, PF_ANY)
+PAGEFLAG(Referenced, referenced, PF_ANY) TESTCLEARFLAG(Referenced, referenced, PF_ANY)
+	__SETPAGEFLAG(Referenced, referenced, PF_ANY)
+PAGEFLAG(Dirty, dirty, PF_ANY) TESTSCFLAG(Dirty, dirty, PF_ANY)
+	__CLEARPAGEFLAG(Dirty, dirty, PF_ANY)
+PAGEFLAG(LRU, lru, PF_ANY) __CLEARPAGEFLAG(LRU, lru, PF_ANY)
+PAGEFLAG(Active, active, PF_ANY) __CLEARPAGEFLAG(Active, active, PF_ANY)
+	TESTCLEARFLAG(Active, active, PF_ANY)
+__PAGEFLAG(Slab, slab, PF_ANY)
+PAGEFLAG(Checked, checked, PF_ANY)		/* Used by some filesystems */
+PAGEFLAG(Pinned, pinned, PF_ANY) TESTSCFLAG(Pinned, pinned, PF_ANY)	/* Xen */
+PAGEFLAG(SavePinned, savepinned, PF_ANY);			/* Xen */
+PAGEFLAG(Foreign, foreign, PF_ANY);				/* Xen */
+PAGEFLAG(Reserved, reserved, PF_ANY) __CLEARPAGEFLAG(Reserved, reserved, PF_ANY)
+PAGEFLAG(SwapBacked, swapbacked, PF_ANY)
+	__CLEARPAGEFLAG(SwapBacked, swapbacked, PF_ANY)
+	__SETPAGEFLAG(SwapBacked, swapbacked, PF_ANY)
+
+__PAGEFLAG(SlobFree, slob_free, PF_ANY)
 
 /*
  * Private page markings that may be used by the filesystem that owns the page
  * for its own purposes.
  * - PG_private and PG_private_2 cause releasepage() and co to be invoked
  */
-PAGEFLAG(Private, private) __SETPAGEFLAG(Private, private)
-	__CLEARPAGEFLAG(Private, private)
-PAGEFLAG(Private2, private_2) TESTSCFLAG(Private2, private_2)
-PAGEFLAG(OwnerPriv1, owner_priv_1) TESTCLEARFLAG(OwnerPriv1, owner_priv_1)
+PAGEFLAG(Private, private, PF_ANY) __SETPAGEFLAG(Private, private, PF_ANY)
+	__CLEARPAGEFLAG(Private, private, PF_ANY)
+PAGEFLAG(Private2, private_2, PF_ANY) TESTSCFLAG(Private2, private_2, PF_ANY)
+PAGEFLAG(OwnerPriv1, owner_priv_1, PF_ANY)
+	TESTCLEARFLAG(OwnerPriv1, owner_priv_1, PF_ANY)
 
 /*
  * Only test-and-set exist for PG_writeback.  The unconditional operators are
  * risky: they bypass page accounting.
  */
-TESTPAGEFLAG(Writeback, writeback) TESTSCFLAG(Writeback, writeback)
-PAGEFLAG(MappedToDisk, mappedtodisk)
+TESTPAGEFLAG(Writeback, writeback, PF_ANY) TESTSCFLAG(Writeback, writeback, PF_ANY)
+PAGEFLAG(MappedToDisk, mappedtodisk, PF_ANY)
 
 /* PG_readahead is only used for reads; PG_reclaim is only for writes */
-PAGEFLAG(Reclaim, reclaim) TESTCLEARFLAG(Reclaim, reclaim)
-PAGEFLAG(Readahead, reclaim) TESTCLEARFLAG(Readahead, reclaim)
+PAGEFLAG(Reclaim, reclaim, PF_ANY) TESTCLEARFLAG(Reclaim, reclaim, PF_ANY)
+PAGEFLAG(Readahead, reclaim, PF_ANY) TESTCLEARFLAG(Readahead, reclaim, PF_ANY)
 
 #ifdef CONFIG_HIGHMEM
 /*
@@ -277,31 +298,32 @@ PAGEFLAG_FALSE(HighMem)
 #endif
 
 #ifdef CONFIG_SWAP
-PAGEFLAG(SwapCache, swapcache)
+PAGEFLAG(SwapCache, swapcache, PF_ANY)
 #else
 PAGEFLAG_FALSE(SwapCache)
 #endif
 
-PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable)
-	TESTCLEARFLAG(Unevictable, unevictable)
+PAGEFLAG(Unevictable, unevictable, PF_ANY)
+	__CLEARPAGEFLAG(Unevictable, unevictable, PF_ANY)
+	TESTCLEARFLAG(Unevictable, unevictable, PF_ANY)
 
 #ifdef CONFIG_MMU
-PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked)
-	TESTSCFLAG(Mlocked, mlocked) __TESTCLEARFLAG(Mlocked, mlocked)
+PAGEFLAG(Mlocked, mlocked, PF_ANY) __CLEARPAGEFLAG(Mlocked, mlocked, PF_ANY)
+	TESTSCFLAG(Mlocked, mlocked, PF_ANY) __TESTCLEARFLAG(Mlocked, mlocked, PF_ANY)
 #else
 PAGEFLAG_FALSE(Mlocked) __CLEARPAGEFLAG_NOOP(Mlocked)
 	TESTSCFLAG_FALSE(Mlocked) __TESTCLEARFLAG_FALSE(Mlocked)
 #endif
 
 #ifdef CONFIG_ARCH_USES_PG_UNCACHED
-PAGEFLAG(Uncached, uncached)
+PAGEFLAG(Uncached, uncached, PF_ANY)
 #else
 PAGEFLAG_FALSE(Uncached)
 #endif
 
 #ifdef CONFIG_MEMORY_FAILURE
-PAGEFLAG(HWPoison, hwpoison)
-TESTSCFLAG(HWPoison, hwpoison)
+PAGEFLAG(HWPoison, hwpoison, PF_ANY)
+TESTSCFLAG(HWPoison, hwpoison, PF_ANY)
 #define __PG_HWPOISON (1UL << PG_hwpoison)
 #else
 PAGEFLAG_FALSE(HWPoison)
@@ -309,10 +331,10 @@ PAGEFLAG_FALSE(HWPoison)
 #endif
 
 #if defined(CONFIG_IDLE_PAGE_TRACKING) && defined(CONFIG_64BIT)
-TESTPAGEFLAG(Young, young)
-SETPAGEFLAG(Young, young)
-TESTCLEARFLAG(Young, young)
-PAGEFLAG(Idle, idle)
+TESTPAGEFLAG(Young, young, PF_ANY)
+SETPAGEFLAG(Young, young, PF_ANY)
+TESTCLEARFLAG(Young, young, PF_ANY)
+PAGEFLAG(Idle, idle, PF_ANY)
 #endif
 
 /*
@@ -393,7 +415,7 @@ static inline void SetPageUptodate(struct page *page)
 	set_bit(PG_uptodate, &(page)->flags);
 }
 
-CLEARPAGEFLAG(Uptodate, uptodate)
+CLEARPAGEFLAG(Uptodate, uptodate, PF_ANY)
 
 int test_clear_page_writeback(struct page *page);
 int __test_set_page_writeback(struct page *page, bool keep_write);
@@ -413,7 +435,7 @@ static inline void set_page_writeback_keepwrite(struct page *page)
 	test_set_page_writeback_keepwrite(page);
 }
 
-__PAGEFLAG(Head, head) CLEARPAGEFLAG(Head, head)
+__PAGEFLAG(Head, head, PF_ANY) CLEARPAGEFLAG(Head, head, PF_ANY)
 
 static inline void set_compound_head(struct page *page, struct page *head)
 {
@@ -615,6 +637,10 @@ static inline int page_has_private(struct page *page)
 	return !!(page->flags & PAGE_FLAGS_PRIVATE);
 }
 
+#undef PF_ANY
+#undef PF_HEAD
+#undef PF_NO_TAIL
+#undef PF_NO_COMPOUND
 #endif /* !__GENERATING_BOUNDS_H */
 
 #endif	/* PAGE_FLAGS_H */
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1232758 — Re: [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages

FromKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Date2015-09-25 14:30 +0200
SubjectRe: [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages
Message-ID<qcAiv-1fs-19@gated-at.bofh.it>
In reply to#1232165
On 24.09.2015 17:50, Kirill A. Shutemov wrote:
> This patch adds a third argument to macros which create function
> definitions for page flags.  This argument defines how page-flags helpers
> behave on compound functions.
>
> For now we define four policies:
>
> - PF_ANY: the helper function operates on the page it gets, regardless
>    if it's non-compound, head or tail.
>
> - PF_HEAD: the helper function operates on the head page of the compound
>    page if it gets tail page.
>
> - PF_NO_TAIL: only head and non-compond pages are acceptable for this
>    helper function.
>
> - PF_NO_COMPOUND: only non-compound pages are acceptable for this helper
>    function.
>
> For now we use policy PF_ANY for all helpers, which matches current
> behaviour.
>
> We do not enforce the policy for TESTPAGEFLAG, because we have flags
> checked for random pages all over the kernel.  Noticeable exception to
> this is PageTransHuge() which triggers VM_BUG_ON() for tail page.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> ---
>   include/linux/page-flags.h | 154 ++++++++++++++++++++++++++-------------------
>   1 file changed, 90 insertions(+), 64 deletions(-)
>
> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> index 713d3f2c2468..1b3babe5ff69 100644
> --- a/include/linux/page-flags.h
> +++ b/include/linux/page-flags.h
> @@ -154,49 +154,68 @@ static inline int PageCompound(struct page *page)
>   	return test_bit(PG_head, &page->flags) || PageTail(page);
>   }
>
> +/* Page flags policies wrt compound pages */
> +#define PF_ANY(page, enforce)	page
> +#define PF_HEAD(page, enforce)	compound_head(page)
> +#define PF_NO_TAIL(page, enforce) ({					\
> +		if (enforce)						\
> +			VM_BUG_ON_PAGE(PageTail(page), page);		\
> +		else							\
> +			page = compound_head(page);			\
> +		page;})
> +#define PF_NO_COMPOUND(page, enforce) ({					\
> +		if (enforce)						\
> +			VM_BUG_ON_PAGE(PageCompound(page), page);	\

Linux next-20150925 crashes here (at least in lkvm)
if CONFIG_DEFERRED_STRUCT_PAGE_INIT=y

[    0.000000] Policy zone: DMA32
[    0.000000] Kernel command line: noapic noacpi pci=conf1 reboot=k 
panic=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 console=ttyS0 
earlyprintk=serial i8042.noaux=1  root=/dev/root rw 
rootflags=rw,trans=virtio,version=9p2000.L rootfstype=9p init=/virt/init 
  ip=dhcp
[    0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
[    0.000000] BUG: unable to handle kernel NULL pointer dereference at 
000000000000000c
[    0.000000] IP: [<ffffffff811aaafb>] dump_page_badflags+0x2b/0xe0
[    0.000000] PGD 0
[    0.000000] Oops: 0000 [#1] SMP
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 
4.3.0-rc2-next-20150925+ #2
[    0.000000] task: ffffffff81c12580 ti: ffffffff81c00000 task.ti: 
ffffffff81c00000
[    0.000000] RIP: 0010:[<ffffffff811aaafb>]  [<ffffffff811aaafb>] 
dump_page_badflags+0x2b/0xe0
[    0.000000] RSP: 0000:ffffffff81c03ea8  EFLAGS: 00010002
[    0.000000] RAX: 000000000000000c RBX: ffffea00006dfd40 RCX: 
0000000000000100
[    0.000000] RDX: 0000000000000001 RSI: ffffffff81a4aeb8 RDI: 
ffffea00006dfd40
[    0.000000] RBP: ffffffff81c03ec0 R08: 0000000000000000 R09: 
0000000000000000
[    0.000000] R10: 0000000000000001 R11: 0000000000000000 R12: 
0000000000000000
[    0.000000] R13: 000000000001b7f7 R14: ffffffff81fe50c0 R15: 
ffffffff81c03fb0
[    0.000000] FS:  0000000000000000(0000) GS:ffff88001a400000(0000) 
knlGS:0000000000000000
[    0.000000] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    0.000000] CR2: 000000000000000c CR3: 0000000001c0b000 CR4: 
00000000000406b0
[    0.000000] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 
0000000000000000
[    0.000000] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 
0000000000000400
[    0.000000] Stack:
[    0.000000]  000000000001b7f5 ffffea00006dfd40 000000000001b7f7 
ffffffff81c03ed0
[    0.000000]  ffffffff811aabc0 ffffffff81c03ef8 ffffffff81785eda 
ffffffff81c03f10
[    0.000000]  0000000000000040 ffffffff81fd99c0 ffffffff81c03f30 
ffffffff81f66600
[    0.000000] Call Trace:
[    0.000000]  [<ffffffff811aabc0>] dump_page+0x10/0x20
[    0.000000]  [<ffffffff81785eda>] reserve_bootmem_region+0xd9/0xe2
[    0.000000]  [<ffffffff81f66600>] free_all_bootmem+0x4b/0x11a
[    0.000000]  [<ffffffff81f5428d>] mem_init+0x6a/0x9d
[    0.000000]  [<ffffffff81f37d48>] start_kernel+0x214/0x46a
[    0.000000]  [<ffffffff81f37120>] ? early_idt_handler_array+0x120/0x120
[    0.000000]  [<ffffffff81f374d7>] x86_64_start_reservations+0x2a/0x2c
[    0.000000]  [<ffffffff81f3760f>] x86_64_start_kernel+0x136/0x145
[    0.000000] Code: e8 3b 7b 5e 00 55 48 89 e5 41 55 41 54 49 89 d4 53 
48 8b 57 20 48 89 fb 4c 8b 4f 10 4c 8b 47 08 48 8d 42 ff 83 e2 01 48 0f 
44 c7 <48> 8b 00 a8 80 75 4b 8b 4f 18 8b 57 1c 49 89 f5 31 c0 48 89 fe
[    0.000000] RIP  [<ffffffff811aaafb>] dump_page_badflags+0x2b/0xe0
[    0.000000]  RSP <ffffffff81c03ea8>
[    0.000000] CR2: 000000000000000c
[    0.000000] ---[ end trace cb88537fdc8fa200 ]---


> +		page;})
> +

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1233027 — Re: [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages

From"Kirill A. Shutemov" <kirill@shutemov.name>
Date2015-09-25 21:20 +0200
SubjectRe: [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages
Message-ID<qcGHg-27F-3@gated-at.bofh.it>
In reply to#1232758
On Fri, Sep 25, 2015 at 03:29:17PM +0300, Konstantin Khlebnikov wrote:
> On 24.09.2015 17:50, Kirill A. Shutemov wrote:
> >This patch adds a third argument to macros which create function
> >definitions for page flags.  This argument defines how page-flags helpers
> >behave on compound functions.
> >
> >For now we define four policies:
> >
> >- PF_ANY: the helper function operates on the page it gets, regardless
> >   if it's non-compound, head or tail.
> >
> >- PF_HEAD: the helper function operates on the head page of the compound
> >   page if it gets tail page.
> >
> >- PF_NO_TAIL: only head and non-compond pages are acceptable for this
> >   helper function.
> >
> >- PF_NO_COMPOUND: only non-compound pages are acceptable for this helper
> >   function.
> >
> >For now we use policy PF_ANY for all helpers, which matches current
> >behaviour.
> >
> >We do not enforce the policy for TESTPAGEFLAG, because we have flags
> >checked for random pages all over the kernel.  Noticeable exception to
> >this is PageTransHuge() which triggers VM_BUG_ON() for tail page.
> >
> >Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> >---
> >  include/linux/page-flags.h | 154 ++++++++++++++++++++++++++-------------------
> >  1 file changed, 90 insertions(+), 64 deletions(-)
> >
> >diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> >index 713d3f2c2468..1b3babe5ff69 100644
> >--- a/include/linux/page-flags.h
> >+++ b/include/linux/page-flags.h
> >@@ -154,49 +154,68 @@ static inline int PageCompound(struct page *page)
> >  	return test_bit(PG_head, &page->flags) || PageTail(page);
> >  }
> >
> >+/* Page flags policies wrt compound pages */
> >+#define PF_ANY(page, enforce)	page
> >+#define PF_HEAD(page, enforce)	compound_head(page)
> >+#define PF_NO_TAIL(page, enforce) ({					\
> >+		if (enforce)						\
> >+			VM_BUG_ON_PAGE(PageTail(page), page);		\
> >+		else							\
> >+			page = compound_head(page);			\
> >+		page;})
> >+#define PF_NO_COMPOUND(page, enforce) ({					\
> >+		if (enforce)						\
> >+			VM_BUG_ON_PAGE(PageCompound(page), page);	\
> 
> Linux next-20150925 crashes here (at least in lkvm)
> if CONFIG_DEFERRED_STRUCT_PAGE_INIT=y

Hm. I don't see the crash in qemu. Could you share your config?

> [    0.000000] Kernel command line: noapic noacpi pci=conf1 reboot=k panic=1
> i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 console=ttyS0
> earlyprintk=serial i8042.noaux=1  root=/dev/root rw
> rootflags=rw,trans=virtio,version=9p2000.L rootfstype=9p init=/virt/init
> ip=dhcp
> [    0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
> [    0.000000] BUG: unable to handle kernel NULL pointer dereference at
> 000000000000000c
> [    0.000000] IP: [<ffffffff811aaafb>] dump_page_badflags+0x2b/0xe0
> [    0.000000] PGD 0
> [    0.000000] Oops: 0000 [#1] SMP
> [    0.000000] Modules linked in:
> [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted
> 4.3.0-rc2-next-20150925+ #2
> [    0.000000] task: ffffffff81c12580 ti: ffffffff81c00000 task.ti:
> ffffffff81c00000
> [    0.000000] RIP: 0010:[<ffffffff811aaafb>]  [<ffffffff811aaafb>]
> dump_page_badflags+0x2b/0xe0
> [    0.000000] RSP: 0000:ffffffff81c03ea8  EFLAGS: 00010002
> [    0.000000] RAX: 000000000000000c RBX: ffffea00006dfd40 RCX:
> 0000000000000100
> [    0.000000] RDX: 0000000000000001 RSI: ffffffff81a4aeb8 RDI:
> ffffea00006dfd40
> [    0.000000] RBP: ffffffff81c03ec0 R08: 0000000000000000 R09:
> 0000000000000000
> [    0.000000] R10: 0000000000000001 R11: 0000000000000000 R12:
> 0000000000000000
> [    0.000000] R13: 000000000001b7f7 R14: ffffffff81fe50c0 R15:
> ffffffff81c03fb0
> [    0.000000] FS:  0000000000000000(0000) GS:ffff88001a400000(0000)
> knlGS:0000000000000000
> [    0.000000] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    0.000000] CR2: 000000000000000c CR3: 0000000001c0b000 CR4:
> 00000000000406b0
> [    0.000000] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> 0000000000000000
> [    0.000000] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7:
> 0000000000000400
> [    0.000000] Stack:
> [    0.000000]  000000000001b7f5 ffffea00006dfd40 000000000001b7f7
> ffffffff81c03ed0
> [    0.000000]  ffffffff811aabc0 ffffffff81c03ef8 ffffffff81785eda
> ffffffff81c03f10
> [    0.000000]  0000000000000040 ffffffff81fd99c0 ffffffff81c03f30
> ffffffff81f66600
> [    0.000000] Call Trace:
> [    0.000000]  [<ffffffff811aabc0>] dump_page+0x10/0x20
> [    0.000000]  [<ffffffff81785eda>] reserve_bootmem_region+0xd9/0xe2
> [    0.000000]  [<ffffffff81f66600>] free_all_bootmem+0x4b/0x11a
> [    0.000000]  [<ffffffff81f5428d>] mem_init+0x6a/0x9d
> [    0.000000]  [<ffffffff81f37d48>] start_kernel+0x214/0x46a
> [    0.000000]  [<ffffffff81f37120>] ? early_idt_handler_array+0x120/0x120
> [    0.000000]  [<ffffffff81f374d7>] x86_64_start_reservations+0x2a/0x2c
> [    0.000000]  [<ffffffff81f3760f>] x86_64_start_kernel+0x136/0x145
> [    0.000000] Code: e8 3b 7b 5e 00 55 48 89 e5 41 55 41 54 49 89 d4 53 48
> 8b 57 20 48 89 fb 4c 8b 4f 10 4c 8b 47 08 48 8d 42 ff 83 e2 01 48 0f 44 c7
> <48> 8b 00 a8 80 75 4b 8b 4f 18 8b 57 1c 49 89 f5 31 c0 48 89 fe
> [    0.000000] RIP  [<ffffffff811aaafb>] dump_page_badflags+0x2b/0xe0
> [    0.000000]  RSP <ffffffff81c03ea8>
> [    0.000000] CR2: 000000000000000c
> [    0.000000] ---[ end trace cb88537fdc8fa200 ]---

Could you try this:

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 9bcfd70b1eb8..eff685f83879 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -929,8 +929,6 @@ static void init_reserved_page(unsigned long pfn)
 #else
 static inline void init_reserved_page(unsigned long pfn)
 {
-       /* Avoid false-positive PageTail() */
-       INIT_LIST_HEAD(&pfn_to_page(pfn)->lru);
 }
 #endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
 
@@ -950,6 +948,10 @@ void __meminit reserve_bootmem_region(unsigned long start, unsigned long end)
                        struct page *page = pfn_to_page(start_pfn);
 
                        init_reserved_page(start_pfn);
+
+                       /* Avoid false-positive PageTail() */
+                       INIT_LIST_HEAD(&pfn_to_page(pfn)->lru);
+
                        SetPageReserved(page);
                }
        }
-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1234053 — Re: [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages

From"Kirill A. Shutemov" <kirill@shutemov.name>
Date2015-09-28 13:10 +0200
SubjectRe: [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages
Message-ID<qdEtI-3Uu-13@gated-at.bofh.it>
In reply to#1233027
On Mon, Sep 28, 2015 at 01:02:19PM +0300, Konstantin Khlebnikov wrote:
> On 25.09.2015 22:13, Kirill A. Shutemov wrote:
> >On Fri, Sep 25, 2015 at 03:29:17PM +0300, Konstantin Khlebnikov wrote:
> >>On 24.09.2015 17:50, Kirill A. Shutemov wrote:
> >>>This patch adds a third argument to macros which create function
> >>>definitions for page flags.  This argument defines how page-flags helpers
> >>>behave on compound functions.
> >>>
> >>>For now we define four policies:
> >>>
> >>>- PF_ANY: the helper function operates on the page it gets, regardless
> >>>   if it's non-compound, head or tail.
> >>>
> >>>- PF_HEAD: the helper function operates on the head page of the compound
> >>>   page if it gets tail page.
> >>>
> >>>- PF_NO_TAIL: only head and non-compond pages are acceptable for this
> >>>   helper function.
> >>>
> >>>- PF_NO_COMPOUND: only non-compound pages are acceptable for this helper
> >>>   function.
> >>>
> >>>For now we use policy PF_ANY for all helpers, which matches current
> >>>behaviour.
> >>>
> >>>We do not enforce the policy for TESTPAGEFLAG, because we have flags
> >>>checked for random pages all over the kernel.  Noticeable exception to
> >>>this is PageTransHuge() which triggers VM_BUG_ON() for tail page.
> >>>
> >>>Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> >>>---
> >>>  include/linux/page-flags.h | 154 ++++++++++++++++++++++++++-------------------
> >>>  1 file changed, 90 insertions(+), 64 deletions(-)
> >>>
> >>>diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> >>>index 713d3f2c2468..1b3babe5ff69 100644
> >>>--- a/include/linux/page-flags.h
> >>>+++ b/include/linux/page-flags.h
> >>>@@ -154,49 +154,68 @@ static inline int PageCompound(struct page *page)
> >>>  	return test_bit(PG_head, &page->flags) || PageTail(page);
> >>>  }
> >>>
> >>>+/* Page flags policies wrt compound pages */
> >>>+#define PF_ANY(page, enforce)	page
> >>>+#define PF_HEAD(page, enforce)	compound_head(page)
> >>>+#define PF_NO_TAIL(page, enforce) ({					\
> >>>+		if (enforce)						\
> >>>+			VM_BUG_ON_PAGE(PageTail(page), page);		\
> >>>+		else							\
> >>>+			page = compound_head(page);			\
> >>>+		page;})
> >>>+#define PF_NO_COMPOUND(page, enforce) ({					\
> >>>+		if (enforce)						\
> >>>+			VM_BUG_ON_PAGE(PageCompound(page), page);	\
> >>
> >>Linux next-20150925 crashes here (at least in lkvm)
> >>if CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
> >
> >Hm. I don't see the crash in qemu. Could you share your config?
> 
> see in attachment

Still don't see it. Have you tried patch from my previous mail?

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1234064 — Re: [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages

FromKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Date2015-09-28 13:50 +0200
SubjectRe: [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages
Message-ID<qdF6p-4DC-17@gated-at.bofh.it>
In reply to#1234053
On 28.09.2015 14:03, Kirill A. Shutemov wrote:
> On Mon, Sep 28, 2015 at 01:02:19PM +0300, Konstantin Khlebnikov wrote:
>> On 25.09.2015 22:13, Kirill A. Shutemov wrote:
>>> On Fri, Sep 25, 2015 at 03:29:17PM +0300, Konstantin Khlebnikov wrote:
>>>> On 24.09.2015 17:50, Kirill A. Shutemov wrote:
>>>>> This patch adds a third argument to macros which create function
>>>>> definitions for page flags.  This argument defines how page-flags helpers
>>>>> behave on compound functions.
>>>>>
>>>>> For now we define four policies:
>>>>>
>>>>> - PF_ANY: the helper function operates on the page it gets, regardless
>>>>>    if it's non-compound, head or tail.
>>>>>
>>>>> - PF_HEAD: the helper function operates on the head page of the compound
>>>>>    page if it gets tail page.
>>>>>
>>>>> - PF_NO_TAIL: only head and non-compond pages are acceptable for this
>>>>>    helper function.
>>>>>
>>>>> - PF_NO_COMPOUND: only non-compound pages are acceptable for this helper
>>>>>    function.
>>>>>
>>>>> For now we use policy PF_ANY for all helpers, which matches current
>>>>> behaviour.
>>>>>
>>>>> We do not enforce the policy for TESTPAGEFLAG, because we have flags
>>>>> checked for random pages all over the kernel.  Noticeable exception to
>>>>> this is PageTransHuge() which triggers VM_BUG_ON() for tail page.
>>>>>
>>>>> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>>>>> ---
>>>>>   include/linux/page-flags.h | 154 ++++++++++++++++++++++++++-------------------
>>>>>   1 file changed, 90 insertions(+), 64 deletions(-)
>>>>>
>>>>> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
>>>>> index 713d3f2c2468..1b3babe5ff69 100644
>>>>> --- a/include/linux/page-flags.h
>>>>> +++ b/include/linux/page-flags.h
>>>>> @@ -154,49 +154,68 @@ static inline int PageCompound(struct page *page)
>>>>>   	return test_bit(PG_head, &page->flags) || PageTail(page);
>>>>>   }
>>>>>
>>>>> +/* Page flags policies wrt compound pages */
>>>>> +#define PF_ANY(page, enforce)	page
>>>>> +#define PF_HEAD(page, enforce)	compound_head(page)
>>>>> +#define PF_NO_TAIL(page, enforce) ({					\
>>>>> +		if (enforce)						\
>>>>> +			VM_BUG_ON_PAGE(PageTail(page), page);		\
>>>>> +		else							\
>>>>> +			page = compound_head(page);			\
>>>>> +		page;})
>>>>> +#define PF_NO_COMPOUND(page, enforce) ({					\
>>>>> +		if (enforce)						\
>>>>> +			VM_BUG_ON_PAGE(PageCompound(page), page);	\
>>>>
>>>> Linux next-20150925 crashes here (at least in lkvm)
>>>> if CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
>>>
>>> Hm. I don't see the crash in qemu. Could you share your config?
>>
>> see in attachment
>
> Still don't see it. Have you tried patch from my previous mail?
>

Just checked: patch fixes oops.


This part of 7e18adb4f80bea90d30b62158694d97c31f71d37
(mm: meminit: initialise remaining struct pages in parallel with kswapd)
is unclear:

+#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
+static void init_reserved_page(unsigned long pfn)
+{
+       pg_data_t *pgdat;
+       int nid, zid;
+
+       if (!early_page_uninitialised(pfn))
+               return;
+
+       nid = early_pfn_to_nid(pfn);
+       pgdat = NODE_DATA(nid);
+
+       for (zid = 0; zid < MAX_NR_ZONES; zid++) {
+               struct zone *zone = &pgdat->node_zones[zid];
+
+               if (pfn >= zone->zone_start_pfn && pfn < zone_end_pfn(zone))
+                       break;
+       }
+       __init_single_pfn(pfn, zid, nid);
+}
+#else
+static inline void init_reserved_page(unsigned long pfn)
+{
+}
+#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
+
  /*
   * Initialised pages do not have PageReserved set. This function is
   * called for each range allocated by the bootmem allocator and
   * marks the pages PageReserved. The remaining valid pages are later
   * sent to the buddy page allocator.
   */
-void reserve_bootmem_region(unsigned long start, unsigned long end)
+void __meminit reserve_bootmem_region(unsigned long start, unsigned 
long end)
  {
         unsigned long start_pfn = PFN_DOWN(start);
         unsigned long end_pfn = PFN_UP(end);

-       for (; start_pfn < end_pfn; start_pfn++)
-               if (pfn_valid(start_pfn))
-                       SetPageReserved(pfn_to_page(start_pfn));
+       for (; start_pfn < end_pfn; start_pfn++) {
+               if (pfn_valid(start_pfn)) {
+                       struct page *page = pfn_to_page(start_pfn);
+
+                       init_reserved_page(start_pfn);
+                       SetPageReserved(page);
+               }
+       }
  }

We leave struct page uninitialized but call SetPageReserved for it.

-- 
Konstantin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1234331 — Re: [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages

From"Kirill A. Shutemov" <kirill@shutemov.name>
Date2015-09-28 20:00 +0200
SubjectRe: [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages
Message-ID<qdKSv-6Ap-19@gated-at.bofh.it>
In reply to#1234064
On Mon, Sep 28, 2015 at 02:48:12PM +0300, Konstantin Khlebnikov wrote:
> On 28.09.2015 14:03, Kirill A. Shutemov wrote:
> >On Mon, Sep 28, 2015 at 01:02:19PM +0300, Konstantin Khlebnikov wrote:
> >>On 25.09.2015 22:13, Kirill A. Shutemov wrote:
> >>>On Fri, Sep 25, 2015 at 03:29:17PM +0300, Konstantin Khlebnikov wrote:
> >>>>On 24.09.2015 17:50, Kirill A. Shutemov wrote:
> >>>>>This patch adds a third argument to macros which create function
> >>>>>definitions for page flags.  This argument defines how page-flags helpers
> >>>>>behave on compound functions.
> >>>>>
> >>>>>For now we define four policies:
> >>>>>
> >>>>>- PF_ANY: the helper function operates on the page it gets, regardless
> >>>>>   if it's non-compound, head or tail.
> >>>>>
> >>>>>- PF_HEAD: the helper function operates on the head page of the compound
> >>>>>   page if it gets tail page.
> >>>>>
> >>>>>- PF_NO_TAIL: only head and non-compond pages are acceptable for this
> >>>>>   helper function.
> >>>>>
> >>>>>- PF_NO_COMPOUND: only non-compound pages are acceptable for this helper
> >>>>>   function.
> >>>>>
> >>>>>For now we use policy PF_ANY for all helpers, which matches current
> >>>>>behaviour.
> >>>>>
> >>>>>We do not enforce the policy for TESTPAGEFLAG, because we have flags
> >>>>>checked for random pages all over the kernel.  Noticeable exception to
> >>>>>this is PageTransHuge() which triggers VM_BUG_ON() for tail page.
> >>>>>
> >>>>>Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> >>>>>---
> >>>>>  include/linux/page-flags.h | 154 ++++++++++++++++++++++++++-------------------
> >>>>>  1 file changed, 90 insertions(+), 64 deletions(-)
> >>>>>
> >>>>>diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> >>>>>index 713d3f2c2468..1b3babe5ff69 100644
> >>>>>--- a/include/linux/page-flags.h
> >>>>>+++ b/include/linux/page-flags.h
> >>>>>@@ -154,49 +154,68 @@ static inline int PageCompound(struct page *page)
> >>>>>  	return test_bit(PG_head, &page->flags) || PageTail(page);
> >>>>>  }
> >>>>>
> >>>>>+/* Page flags policies wrt compound pages */
> >>>>>+#define PF_ANY(page, enforce)	page
> >>>>>+#define PF_HEAD(page, enforce)	compound_head(page)
> >>>>>+#define PF_NO_TAIL(page, enforce) ({					\
> >>>>>+		if (enforce)						\
> >>>>>+			VM_BUG_ON_PAGE(PageTail(page), page);		\
> >>>>>+		else							\
> >>>>>+			page = compound_head(page);			\
> >>>>>+		page;})
> >>>>>+#define PF_NO_COMPOUND(page, enforce) ({					\
> >>>>>+		if (enforce)						\
> >>>>>+			VM_BUG_ON_PAGE(PageCompound(page), page);	\
> >>>>
> >>>>Linux next-20150925 crashes here (at least in lkvm)
> >>>>if CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
> >>>
> >>>Hm. I don't see the crash in qemu. Could you share your config?
> >>
> >>see in attachment
> >
> >Still don't see it. Have you tried patch from my previous mail?
> >
> 
> Just checked: patch fixes oops.
> 
> 
> This part of 7e18adb4f80bea90d30b62158694d97c31f71d37
> (mm: meminit: initialise remaining struct pages in parallel with kswapd)
> is unclear:
> 
> +#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
> +static void init_reserved_page(unsigned long pfn)
> +{
> +       pg_data_t *pgdat;
> +       int nid, zid;
> +
> +       if (!early_page_uninitialised(pfn))
> +               return;
> +
> +       nid = early_pfn_to_nid(pfn);
> +       pgdat = NODE_DATA(nid);
> +
> +       for (zid = 0; zid < MAX_NR_ZONES; zid++) {
> +               struct zone *zone = &pgdat->node_zones[zid];
> +
> +               if (pfn >= zone->zone_start_pfn && pfn < zone_end_pfn(zone))
> +                       break;
> +       }
> +       __init_single_pfn(pfn, zid, nid);
> +}
> +#else
> +static inline void init_reserved_page(unsigned long pfn)
> +{
> +}
> +#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
> +
>  /*
>   * Initialised pages do not have PageReserved set. This function is
>   * called for each range allocated by the bootmem allocator and
>   * marks the pages PageReserved. The remaining valid pages are later
>   * sent to the buddy page allocator.
>   */
> -void reserve_bootmem_region(unsigned long start, unsigned long end)
> +void __meminit reserve_bootmem_region(unsigned long start, unsigned long
> end)
>  {
>         unsigned long start_pfn = PFN_DOWN(start);
>         unsigned long end_pfn = PFN_UP(end);
> 
> -       for (; start_pfn < end_pfn; start_pfn++)
> -               if (pfn_valid(start_pfn))
> -                       SetPageReserved(pfn_to_page(start_pfn));
> +       for (; start_pfn < end_pfn; start_pfn++) {
> +               if (pfn_valid(start_pfn)) {
> +                       struct page *page = pfn_to_page(start_pfn);
> +
> +                       init_reserved_page(start_pfn);
> +                       SetPageReserved(page);
> +               }
> +       }
>  }
> 
> We leave struct page uninitialized but call SetPageReserved for it.

__init_single_pfn() initializes the page.

I guess the problem is false-negative reply from
early_page_uninitialised(). No idea why it could happen.

Mel?

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1232168 — [PATCH 04/16] page-flags: define PG_locked behavior on compound pages

From"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Date2015-09-24 17:00 +0200
Subject[PATCH 04/16] page-flags: define PG_locked behavior on compound pages
Message-ID<qcga9-6cP-65@gated-at.bofh.it>
In reply to#1232162
lock_page() must operate on the whole compound page.  It doesn't make much
sense to lock part of compound page.  Change code to use head page's
PG_locked, if tail page is passed.

This patch also gets rid of custom helper functions -- __set_page_locked()
and __clear_page_locked().  They are replaced with helpers generated by
__SETPAGEFLAG/__CLEARPAGEFLAG.  Tail pages to these helper would trigger
VM_BUG_ON().

SLUB uses PG_locked as a bit spin locked.  IIUC, tail pages should never
appear there.  VM_BUG_ON() is added to make sure that this assumption is
correct.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
 fs/cifs/file.c             |  8 ++++----
 include/linux/page-flags.h |  2 +-
 include/linux/pagemap.h    | 25 ++++++++-----------------
 mm/filemap.c               | 15 +++++++++------
 mm/ksm.c                   |  2 +-
 mm/memory-failure.c        |  2 +-
 mm/migrate.c               |  2 +-
 mm/shmem.c                 |  4 ++--
 mm/slub.c                  |  2 ++
 mm/swap_state.c            |  4 ++--
 mm/vmscan.c                |  2 +-
 11 files changed, 32 insertions(+), 36 deletions(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index e2a6af1508af..94f81962368c 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -3390,13 +3390,13 @@ readpages_get_pages(struct address_space *mapping, struct list_head *page_list,
 	 * should have access to this page, we're safe to simply set
 	 * PG_locked without checking it first.
 	 */
-	__set_page_locked(page);
+	__SetPageLocked(page);
 	rc = add_to_page_cache_locked(page, mapping,
 				      page->index, GFP_KERNEL);
 
 	/* give up if we can't stick it in the cache */
 	if (rc) {
-		__clear_page_locked(page);
+		__ClearPageLocked(page);
 		return rc;
 	}
 
@@ -3417,10 +3417,10 @@ readpages_get_pages(struct address_space *mapping, struct list_head *page_list,
 		if (*bytes + PAGE_CACHE_SIZE > rsize)
 			break;
 
-		__set_page_locked(page);
+		__SetPageLocked(page);
 		if (add_to_page_cache_locked(page, mapping, page->index,
 								GFP_KERNEL)) {
-			__clear_page_locked(page);
+			__ClearPageLocked(page);
 			break;
 		}
 		list_move_tail(&page->lru, tmplist);
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 1b3babe5ff69..26102813f0ac 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -244,7 +244,7 @@ static inline int __TestClearPage##uname(struct page *page) { return 0; }
 #define TESTSCFLAG_FALSE(uname)						\
 	TESTSETFLAG_FALSE(uname) TESTCLEARFLAG_FALSE(uname)
 
-TESTPAGEFLAG(Locked, locked, PF_ANY)
+__PAGEFLAG(Locked, locked, PF_NO_TAIL)
 PAGEFLAG(Error, error, PF_ANY) TESTCLEARFLAG(Error, error, PF_ANY)
 PAGEFLAG(Referenced, referenced, PF_ANY) TESTCLEARFLAG(Referenced, referenced, PF_ANY)
 	__SETPAGEFLAG(Referenced, referenced, PF_ANY)
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index a6c78e00ea96..3e95fb6a77af 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -426,18 +426,9 @@ extern int __lock_page_or_retry(struct page *page, struct mm_struct *mm,
 				unsigned int flags);
 extern void unlock_page(struct page *page);
 
-static inline void __set_page_locked(struct page *page)
-{
-	__set_bit(PG_locked, &page->flags);
-}
-
-static inline void __clear_page_locked(struct page *page)
-{
-	__clear_bit(PG_locked, &page->flags);
-}
-
 static inline int trylock_page(struct page *page)
 {
+	page = compound_head(page);
 	return (likely(!test_and_set_bit_lock(PG_locked, &page->flags)));
 }
 
@@ -490,9 +481,9 @@ extern int wait_on_page_bit_killable_timeout(struct page *page,
 
 static inline int wait_on_page_locked_killable(struct page *page)
 {
-	if (PageLocked(page))
-		return wait_on_page_bit_killable(page, PG_locked);
-	return 0;
+	if (!PageLocked(page))
+		return 0;
+	return wait_on_page_bit_killable(compound_head(page), PG_locked);
 }
 
 extern wait_queue_head_t *page_waitqueue(struct page *page);
@@ -511,7 +502,7 @@ static inline void wake_up_page(struct page *page, int bit)
 static inline void wait_on_page_locked(struct page *page)
 {
 	if (PageLocked(page))
-		wait_on_page_bit(page, PG_locked);
+		wait_on_page_bit(compound_head(page), PG_locked);
 }
 
 /* 
@@ -657,17 +648,17 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask);
 
 /*
  * Like add_to_page_cache_locked, but used to add newly allocated pages:
- * the page is new, so we can just run __set_page_locked() against it.
+ * the page is new, so we can just run __SetPageLocked() against it.
  */
 static inline int add_to_page_cache(struct page *page,
 		struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask)
 {
 	int error;
 
-	__set_page_locked(page);
+	__SetPageLocked(page);
 	error = add_to_page_cache_locked(page, mapping, offset, gfp_mask);
 	if (unlikely(error))
-		__clear_page_locked(page);
+		__ClearPageLocked(page);
 	return error;
 }
 
diff --git a/mm/filemap.c b/mm/filemap.c
index 879747a42f6b..6cc2c17a0ca0 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -682,11 +682,11 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
 	void *shadow = NULL;
 	int ret;
 
-	__set_page_locked(page);
+	__SetPageLocked(page);
 	ret = __add_to_page_cache_locked(page, mapping, offset,
 					 gfp_mask, &shadow);
 	if (unlikely(ret))
-		__clear_page_locked(page);
+		__ClearPageLocked(page);
 	else {
 		/*
 		 * The page might have been evicted from cache only
@@ -809,6 +809,7 @@ EXPORT_SYMBOL_GPL(add_page_wait_queue);
  */
 void unlock_page(struct page *page)
 {
+	page = compound_head(page);
 	VM_BUG_ON_PAGE(!PageLocked(page), page);
 	clear_bit_unlock(PG_locked, &page->flags);
 	smp_mb__after_atomic();
@@ -873,18 +874,20 @@ EXPORT_SYMBOL_GPL(page_endio);
  */
 void __lock_page(struct page *page)
 {
-	DEFINE_WAIT_BIT(wait, &page->flags, PG_locked);
+	struct page *page_head = compound_head(page);
+	DEFINE_WAIT_BIT(wait, &page_head->flags, PG_locked);
 
-	__wait_on_bit_lock(page_waitqueue(page), &wait, bit_wait_io,
+	__wait_on_bit_lock(page_waitqueue(page_head), &wait, bit_wait_io,
 							TASK_UNINTERRUPTIBLE);
 }
 EXPORT_SYMBOL(__lock_page);
 
 int __lock_page_killable(struct page *page)
 {
-	DEFINE_WAIT_BIT(wait, &page->flags, PG_locked);
+	struct page *page_head = compound_head(page);
+	DEFINE_WAIT_BIT(wait, &page_head->flags, PG_locked);
 
-	return __wait_on_bit_lock(page_waitqueue(page), &wait,
+	return __wait_on_bit_lock(page_waitqueue(page_head), &wait,
 					bit_wait_io, TASK_KILLABLE);
 }
 EXPORT_SYMBOL_GPL(__lock_page_killable);
diff --git a/mm/ksm.c b/mm/ksm.c
index 7ee101eaacdf..bc7be0ee2080 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1884,7 +1884,7 @@ struct page *ksm_might_need_to_copy(struct page *page,
 
 		SetPageDirty(new_page);
 		__SetPageUptodate(new_page);
-		__set_page_locked(new_page);
+		__SetPageLocked(new_page);
 	}
 
 	return new_page;
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 8424b64711ac..5b965e27aaae 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1166,7 +1166,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
 	/*
 	 * We ignore non-LRU pages for good reasons.
 	 * - PG_locked is only well defined for LRU pages and a few others
-	 * - to avoid races with __set_page_locked()
+	 * - to avoid races with __SetPageLocked()
 	 * - to avoid races with __SetPageSlab*() (and more non-atomic ops)
 	 * The check (unnecessarily) ignores LRU pages being isolated and
 	 * walked by the page reclaim code, however that's not a big loss.
diff --git a/mm/migrate.c b/mm/migrate.c
index 94961f4654b7..bd19c7339f8c 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1765,7 +1765,7 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
 		flush_tlb_range(vma, mmun_start, mmun_end);
 
 	/* Prepare a page as a migration target */
-	__set_page_locked(new_page);
+	__SetPageLocked(new_page);
 	SetPageSwapBacked(new_page);
 
 	/* anon mapping, we can simply copy page->mapping to the new page: */
diff --git a/mm/shmem.c b/mm/shmem.c
index 48ce82926d93..1425863f5322 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -996,7 +996,7 @@ static int shmem_replace_page(struct page **pagep, gfp_t gfp,
 	copy_highpage(newpage, oldpage);
 	flush_dcache_page(newpage);
 
-	__set_page_locked(newpage);
+	__SetPageLocked(newpage);
 	SetPageUptodate(newpage);
 	SetPageSwapBacked(newpage);
 	set_page_private(newpage, swap_index);
@@ -1188,7 +1188,7 @@ repeat:
 		}
 
 		__SetPageSwapBacked(page);
-		__set_page_locked(page);
+		__SetPageLocked(page);
 		if (sgp == SGP_WRITE)
 			__SetPageReferenced(page);
 
diff --git a/mm/slub.c b/mm/slub.c
index 999673c386d6..bda33cc4f7e4 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -338,11 +338,13 @@ static inline int oo_objects(struct kmem_cache_order_objects x)
  */
 static __always_inline void slab_lock(struct page *page)
 {
+	VM_BUG_ON_PAGE(PageTail(page), page);
 	bit_spin_lock(PG_locked, &page->flags);
 }
 
 static __always_inline void slab_unlock(struct page *page)
 {
+	VM_BUG_ON_PAGE(PageTail(page), page);
 	__bit_spin_unlock(PG_locked, &page->flags);
 }
 
diff --git a/mm/swap_state.c b/mm/swap_state.c
index d504adb7fa5f..d783872d746c 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -353,7 +353,7 @@ struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
 		}
 
 		/* May fail (-ENOMEM) if radix-tree node allocation failed. */
-		__set_page_locked(new_page);
+		__SetPageLocked(new_page);
 		SetPageSwapBacked(new_page);
 		err = __add_to_swap_cache(new_page, entry);
 		if (likely(!err)) {
@@ -367,7 +367,7 @@ struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
 		}
 		radix_tree_preload_end();
 		ClearPageSwapBacked(new_page);
-		__clear_page_locked(new_page);
+		__ClearPageLocked(new_page);
 		/*
 		 * add_to_swap_cache() doesn't return -EEXIST, so we can safely
 		 * clear SWAP_HAS_CACHE flag.
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 38d04810e0ee..a0b8f08e6f62 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1184,7 +1184,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
 		 * we obviously don't have to worry about waking up a process
 		 * waiting on the page lock, because there are no references.
 		 */
-		__clear_page_locked(page);
+		__ClearPageLocked(page);
 free_it:
 		nr_reclaimed++;
 
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1232226 — Re: [PATCH 04/16] page-flags: define PG_locked behavior on compound pages

FromChristoph Lameter <cl@linux.com>
Date2015-09-24 18:10 +0200
SubjectRe: [PATCH 04/16] page-flags: define PG_locked behavior on compound pages
Message-ID<qchfQ-7YI-17@gated-at.bofh.it>
In reply to#1232168
On Thu, 24 Sep 2015, Kirill A. Shutemov wrote:

> SLUB uses PG_locked as a bit spin locked.  IIUC, tail pages should never
> appear there.  VM_BUG_ON() is added to make sure that this assumption is
> correct.

Correct. However, VM_BUG_ON is superfluous. If there is a tail page there
then the information in the page will be not as expected (free list
parameter f.e.) and things will fall apart rapidly with segfaults.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1232421 — Re: [PATCH 04/16] page-flags: define PG_locked behavior on compound pages

From"Kirill A. Shutemov" <kirill@shutemov.name>
Date2015-09-24 22:30 +0200
SubjectRe: [PATCH 04/16] page-flags: define PG_locked behavior on compound pages
Message-ID<qcljs-5he-11@gated-at.bofh.it>
In reply to#1232226
On Thu, Sep 24, 2015 at 11:08:29AM -0500, Christoph Lameter wrote:
> On Thu, 24 Sep 2015, Kirill A. Shutemov wrote:
> 
> > SLUB uses PG_locked as a bit spin locked.  IIUC, tail pages should never
> > appear there.  VM_BUG_ON() is added to make sure that this assumption is
> > correct.
> 
> Correct. However, VM_BUG_ON is superfluous. If there is a tail page there
> then the information in the page will be not as expected (free list
> parameter f.e.) and things will fall apart rapidly with segfaults.

Right. But would it provide any clues on what is going on?

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1232236

FromChristoph Lameter <cl@linux.com>
Date2015-09-24 18:20 +0200
Message-ID<qchpx-8a5-31@gated-at.bofh.it>
In reply to#1232162
On Thu, 24 Sep 2015, Kirill A. Shutemov wrote:

> As requested, here's reworked version of page-flags patchset.
> Updated version should fit more naturally into current code base.

This is certainly great for specialized debugging hunting for improper
handling of page flags for compound pages but a regular debug
kernel will get a mass of VM_BUG_ON(s) at numerous page flag uses in the
code. Is that really useful in general for a debug kernel?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1232419

From"Kirill A. Shutemov" <kirill@shutemov.name>
Date2015-09-24 22:30 +0200
Message-ID<qcljr-5he-1@gated-at.bofh.it>
In reply to#1232236
On Thu, Sep 24, 2015 at 11:13:22AM -0500, Christoph Lameter wrote:
> On Thu, 24 Sep 2015, Kirill A. Shutemov wrote:
> 
> > As requested, here's reworked version of page-flags patchset.
> > Updated version should fit more naturally into current code base.
> 
> This is certainly great for specialized debugging hunting for improper
> handling of page flags for compound pages but a regular debug
> kernel will get a mass of VM_BUG_ON(s) at numerous page flag uses in the
> code. Is that really useful in general for a debug kernel?

As I said before, it was useful for me in few cases.

I can wrap these VM_BUG_ONs under separate config, if it helps.

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web