--0-152035907-921219220=:17679
Content-Type: TEXT/PLAIN; charset=US-ASCII
here's a patch i've been working on to help reduce system performance
problems when manipulating large files. as i mentioned in an earlier
message to this list, measurable performance degradation occurs when the
buffer cache grows very large. this can occur when copying very large
files, or when running filesystem-intensive applications that have a file
data working set larger than physical memory.
this patch has several purposes.
first, it adds instrumentation to the buffer cache code. this
instrumentation could be used with some later implementation of sar to
gather data about buffer cache performance. i'd like some comments from
the list about whether these are the right set of events to monitor. once
there is a reasonable set of counters, i can add a /proc file that exports
this data from the kernel.
second, it restores an upper bound to buffer cache growth. my theory is
that the degraded scenario occurs when shrink_mmap() begins to steal pages
back from the buffer cache via try_to_free_buffers(). because
shrink_mmap() specifies an arbitrary page it wants back, the buffer cache
LRU ordering is compromised. if this occurs once or twice, usually the
harm is minimal. when this happens repeatedly over a short period of
time, as might happen when the system is experiencing a VM shortage, this
can have catastrophic performance impact.
in order to reduce the number of "buffer shrink" operations, the code now
uses a simple algorithm to decide when to expand the cache size. if there
have been more grow requests than shrink requests, the cache continues to
expand; otherwise, it stops growing the cache until balance is restored.
if the growth request would make the cache larger than
buffer_mem.max_percent, it also stops growing the cache.
third, there is some code clean-up in this patch. panic and console
messages are clearer, and some extraneous code has been removed. as well,
the <alt>-<sysrq>-M output contains new statistics from the
instrumentation i added.
there is still a problem with my patch. when the buffer cache stops
growing, it begins recycling buffers instead of adding fresh pages to the
cache in order to replenish the free buffer list. as soon as this
happens, any filesystem-intensive operations block, although there is
still significant disk activity. programs continue to run, albeit slowly.
you can see this if you watch the "blocked processes" column of vmstat
while applications are running. this behavior is similar to
system/application behavior on the stock kernel during the degraded
scenario, so it might be a good way to reproduce the original problem.
i'd like some help solving the blocked processes problem, and comments on
the instrumentation. thanks!
- Chuck Lever
-- corporate: <chuckl@netscape.com> personal: <chucklever@netscape.net> or <cel@monkey.org>The Linux Scalability project: http://www.citi.umich.edu/projects/citi-netscape/
--0-152035907-921219220=:17679 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="buffer.patch" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.BSF.4.03.9903120113400.17679@funky.monkey.org> Content-Description: Content-Disposition: attachment; filename="buffer.patch"
ZGlmZiAtdSAtciBsaW51eC0yLjIuMy1yZWZlcmVuY2UvZnMvYnVmZmVyLmMg bGludXgvZnMvYnVmZmVyLmMNCi0tLSBsaW51eC0yLjIuMy1yZWZlcmVuY2Uv ZnMvYnVmZmVyLmMJVHVlIE1hciAgOSAxMzo1ODo0MiAxOTk5DQorKysgbGlu dXgvZnMvYnVmZmVyLmMJRnJpIE1hciAxMiAwMDo0Mjo0OSAxOTk5DQpAQCAt NDksOCArNDksOSBAQA0KICAtMSwgLTEsIC0xLCAtMSwgLTEsIC0xLCAtMSwg LTEsIC0xLC0xLCAtMSwgLTEsIC0xLCAtMSwgLTEsIC0xLA0KICAgNn07DQog DQorI2RlZmluZSBNSU5fQlVGU0laRSA1MTINCiAjZGVmaW5lIEJVRlNJWkVf SU5ERVgoWCkgKChpbnQpIGJ1ZmZlcnNpemVfaW5kZXhbKFgpPj45XSkNCi0j ZGVmaW5lIE1BWF9CVUZfUEVSX1BBR0UgKFBBR0VfU0laRSAvIDUxMikNCisj ZGVmaW5lIE1BWF9CVUZfUEVSX1BBR0UgKFBBR0VfU0laRSAvIE1JTl9CVUZT SVpFKQ0KICNkZWZpbmUgTlJfUkVTRVJWRUQgKDIqTUFYX0JVRl9QRVJfUEFH RSkNCiAjZGVmaW5lIE1BWF9VTlVTRURfQlVGRkVSUyBOUl9SRVNFUlZFRCsy MCAvKiBkb24ndCBldmVyIGhhdmUgbW9yZSB0aGFuIHRoaXMgDQogCQkJCQkg ICAgIG51bWJlciBvZiB1bnVzZWQgYnVmZmVyIGhlYWRzICovDQpAQCAtMTE0 LDYgKzExNSwzNiBAQA0KIGludCBiZGZsdXNoX21pbltOX1BBUkFNXSA9IHsg IDAsICAxMCwgICAgNSwgICAyNSwgIDAsICAgMSpIWiwgICAxKkhaLCAxLCAx fTsNCiBpb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MTk5LDkgKzE5OSw3IEBADQog DQogCQkvKiBJcyBpdCBhIGJ1ZmZlciBwYWdlPyAqLw0KIAkJaWYgKHBhZ2Ut PmJ1ZmZlcnMpIHsNCi0JCQlpZiAoYnVmZmVyX3VuZGVyX21pbigpKQ0KLQkJ CQljb250aW51ZTsNCi0JCQlpZiAoIXRyeV90b19mcmVlX2J1ZmZlcnMocGFn ZSkpDQorCQkJaWYgKCF0cnlfdG9fZnJlZV9idWZmZXJzKHBhZ2UsIHByaW9y aXR5KSkNCiAJCQkJY29udGludWU7DQogCQkJcmV0dXJuIDE7DQogCQl9DQo= --0-152035907-921219220=:17679--
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/