Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932316AbZJAOEI (ORCPT ); Thu, 1 Oct 2009 10:04:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932256AbZJAOEG (ORCPT ); Thu, 1 Oct 2009 10:04:06 -0400 Received: from victor.provo.novell.com ([137.65.250.26]:38644 "EHLO victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932171AbZJAOEF (ORCPT ); Thu, 1 Oct 2009 10:04:05 -0400 From: Suresh Jayaraman To: Linus Torvalds , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: netdev@vger.kernel.org, Neil Brown , Miklos Szeredi , Wouter Verhelst , Peter Zijlstra , trond.myklebust@fys.uio.no, Suresh Jayaraman Subject: [PATCH 04/31] mm: tag reseve pages Date: Thu, 1 Oct 2009 19:35:17 +0530 Message-Id: <1254405917-15796-1-git-send-email-sjayaraman@suse.de> X-Mailer: git-send-email 1.6.0.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1839 Lines: 50 From: Peter Zijlstra 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 --- include/linux/mm_types.h | 1 + mm/page_alloc.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) Index: mmotm/include/linux/mm_types.h =================================================================== --- mmotm.orig/include/linux/mm_types.h +++ mmotm/include/linux/mm_types.h @@ -77,6 +77,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 ! Index: mmotm/mm/page_alloc.c =================================================================== --- mmotm.orig/mm/page_alloc.c +++ mmotm/mm/page_alloc.c @@ -1501,8 +1501,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); -- 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/