[PATCH 04/14] readahead: thrashing recovery method: check unbalanced aging

From: Fengguang Wu
Date: Fri Mar 16 2007 - 04:56:27 EST


Always check for unbalanced aging in thrashing_recovery_readahead(), and
account RA_EVENT_READAHEAD_MUTILATE/RA_EVENT_READAHEAD_THRASHING events.

Unbalanced zone/node aging can come from abnormal system loads, or
misconfigured NUMA policies.

Thrashings are rare events, hence the cost of probe_page() is not a concern.

Signed-off-by: Fengguang Wu <wfg@xxxxxxxxxxxxxxxx>
---
mm/readahead.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)

--- linux-2.6.21-rc3-mm2.orig/mm/readahead.c
+++ linux-2.6.21-rc3-mm2/mm/readahead.c
@@ -1546,14 +1546,11 @@ thrashing_recovery_readahead(struct addr
pgoff_t offset, unsigned long ra_max)
{
unsigned long ra_size;
+ int unbalanced_aging = probe_page(mapping, offset - 1);

-#ifdef CONFIG_DEBUG_READAHEAD
- if (probe_page(mapping, offset - 1))
- ra_account(ra, RA_EVENT_READAHEAD_MUTILATE,
- ra->readahead_index - offset);
- ra_account(ra, RA_EVENT_READAHEAD_THRASHING,
- ra->readahead_index - offset);
-#endif
+ ra_account(ra, unbalanced_aging ? RA_EVENT_READAHEAD_MUTILATE :
+ RA_EVENT_READAHEAD_THRASHING,
+ ra->readahead_index - offset);

if (offset < ra->ra_index) {
/*

--
-
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/