Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964824AbWCVWrE (ORCPT ); Wed, 22 Mar 2006 17:47:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932875AbWCVWdG (ORCPT ); Wed, 22 Mar 2006 17:33:06 -0500 Received: from amsfep17-int.chello.nl ([213.46.243.15]:30230 "EHLO amsfep18-int.chello.nl") by vger.kernel.org with ESMTP id S932871AbWCVWcw (ORCPT ); Wed, 22 Mar 2006 17:32:52 -0500 From: Peter Zijlstra To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Bob Picco , Andrew Morton , IWAMOTO Toshihiro , Peter Zijlstra , Christoph Lameter , Wu Fengguang , Nick Piggin , Linus Torvalds , Rik van Riel , Marcelo Tosatti Message-Id: <20060322223218.12658.40531.sendpatchset@twins.localnet> In-Reply-To: <20060322223107.12658.14997.sendpatchset@twins.localnet> References: <20060322223107.12658.14997.sendpatchset@twins.localnet> Subject: [PATCH 07/34] mm: page-replace-move-macros.patch Date: Wed, 22 Mar 2006 23:32:50 +0100 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3131 Lines: 102 From: Peter Zijlstra move macro's out of vmscan into the generic page replace header so the rest of the world can use them too. Signed-off-by: Peter Zijlstra Signed-off-by: Marcelo Tosatti --- include/linux/mm_page_replace.h | 30 ++++++++++++++++++++++++++++++ mm/vmscan.c | 30 ------------------------------ 2 files changed, 30 insertions(+), 30 deletions(-) Index: linux-2.6-git/include/linux/mm_page_replace.h =================================================================== --- linux-2.6-git.orig/include/linux/mm_page_replace.h +++ linux-2.6-git/include/linux/mm_page_replace.h @@ -8,6 +8,36 @@ #include #include +#define lru_to_page(_head) (list_entry((_head)->prev, struct page, lru)) + +#ifdef ARCH_HAS_PREFETCH +#define prefetch_prev_lru_page(_page, _base, _field) \ + do { \ + if ((_page)->lru.prev != _base) { \ + struct page *prev; \ + \ + prev = lru_to_page(&(_page->lru)); \ + prefetch(&prev->_field); \ + } \ + } while (0) +#else +#define prefetch_prev_lru_page(_page, _base, _field) do { } while (0) +#endif + +#ifdef ARCH_HAS_PREFETCHW +#define prefetchw_prev_lru_page(_page, _base, _field) \ + do { \ + if ((_page)->lru.prev != _base) { \ + struct page *prev; \ + \ + prev = lru_to_page(&(_page->lru)); \ + prefetchw(&prev->_field); \ + } \ + } while (0) +#else +#define prefetchw_prev_lru_page(_page, _base, _field) do { } while (0) +#endif + /* void page_replace_hint_active(struct page *); */ /* void page_replace_hint_use_once(struct page *); */ extern void fastcall page_replace_add(struct page *); Index: linux-2.6-git/mm/vmscan.c =================================================================== --- linux-2.6-git.orig/mm/vmscan.c +++ linux-2.6-git/mm/vmscan.c @@ -93,36 +93,6 @@ struct shrinker { long nr; /* objs pending delete */ }; -#define lru_to_page(_head) (list_entry((_head)->prev, struct page, lru)) - -#ifdef ARCH_HAS_PREFETCH -#define prefetch_prev_lru_page(_page, _base, _field) \ - do { \ - if ((_page)->lru.prev != _base) { \ - struct page *prev; \ - \ - prev = lru_to_page(&(_page->lru)); \ - prefetch(&prev->_field); \ - } \ - } while (0) -#else -#define prefetch_prev_lru_page(_page, _base, _field) do { } while (0) -#endif - -#ifdef ARCH_HAS_PREFETCHW -#define prefetchw_prev_lru_page(_page, _base, _field) \ - do { \ - if ((_page)->lru.prev != _base) { \ - struct page *prev; \ - \ - prev = lru_to_page(&(_page->lru)); \ - prefetchw(&prev->_field); \ - } \ - } while (0) -#else -#define prefetchw_prev_lru_page(_page, _base, _field) do { } while (0) -#endif - /* * From 0 .. 100. Higher means more swappy. */ - 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/