[PATCH 3/9] clockpro-PG_test.patch




From: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>

Introduce a new PG_flag, needed for the clockpro work.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>

include/linux/page-flags.h | 8 ++++++++
mm/page_alloc.c | 3 ++-
2 files changed, 10 insertions(+), 1 deletion(-)

Index: linux-2.6-git/include/linux/page-flags.h
===================================================================
--- linux-2.6-git.orig/include/linux/page-flags.h
+++ linux-2.6-git/include/linux/page-flags.h
@@ -76,6 +76,8 @@
#define PG_nosave_free 18 /* Free, should not be written */
#define PG_uncached 19 /* Page has been mapped as uncached */

+#define PG_test 20 /* Page is in its test period */
+
/*
* Global page accounting. One instance per CPU. Only unsigned longs are
* allowed.
@@ -303,6 +305,12 @@ extern void __mod_page_state(unsigned lo
#define SetPageUncached(page) set_bit(PG_uncached, &(page)->flags)
#define ClearPageUncached(page) clear_bit(PG_uncached, &(page)->flags)

+#define PageTest(page) test_bit(PG_test, &(page)->flags)
+#define SetPageTest(page) set_bit(PG_test, &(page)->flags)
+#define TestSetPageTest(page) test_and_set_bit(PG_test, &(page)->flags)
+#define ClearPageTest(page) clear_bit(PG_test, &(page)->flags)
+#define TestClearPageTest(page) test_and_clear_bit(PG_test, &(page)->flags)
+
struct page; /* forward declaration */

int test_clear_page_dirty(struct page *page);
Index: linux-2.6-git/mm/page_alloc.c
===================================================================
--- linux-2.6-git.orig/mm/page_alloc.c
+++ linux-2.6-git/mm/page_alloc.c
@@ -499,7 +499,8 @@ static int prep_new_page(struct page *pa

page->flags &= ~(1 << PG_uptodate | 1 << PG_error |
1 << PG_referenced | 1 << PG_arch_1 |
- 1 << PG_checked | 1 << PG_mappedtodisk);
+ 1 << PG_checked | 1 << PG_mappedtodisk |
+ 1 << PG_test);
set_page_private(page, 0);
set_page_refs(page, order);
kernel_map_pages(page, 1 << order, 1);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • [PATCH 31/34] mm: cart-PG_reclaim3.patch
    ... Add a third PG_flag to the page reclaim framework. ... Global page accounting. ... One instance per CPU. ... Only unsigned longs are ...
    (Linux-Kernel)
  • Re: RFC for a new Scheduling policy/class in the Linux-kernel
    ... order to avoid wasting CPU time too much... ... Could you elaborate on this "proper accounting"? ... on an m-CPU system) highest priority taskalways running. ... I think it is quite easy to figure out that blocking protocols, e.g. PI, ...
    (Linux-Kernel)
  • Re: [patch] sched: accurate user accounting
    ... Currently we only do cpu accounting to userspace based on what is ... actually happening precisely on each tick. ... Both ad-hoc and `/proc/stat' (idle) ...
    (Linux-Kernel)
  • Re: [accounting regression since rc1] scheduler updates
    ... accounting-in-virtual-time break user expectations too? ... gave this task as much CPU time as it could. ... As far as accounting is concerned the user doesn't care one bit what ... without mixing external scheduling information into it. ...
    (Linux-Kernel)
  • Re: [patch] sched: accurate user accounting
    ... scheduler first and check the results. ... to before RSDL and have tested it - find the patch below. ... Currently we only do cpu accounting to userspace based on what is ...
    (Linux-Kernel)