Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262422AbTIUOvm (ORCPT ); Sun, 21 Sep 2003 10:51:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262424AbTIUOvm (ORCPT ); Sun, 21 Sep 2003 10:51:42 -0400 Received: from web12811.mail.yahoo.com ([216.136.174.128]:47460 "HELO web12811.mail.yahoo.com") by vger.kernel.org with SMTP id S262422AbTIUOv2 (ORCPT ); Sun, 21 Sep 2003 10:51:28 -0400 Message-ID: <20030921145127.39547.qmail@web12811.mail.yahoo.com> Date: Sun, 21 Sep 2003 07:51:27 -0700 (PDT) From: Shantanu Goel Subject: Re: A couple of 2.4.23-pre4 VM nits To: Andrea Arcangeli Cc: linux-kernel@vger.kernel.org, Marcelo Tosatti In-Reply-To: <20030921140404.GA16399@velociraptor.random> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1908661250-1064155887=:39371" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7365 Lines: 147 --0-1908661250-1064155887=:39371 Content-Type: text/plain; charset=us-ascii Content-Id: Content-Disposition: inline I just realized the original code had one desirable behaviour that my patch is missing, namely, it reclaimed memory from dcache/inode every time swap_out is called. Please use the attached patch that restores the original behaviour. Otherwise, if the interval is very long, no reclamation will happen until swap_out() fails which in the common case is unlikely. Thanks, Shantanu --- Andrea Arcangeli wrote: > On Sat, Sep 20, 2003 at 10:32:09PM -0700, Shantanu > Goel wrote: > > Agreed on all counts. I just blindly copied the > > max_scan decrement from 2.4.22. Even there your > > suggestion would make sense. Attached is a new > patch > > which adds support for vm_vfs_scan_interval sysctl > and > > also fixes the location of max_scan decrement. > > this patch looks fine to me thanks. Marcelo, feel > free to merge this one > instead of my one liner fix. > > Andrea - If you prefer relying on open source > software, check these links: > > rsync.kernel.org::pub/scm/linux/kernel/bkcvs/linux-2.[45]/ > http://www.cobite.com/cvsps/ > svn://svn.kernel.org/linux-2.[46]/trunk __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com --0-1908661250-1064155887=:39371 Content-Type: application/octet-stream; name="vfs-interval2.patch" Content-Transfer-Encoding: base64 Content-Description: vfs-interval2.patch Content-Disposition: attachment; filename="vfs-interval2.patch" LS0tIC4va2VybmVsL3N5c2N0bC5jLn4xfgkyMDAzLTA5LTE2IDIwOjQ0OjE0 LjAwMDAwMDAwMCAtMDQwMAorKysgLi9rZXJuZWwvc3lzY3RsLmMJMjAwMy0w OS0yMSAwMDo0OTozMi4wMDAwMDAwMDAgLTA0MDAKQEAgLTI4MSw2ICsyODEs OCBAQAogCSAmdm1fZ2ZwX2RlYnVnLCBzaXplb2YoaW50KSwgMDY0NCwgTlVM TCwgJnByb2NfZG9pbnR2ZWN9LAogCXtWTV9WRlNfU0NBTl9SQVRJTywgInZt X3Zmc19zY2FuX3JhdGlvIiwgCiAJICZ2bV92ZnNfc2Nhbl9yYXRpbywgc2l6 ZW9mKGludCksIDA2NDQsIE5VTEwsICZwcm9jX2RvaW50dmVjfSwKKwl7Vk1f VkZTX1NDQU5fSU5URVJWQUwsICJ2bV92ZnNfc2Nhbl9pbnRlcnZhbCIsIAor CSAmdm1fdmZzX3NjYW5faW50ZXJ2YWwsIHNpemVvZihpbnQpLCAwNjQ0LCBO VUxMLCAmcHJvY19kb2ludHZlY30sCiAJe1ZNX0NBQ0hFX1NDQU5fUkFUSU8s ICJ2bV9jYWNoZV9zY2FuX3JhdGlvIiwgCiAJICZ2bV9jYWNoZV9zY2FuX3Jh dGlvLCBzaXplb2YoaW50KSwgMDY0NCwgTlVMTCwgJnByb2NfZG9pbnR2ZWN9 LAogCXtWTV9NQVBQRURfUkFUSU8sICJ2bV9tYXBwZWRfcmF0aW8iLCAKLS0t IC4vbW0vdm1zY2FuLmMufjF+CTIwMDMtMDktMTYgMjA6NDQ6MTQuMDAwMDAw MDAwIC0wNDAwCisrKyAuL21tL3Ztc2Nhbi5jCTIwM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F9SQVRJTz0yMCwgICAgIC8q IGFtb3VudCBvZiB1bmZyZWVhYmxlIHBhZ2VzIHRoYXQgdHJpZ2dlcnMgc3dh cG91dCAqLworCVZNX1ZGU19TQ0FOX0lOVEVSVkFMPTIxLC8qIGludGVydmFs IChpbiBzZWNzKSBiZXR3ZWVuIHJlY2xhaW1pbmcgbWVtb3J5IGZyb20gaW5v ZGUvZGVudHJ5IGNhY2hlICovCiB9OwogCiAK --0-1908661250-1064155887=:39371-- - 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/