[lkml]   [2007]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectFull buffer cache not working properly
I run several times the following test and what I've seen is that when 
the buffer cache becomes full, unneeded dirty buffer heads are not evicted
and no other memory allocation can happen (including reading a block
from the disk to the buffer cache). Should this happen?
Here's the code that reproduces this issue:

for(i = 0; i < get_capacity(bdev->bd_disk)/8; i++) {
bh = __bread(bdev, i, PAGE_SIZE);
memset(bh->b_data, 0, PAGE_SIZE);

I added some printks printing the buffer head's reference counter: after
the '__bread' ref count is 2, after '__brelse' ref count is 1. Shouldn't
numbers be 1 and 0 respectively? I added an extra 'put_bh' before (or
after) the '__brelse' but I get a BUG().
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-07-13 04:01    [W:0.027 / U:2.376 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site