Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760001AbZFTBgf (ORCPT ); Fri, 19 Jun 2009 21:36:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759219AbZFTBgR (ORCPT ); Fri, 19 Jun 2009 21:36:17 -0400 Received: from acsinet11.oracle.com ([141.146.126.233]:20830 "EHLO acsinet11.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755679AbZFTBgQ convert rfc822-to-8bit (ORCPT ); Fri, 19 Jun 2009 21:36:16 -0400 MIME-Version: 1.0 Message-ID: Date: Fri, 19 Jun 2009 18:35:31 -0700 (PDT) From: Dan Magenheimer To: dan.magenheimer@oracle.com, linux-kernel@vger.kernel.org Cc: xen-devel@lists.xensource.com, npiggin@suse.de, chris.mason@oracle.com, kurt.hackel@oracle.com, dave.mccracken@oracle.com, Avi Kivity , jeremy@goop.org, Rik van Riel , alan@lxorguk.ukuu.org.uk, Rusty Russell , Martin Schwidefsky , akpm@osdl.org, Marcelo Tosatti , Balbir Singh , tmem-devel@oss.oracle.com, sunil.mushran@oracle.com, linux-mm@kvack.org Subject: [RFC PATCH 1/4] tmem: infrastructure for tmem layer In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 1.5.1 (304090) [OL 9.0.0.6627] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Source-IP: abhmt009.oracle.com [141.146.116.18] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010209.4A3C3CE7.0052:SCFSTAT5015188,ss=1,fgs=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2777 Lines: 74 --- linux-2.6.30/mm/Kconfig 2009-06-09 21:05:27.000000000 -0600 +++ linux-2.6.30-tmem/mm/Kconfig 2009-06-19 09:36:41.000000000 -0600 @@ -253,3 +253,30 @@ of 1 says that all excess pages should be trimmed. See Documentation/nommu-mmap.txt for more information. + +# +# support for transcendent memory +# +config TMEM + bool "Transcendent memory support" + depends on XEN # but in future may work without XEN + help + In a virtualized environment, allows unused and underutilized + system physical memory to be made accessible through a narrow + well-defined page-copy-based API. If unsure, say Y. + +config PRECACHE + bool "Cache clean pages in transcendent memory" + depends on TMEM + help + Allows the transcendent memory pool to be used to store clean + page-cache pages which, under some circumstances, will greatly + reduce paging and thus improve performance. If unsure, say Y. + +config PRESWAP + bool "Swap pages to transcendent memory" + depends on TMEM + help + Allows the transcendent memory pool to be used as a pseudo-swap + device which, under some circumstances, will greatly reduce + swapping and thus improve performance. If unsure, say Y. --- linux-2.6.30/mm/Makefile 2009-06-09 21:05:27.000000000 -0600 +++ linux-2.6.30-tmem/mm/Makefile 2009-06-19 09:33:59.000000000 -0600 @@ -16,6 +16,8 @@ obj-$(CONFIG_PROC_PAGE_MONITOR) += pagewalk.o obj-$(CONFIG_BOUNCE) += bounce.o obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o thrash.o +obj-$(CONFIG_PRESWAP) += preswap.o +obj-$(CONFIG_PRECACHE) += precache.o obj-$(CONFIG_HAS_DMA) += dmapool.o obj-$(CONFIG_HUGETLBFS) += hugetlb.o obj-$(CONFIG_NUMA) += mempolicy.o --- linux-2.6.30/include/linux/tmem.h 1969-12-31 17:00:00.000000000 -0700 +++ linux-2.6.30-tmem/include/linux/tmem.h 2009-06-19 11:21:58.000000000 -0600 @@ -0,0 +1,22 @@ +/* + * linux/tmem.h + * + * Interface to transcendent memory, used by mm/precache.c and mm/preswap.c + * + * Copyright (C) 2008,2009 Dan Magenheimer, Oracle Corp. + */ + +struct tmem_ops { + int (*new_pool)(u64 uuid_lo, u64 uuid_hi, u32 flags); + int (*put_page)(u32 pool_id, u64 object, u32 index, unsigned long gmfn); + int (*get_page)(u32 pool_id, u64 object, u32 index, unsigned long gmfn); + int (*flush_page)(u32 pool_id, u64 object, u32 index); + int (*flush_object)(u32 pool_id, u64 object); + int (*destroy_pool)(u32 pool_id); +}; + +extern struct tmem_ops *tmem_ops; + +/* flags for tmem_ops.new_pool */ +#define TMEM_POOL_PERSIST 1 +#define TMEM_POOL_SHARED 2 -- 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/