On 21.03.2007 [15:40:54 -0700], Nishanth Aravamudan wrote:
> On 21.03.2007 [15:39:52 -0700], Nishanth Aravamudan wrote:
> > Here are the patches I'm going to ask Adam to pull tomorrow:
> >
> > + 08279399b7361d12180edca95144187f521ddbea tests/Makefile: don't use 'new'
> > make syntax
> > + b95c3ddfe2f7e311e86004d60b0db39a0a2bce6b Revert "elflink: drop hugepage
> > cached pages for writable segments"
> > + 58e9a9e4f70967f9d88d621eecd34346d92b936e hugeutils: one missed
> > gethugepagesize() conversion
> > + d4f48941f56749642ba1ee9d1764f628f6433671 morecore: mlock() failure is
> > non-fatal
> > + a06e6114ac1ab180393fcb40e4f131a38d19a5f4 Revert ae76f97ae76f97...
> > hugeutils: remove hugetlbfs_vaddr_granularity in favor of slice functions
> > + 3a43f5d351e0ee694a7b66565b89b81ad961d7a1 hugeutils: move
> > hugetlbfs_vaddr_granularity
> >
> > The first through fourth patches have been posted before.
> >
> > The last two will be posted in response to this, with explanations.
hugeutils: move hugetlbfs_vaddr_granularity
The semantics of the granularity function are such that it is only
useful in morecore itself (and it's only used there, for that same
reason). Move the definition to morecore.c and remove the declaration
from hugetlbfs.h (it shouldn't have been there anyways, since it isn't
visible outside of the lib).
Also, add an ia64 to the now morecore-specific function.
Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]>
diff --git a/hugetlbfs.h b/hugetlbfs.h
index 966e57c..ec48732 100644
--- a/hugetlbfs.h
+++ b/hugetlbfs.h
@@ -22,7 +22,6 @@
#define HUGETLBFS_MAGIC 0x958458f6
long gethugepagesize(void);
-long hugetlbfs_vaddr_granularity(void);
int hugetlbfs_test_path(const char *mount);
const char *hugetlbfs_find_path(void);
int hugetlbfs_unlinked_fd(void);
diff --git a/hugeutils.c b/hugeutils.c
index 1c30bb0..5bda42d 100644
--- a/hugeutils.c
+++ b/hugeutils.c
@@ -114,17 +114,6 @@ long gethugepagesize(void)
return hpage_size;
}
-long hugetlbfs_vaddr_granularity(void)
-{
-#if defined(__powerpc64__)
- return (1L << 40);
-#elif defined(__powerpc__)
- return (1L << 28);
-#else
- return gethugepagesize();
-#endif
-}
-
int hugetlbfs_test_path(const char *mount)
{
struct statfs64 sb;
diff --git a/morecore.c b/morecore.c
index 0c16e01..e7a5c1d 100644
--- a/morecore.c
+++ b/morecore.c
@@ -39,6 +39,22 @@ static void *heapbase;
static void *heaptop;
static long mapsize;
+static long hugetlbfs_next_addr(long addr)
+{
+#if defined(__powerpc64__)
+ return ALIGN(addr, 1L << 40);
+#elif defined(__powerpc__)
+ return ALIGN(addr, 1L << 28);
+#elif defined(__ia64__)
+ if (addr < (1L << 63))
+ return ALIGN(addr, 1L << 63);
+ else
+ return ALIGN(addr, gethugepagesize());
+#else
+ return ALIGN(addr, gethugepagesize());
+#endif
+}
+
/*
* Our plan is to ask for pages 'roughly' at the BASE. We expect and
* require the kernel to offer us sequential pages from wherever it
@@ -165,7 +181,7 @@ static void __attribute__((constructor))
setup_morecore(void)
}
} else {
heapaddr = (unsigned long)sbrk(0);
- heapaddr = ALIGN(heapaddr, hugetlbfs_vaddr_granularity());
+ heapaddr = hugetlbfs_next_addr(heapaddr);
}
DEBUG("setup_morecore(): heapaddr = 0x%lx\n", heapaddr);
--
Nishanth Aravamudan <[EMAIL PROTECTED]>
IBM Linux Technology Center
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Libhugetlbfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel