Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750894AbWBEPDK (ORCPT ); Sun, 5 Feb 2006 10:03:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750901AbWBEPDK (ORCPT ); Sun, 5 Feb 2006 10:03:10 -0500 Received: from web33007.mail.mud.yahoo.com ([68.142.206.71]:43670 "HELO web33007.mail.mud.yahoo.com") by vger.kernel.org with SMTP id S1750894AbWBEPDI (ORCPT ); Sun, 5 Feb 2006 10:03:08 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ZTHL4cMF8e3KsGBAzFxnXMKkLTdu0xK7E/4Qn3H0MjCqXb1PaBA+k2ppH0XpbEqUhIBZvPWnuD94m4J5/CAkDfxipgJLLJNQP7fjH7px8cqwGYmTwGhUC3i5yYpEi+NLHnJeJlzj1rVLPlC/4clpzGF03RP+muN7yhSi3cPSShQ= ; Message-ID: <20060205150259.1549.qmail@web33007.mail.mud.yahoo.com> Date: Sun, 5 Feb 2006 07:02:59 -0800 (PST) From: Shantanu Goel Subject: [VM PATCH] rotate_reclaimable_page fails frequently To: "linux-kernel@vger.kernel.org" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-676802627-1139151779=:94534" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9608 Lines: 185 --0-676802627-1139151779=:94534 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Id: Content-Disposition: inline Hi, It seems rotate_reclaimable_page fails most of the time due the page not being on the LRU when kswapd calls writepage(). The filesystem in my tests is ext3. The attached patch against 2.6.16-rc2 moves the page to the LRU before calling writepage(). Below are results for a write test with: dd if=/dev/zero of=test bs=1024k count=1024 To trigger the writeback path with the default dirty ratios, I set swappiness to 55 and mapped memory to about 80%. w/o patch (/proc/sys/vm/wb_put_lru = 0): pgrotcalls 25852 pgrotnonlru 25834 pgrotated 18 with patch (/proc/sys/vm/wb_put_lru = 1): pgrotcalls 26616 pgrotated 26616 Thanks, Shantanu __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --0-676802627-1139151779=:94534 Content-Type: application/octet-stream; name="vmscan-rotate-fix.patch" Content-Transfer-Encoding: base64 Content-Description: 1824612824-vmscan-rotate-fix.patch Content-Disposition: attachment; filename="vmscan-rotate-fix.patch" LS0tIC5vcmlnL2luY2x1ZGUvbGludXgvcGFnZS1mbGFncy5oCTIwMDYtMDIt MDUgMTA6MDA6NDguMDAwMDAwMDAwIC0wNTAwCisrKyAwMS12bXNjYW4tcm90 YXRlLWZpeC9pbmNsdWRlL2xpbnV4L3BhZ2UtZmxhZ3MuaAkyMDA2LTAyLTA0 IDA5OjE4OjE3LjAwMDAwMDAwMCAtMDUwMApAQCAtMTQ5LDYgKzE0OSwxMiBA QAogCiAJdW5zaWduZWQgbG9uZyBwZ3JvdGF0ZWQ7CS8qIHBhZ2VzIHJvdGF0 ZWQgdG8gdGFpbCBvZiB0aGUgTFJVICovCiAJdW5zaWduZWQgbG9uZyBucl9i b3VuY2U7CS8qIHBhZ2VzIGZvciBib3VuY2UgYnVmZmVycyAqLworCisJdW5z aWduZWQgbG9uZyBwZ3JvdGNhbGxzOwkvKiBwYWdlIHJvdGF0aW9uIHN0YXRz ICovCisJdW5zaWduZWQgbG9uZyBwZ3JvdGxvY2tlZDsKKwl1bnNpZ25lZCBs b25nIHBncm90ZGlydHk7CisJdW5zaWduZWQgbG9uZyBwZ3JvdGFjdGl2ZTsK Kwl1bnNpZ25lZCBsb25nIHBncm90bm9ubHJ1OwogfTsKIAogZXh0ZXJuIHZv aWQgZ2V0X3BhZ2Vfc3RhdGUoc3RydWN0IHBhZ2Vfc3RhdGUgKnJldCk7Ci0t LSAub3JpZy9pbmNsdWRlL2xpbnV4L3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UpKTsKKwkJfSBlbHNlIHsKKwkJCXBhZ2VfY2Fj aGVfcmVsZWFzZShwYWdlKTsKKwkJfQogCX0KIAlsaXN0X3NwbGljZSgmcmV0 X3BhZ2VzLCBwYWdlX2xpc3QpOwogCWlmIChwYWdldmVjX2NvdW50KCZmcmVl ZF9wdmVjKSkKQEAgLTYzNyw3ICs2NzIsNyBAQAogCiAJaWYgKFBhZ2VEaXJ0 eShwYWdlKSkgewogCQkvKiBQYWdlIGlzIGRpcnR5LCB0cnkgdG8gd3JpdGUg aXQgb3V0IGhlcmUgKi8KLQkJc3dpdGNoKHBhZ2VvdXQocGFnZSwgbWFwcGlu ZykpIHsKKwkJc3dpdGNoKHBhZ2VvdXQocGFnZSwgbWFwcGluZywgTlVMTCkp IHsKIAkJY2FzZSBQQUdFX0tFRVA6CiAJCWNhc2UgUEFHRV9BQ1RJVkFURToK IAkJCWdvdG8gdW5sb2NrX3JldHJ5OwpAQCAtOTM2LDcgKzk3MSw3IEBACiAJ CSAqIFRyaWdnZXIgd3JpdGVvdXQgaWYgcGFnZSBpcyBkaXJ0eQogCQkgKi8K IAkJaWYgKFBhZ2VEaXJ0eShwYWdlKSkgewotCQkJc3dpdGNoIChwYWdlb3V0 KHBhZ2UsIG1hcHBpbmcpKSB7CisJCQlzd2l0Y2ggKHBhZ2VvdXQocGFnZSwg bWFwcGluZywgTlVMTCkpIHsKIAkJCWNhc2UgUEFHRV9LRUVQOgogCQkJY2Fz ZSBQQUdFX0FDVElWQVRFOgogCQkJCWdvdG8gdW5sb2NrX2JvdGg7Cg== --0-676802627-1139151779=:94534-- - 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/