Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261889AbTITNjd (ORCPT ); Sat, 20 Sep 2003 09:39:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261890AbTITNjd (ORCPT ); Sat, 20 Sep 2003 09:39:33 -0400 Received: from web12811.mail.yahoo.com ([216.136.174.128]:27231 "HELO web12811.mail.yahoo.com") by vger.kernel.org with SMTP id S261889AbTITNjb (ORCPT ); Sat, 20 Sep 2003 09:39:31 -0400 Message-ID: <20030920133930.17399.qmail@web12811.mail.yahoo.com> Date: Sat, 20 Sep 2003 06:39:30 -0700 (PDT) From: Shantanu Goel Subject: A couple of 2.4.23-pre4 VM nits To: andrea@suse.de Cc: linux-kernel@vger.kernel.org In-Reply-To: <20030830050111.GD640@wind.cocodriloo.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-395039124-1064065170=:17117" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4532 Lines: 95 --0-395039124-1064065170=:17117 Content-Type: text/plain; charset=us-ascii Content-Id: Content-Disposition: inline Hi Andrea, The VM fixes perform rather well in my testing (thanks!), but I noticed a couple of glitches that the attached patch addresses. 1. max_scan is never decremented in shrink_cache(). I am assuming this is a typo. 2. The second part of the patch makes sure that inode/dentry caches are shrunk at least once every 5 secs. On a machine with a heavy inode stat/directory lookup load (e.g. NFS server), most of the memory winds up sitting idle in unused inodes/dentry. The present code only reclaims these when a swap_out() happens or shrink_caches() fails. This can take a while on a machine will very few mapped pages such as an NFS server. Thanks, Shantanu __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com --0-395039124-1064065170=:17117 Content-Type: application/octet-stream; name="vmscan.patch" Content-Transfer-Encoding: base64 Content-Description: vmscan.patch Content-Disposition: attachment; filename="vmscan.patch" LS0tIHZtc2Nhbi5jLn4xfgkyMDAzLTA5LTE2IDIwOjQ0OjE0LjAwMDAwMD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mUpOwpAQCAtNjE0 LDYgKzYyNCw4IEBACiAJaWYgKG5yX3BhZ2VzIDw9IDApCiAJCWdvdG8gb3V0 OwogCisJc2hyaW5rX3Zmc19jYWNoZXMoMCwgZ2ZwX21hc2spOworCiAJc3Bp bl9sb2NrKCZwYWdlbWFwX2xydV9sb2NrKTsKIAlyZWZpbGxfaW5hY3RpdmUo bnJfcGFnZXMsIGNsYXNzem9uZSk7CiAKQEAgLTYzOCwxMSArNjUwLDkgQEAK IAkJCW5yX3BhZ2VzID0gc2hyaW5rX2NhY2hlcyhjbGFzc3pvbmUsIGdmcF9t YXNrLCBucl9wYWdlcywgJmZhaWxlZF9zd2Fwb3V0KTsKIAkJCWlmIChucl9w YWdlcyA8PSAwKQogCQkJCXJldHVybiAxOwotCQkJc2hyaW5rX2RjYWNoZV9t ZW1vcnkodm1fdmZzX3NjYW5fcmF0aW8sIGdmcF9tYXNrKTsKLQkJCXNocmlu a19pY2FjaGVfbWVtb3J5KHZtX3Zmc19zY2FuX3JhdGlvLCBnZnBfbWFzayk7 Ci0jaWZkZWYgQ09ORklHX1FVT1RBCi0JCQlzaHJpbmtfZHFjYWNoZV9tZW1v cnkodm1fdmZzX3NjYW5fcmF0aW8sIGdmcF9tYXNrKTsKLSNlbmRpZgorCisJ CQlzaHJpbmtfdmZzX2NhY2hlcygxLCBnZnBfbWFzayk7CisKIAkJCWlmICgh ZmFpbGVkX3N3YXBvdXQpCiAJCQkJZmFpbGVkX3N3YXBvdXQgPSAhc3dhcF9v dXQoY2xhc3N6b25lKTsKIAkJfSB3aGlsZSAoLS10cmllcyk7Cg== --0-395039124-1064065170=:17117-- - 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/