Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756067Ab0GMKSA (ORCPT ); Tue, 13 Jul 2010 06:18:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19975 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753209Ab0GMKRz (ORCPT ); Tue, 13 Jul 2010 06:17:55 -0400 Date: Tue, 13 Jul 2010 06:17:36 -0400 From: Xiaotian Feng To: linux-mm@kvack.org, linux-nfs@vger.kernel.org, netdev@vger.kernel.org Cc: riel@redhat.com, cl@linux-foundation.org, a.p.zijlstra@chello.nl, Xiaotian Feng , linux-kernel@vger.kernel.org, lwang@redhat.com, penberg@cs.helsinki.fi, akpm@linux-foundation.org, davem@davemloft.net Message-Id: <20100713101736.2835.76110.sendpatchset@danny.redhat> In-Reply-To: <20100713101650.2835.15245.sendpatchset@danny.redhat> References: <20100713101650.2835.15245.sendpatchset@danny.redhat> Subject: [PATCH -mmotm 04/30] mm: tag reseve pages Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1990 Lines: 57 >From 14f7823986429b8374d18e3f648cd84575296e03 Mon Sep 17 00:00:00 2001 From: Xiaotian Feng Date: Mon, 12 Jul 2010 18:00:37 +0800 Subject: [PATCH 04/30] mm: tag reseve pages Tag pages allocated from the reserves with a non-zero page->reserve. This allows us to distinguish and account reserve pages. Since low-memory situations are transient, and unrelated the the actual page (any page can be on the freelist when we run low), don't mark the page in any permanent way - just pass along the information to the allocatee. Signed-off-by: Peter Zijlstra Signed-off-by: Suresh Jayaraman Signed-off-by: Xiaotian Feng --- include/linux/mm_types.h | 1 + mm/page_alloc.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index b8bb9a6..a95a202 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -71,6 +71,7 @@ struct page { union { pgoff_t index; /* Our offset within mapping. */ void *freelist; /* SLUB: freelist req. slab lock */ + int reserve; /* page_alloc: page is a reserve page */ }; struct list_head lru; /* Pageout list, eg. active_list * protected by zone->lru_lock ! diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 72a6be5..b9989c5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1656,8 +1656,10 @@ zonelist_scan: try_this_zone: page = buffered_rmqueue(preferred_zone, zone, order, gfp_mask, migratetype); - if (page) + if (page) { + page->reserve = !!(alloc_flags & ALLOC_NO_WATERMARKS); break; + } this_zone_full: if (NUMA_BUILD) zlc_mark_zone_full(zonelist, z); -- 1.7.1.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/