miniroot ramdisk corruption during intense memory usage
The following sympthom occured in a variant of the Knoppix-like linux appliance.
I get a corrupted miniroot ramdisk filesystem under kernel version 2.6.19.1 under intense memory usage during early startup of the system.
In the course of a lengthy investigation of this behavior, I found out that the memory pages containing the miniroot ramdisk are freed during the initial installation
process due to a memory shortage. It turned out, that shrink_active_list() calls pagevec_strip(), which in turn calls try_to_release_page() which finally calls try_to_free_buffers() which drops the corresponding buffers; if this succeeds, it seems to cause the page to become freed later.
This causes pointers of indirect blocks of the filesystem of the miniroot ramdisk to be replaced by zero-filled pages later in the the system's history.
I fixed this by adding a new flag PG_ramdisk in the include file page-flags.h, setting the flag during ramdisk loading in ramdisk_commit_write() and checking for the flag in try_to_free_buffers() and retruning 0 as result immediately without freeing the buffers.
I am not aware if that is the adequate way to solve the problem or if there is a solution that requires fewer and more localized changes of the system, avoiding to give the ramdisk pages a specific treatment
I did not observe this problem prior to kernel version 2.6.19.1, but I'm not sure whether ths was simply caused by coincidental circumstances during startup.
Peter Bier
_______________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
Quoted 12 lines · Peter Bier
The following sympthom occured in a variant of the Knoppix-like linux appliance.
I get a corrupted miniroot ramdisk filesystem under kernel version 2.6.19.1 under intense memory usage during early startup of the system.
In the course of a lengthy investigation of this behavior, I found out that the memory pages containing the miniroot ramdisk are freed during the initial installation
process due to a memory shortage. It turned out, that
shrink_active_list()callspagevec_strip(), which in turn callstry_to_release_page()which finally callstry_to_free_buffers()which drops the corresponding buffers; if this succeeds, it seems to cause the page to become freed later.This causes pointers of indirect blocks of the filesystem of the miniroot ramdisk to be replaced by zero-filled pages later in the the system's history.
I fixed this by adding a new flag
PG_ramdiskin the include filepage-flags.h, setting the flag during ramdisk loading inramdisk_commit_write()and checking for the flag intry_to_free_buffers()and retruning 0 as result immediately without freeing the buffers.
Quoted 7 lines
I am not aware if that is the adequate way to solve the problem or if there is a solution that requires fewer and more localized changes of the system, avoiding to give the ramdisk pages a specific treatment
I did not observe this problem prior to kernel version 2.6.19.1, but I'm not sure whether ths was simply caused by coincidental circumstances during startup.
The ramdisk driver already marks the pages as "do not discard". Maybe you should investigate why that is no longer being respected?