Nishanth Aravamudan wrote:
>> + }
>> + DEBUG("Attempting to unmap %ld bytes @ %p\n", -delta,
>> + heapbase + mapsize + delta);
>> + ret = munmap(heapbase + mapsize + delta, -delta);
>> + if (ret) {
>> + WARNING("Unmapping failed in hugetlbfs_morecore()\n");
>
> Maybe a strerror(errno) in there, so we might be able to see why?
>
>> + } else {
>> +
>> + /*
>> + * Now shrink the hugetlbfs file.
>> + */
>> + mapsize += delta;
>> + ret = ftruncate(heap_fd, mapsize);
>> + if (ret) {
>> + WARNING("Couldn't toss pages in "
>> + "hugetlbfs_morecore()\n");
>
> I would just say "Couldn't truncate hugetlbfs file in
> hugetlbfs_morecore()". Maybe a strerror(errno) here too.
I debated whether these two WARNINGs ought to be fatal. Reading the man
pages I believe the only possible errnos would be EINVAL or EBADF.
These would seem to indicate bugs in hugetlbfs_morecore or data corruption.
>> diff -ruNp libhugetlbfs-1.2-rename-newsize/tests/heapshrink.c
>> libhugetlbfs-1.2-shrink/tests/heapshrink.c
>> --- libhugetlbfs-1.2-rename-newsize/tests/heapshrink.c 1969-12-31
>> 18:00:00.000000000 -0600
>> +++ libhugetlbfs-1.2-shrink/tests/heapshrink.c 2007-11-02
>> 14:56:11.000000000 -0500
>
> Testcase seems sane.
>
> Does the HOWTO need updating at all?
Yes. I'll post an updated patch with this and the other changes you
suggested.
Thanks!
-Andrew
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Libhugetlbfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel