Eric Sandeen wrote:
> David Chinner wrote:
>
>
>> On Tue, Aug 07, 2007 at 09:58:50PM -0500, Eric Sandeen wrote:
>>
>>
>>> yeah, figured it had something to do w/ the ia64 weenies when I saw the
>>> 32 vs. 8, factor of 4 ... fine, fine, my bad. :)
>>>
>>>
>> No, not your bad. Mine if anyones because I wrote the test.
>>
>> Cheers,
>>
>> Dave.
>>
>>
> Well, I was going to look at it more closely before I sent it off :)
>
> What do you think of a patch like this, to munmap 16k chunks regardless
> of page size:
>
Er, bad patch-ninja-boy, don't hand-edit :)
--- src/unwritten_mmap.c.orig 2007-08-07 22:53:08.962031839 -0500
+++ src/unwritten_mmap.c 2007-08-07 23:04:14.230540957 -0500
@@ -12,6 +12,7 @@
*/
int main(int argc, char **argv) {
unsigned long long o;
+ int minsize;
int fd, i;
struct xfs_flock64 space;
unsigned char *buf;
@@ -23,6 +24,13 @@
errno = 0;
o = strtoull(argv[1], NULL, 0);
+
+ minsize = 3*16384; /* 3 ia64 pages */
+ if (o < minsize) {
+ fprintf(stderr, "count must be at least %d\n", minsize);
+ exit(1);
+ }
+
if (errno) {
perror("strtoull");
exit(errno);
@@ -55,9 +63,9 @@
perror("mmap()");
exit(5);
} else {
- buf[o-1] = 0;
- buf[o/2] = 0;
- buf[0] = 0;
+ memset(buf, 0, 16384);
+ memset(buf+o/2, 0, 16384);
+ memset(buf+o-16384, 0, 16384);
munmap(buf, o);
}
|