diff options
author | Dan Magenheimer <dan.magenheimer@oracle.com> | 2012-01-25 16:58:46 -0800 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-01-05 18:22:07 +0100 |
commit | a2f3743426c73be191c79ee8898a46d39b302edb (patch) | |
tree | 851e00affce38764fc40a7664ec1436725df853f /include/linux | |
parent | 8d7106c5b92d97170aab06a5ba87b21e1f60dad0 (diff) | |
download | kernel_samsung_tuna-a2f3743426c73be191c79ee8898a46d39b302edb.zip kernel_samsung_tuna-a2f3743426c73be191c79ee8898a46d39b302edb.tar.gz kernel_samsung_tuna-a2f3743426c73be191c79ee8898a46d39b302edb.tar.bz2 |
mm: implement WasActive page flag (for improving cleancache)
(Feedback welcome if there is a different/better way to do this
without using a page flag!)
Since about 2.6.27, the page replacement algorithm maintains
an "active" bit to help decide which pages are most eligible
to reclaim, see http://linux-mm.org/PageReplacementDesign
This "active' information is also useful to cleancache but is lost
by the time that cleancache has the opportunity to preserve the
pageful of data. This patch adds a new page flag "WasActive" to
retain the state. The flag may possibly be useful elsewhere.
It is up to each cleancache backend to utilize the bit as
it desires. The matching patch for zcache is included here
for clarification/discussion purposes, though it will need to
go through GregKH and the staging tree.
The patch resolves issues reported with cleancache which occur
especially during streaming workloads on older processors,
see https://lkml.org/lkml/2011/8/17/351
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Conflicts:
include/linux/page-flags.h
Change-Id: I0fcb2302a7b9c5e66db005229f679baee90f262f
Conflicts:
include/linux/page-flags.h
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/page-flags.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index cfd7702..ebd8640 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -51,6 +51,9 @@ * PG_hwpoison indicates that a page got corrupted in hardware and contains * data with incorrect ECC bits that triggered a machine check. Accessing is * not safe since it may cause another machine check. Don't touch! + * + * PG_wasactive reflects that a page previously was promoted to active status. + * Such pages should be considered higher priority for cleancache backends. */ /* @@ -107,6 +110,9 @@ enum pageflags { #ifdef CONFIG_TRANSPARENT_HUGEPAGE PG_compound_lock, #endif +#ifdef CONFIG_CLEANCACHE + PG_was_active, +#endif __NR_PAGEFLAGS, /* Filesystems */ @@ -214,6 +220,10 @@ __PAGEFLAG(SlobFree, slob_free) __PAGEFLAG(SlubFrozen, slub_frozen) +#ifdef CONFIG_CLEANCACHE +PAGEFLAG(WasActive, was_active) +#endif + /* * Private page markings that may be used by the filesystem that owns the page * for its own purposes. |