lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 16 Feb 2012 15:31:31 +0100
From:	Radosław Smogura <mail@...gura.eu>
To:	linux-mm@...ck.org
Cc:	Yongqiang Yang <xiaoqiangnk@...il.com>, mail@...gura.eu,
	linux-ext4@...r.kernel.org
Subject: [PATCH 04/18] Page flag for tracking compound deque

This flag is to inform caller that page is about to be splitted, caller
should not depend on fact that page is compound during page mapping.

In first approach we assumed page may be splitted conurently during
operations that makes compound cache pages not coherent with mapping
indices - e. g. when someone replaces 1st page in page cache, but at
this palce exists huge page.

Problem with above is that if two threads makes such change, they may
concurently deadlock. It's quite reasonable that both will have page
lock and should achieve compound lock (compound lock will be achieved
after page lock in many situations, probably during split), split method
should aquire page lock for each tail page at it changes some important
flags.

This is mainly dictated because of LRU, we can't use tail->lru as it
stores some compound data, from other side some code depends on PageLRU,
which should evolve to, event those it's quite reasonable that tail
pages should have LRU flag set, and mainly isolate_lru_pages should bug
on tail.

Signed-off-by: Radosław Smogura <mail@...gura.eu>
---
 include/linux/page-flags.h |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 393b8af..0d17a6f 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -108,6 +108,18 @@ enum pageflags {
 	/** For page head it's raised to protect page from spliting */
 	PG_compound_lock,
 #endif
+#ifdef CONFIG_HUGEPAGECACHE
+	/** Setted on head to inform that page is subject to split, but split
+	 * hasn't started yet or is it in progress. When this flag is set
+	 * caller should not belive that this compound page represents some
+	 * "continous data".<br/>
+	 * It's currently used for huge page cache and file base mapping,
+	 * and it informs that compound page dosen't represents continuous
+	 * region of file, in particullary some pages including head may be
+	 * removed or replaced in cache by other pages, or may be "invalid"
+	 */
+	PG_split_deque,
+#endif
 	__NR_PAGEFLAGS,
 
 	/* Filesystems */
@@ -433,6 +445,25 @@ static inline int PageTransCompound(struct page *page)
 }
 #endif
 
+#ifdef CONFIG_HUGEPAGECACHE
+TESTPAGEFLAG(SplitDeque, split_deque);
+TESTSETFLAG(SplitDeque, split_deque);
+TESTCLEARFLAG(SplitDeque, split_deque);
+#else
+static inline int PageSplitDeque(struct page *page)
+{
+	return 0;
+}
+static inline int TestClearPageSplitDeque(struct page *page)
+{
+	return 0;
+}
+static inline int TestSetPageSplitDeque(struct page *page)
+{
+	return 0;
+}
+#endif
+
 #ifdef CONFIG_MMU
 #define __PG_MLOCKED		(1 << PG_mlocked)
 #else
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ