Buffer Heads tend to be allocated in low memory (SLAB_NOFS) but point to 
pages in high memory.  If low memory is under heavy pressure, but high 
memory is not, then buffer heads in low memory that point to buffers in 
high memory are never freed.  This can cause OOM errors when there is 
still plenty of memory and plenty of buffer heads that could be easily 
freed.
Addint the following while loop to 
try_to_free_pages/try_to_free_pages_zone and trying to free pages again 
seems to alleviate the problem.
    Ross
                /* Problem, we couldn't free up the memory we want.
                   Currently buffer heads all end up in lowmem, so
                   we may be able to free up some low mem by freeing
                   up some highmem.  Try to do that. */
                while (pgdat) {
                        for (zone = pgdat->node_zones + MAX_NR_ZONES-1;
                             zone > classzone &&
                             zone >= pgdat->node_zones ;
                             zone--) {
                                shrink_caches(zone, priority, gfp_mask,
                                              nr_pages *
                                              (PAGE_SIZE /
                                               sizeof(struct 
buffer_head) + 1)
                                              * 8);
                        }
                        pgdat = pgdat->node_next;
                }
-
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/