Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262432AbTIUP3A (ORCPT ); Sun, 21 Sep 2003 11:29:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262433AbTIUP27 (ORCPT ); Sun, 21 Sep 2003 11:28:59 -0400 Received: from web12802.mail.yahoo.com ([216.136.174.37]:57362 "HELO web12802.mail.yahoo.com") by vger.kernel.org with SMTP id S262432AbTIUP24 (ORCPT ); Sun, 21 Sep 2003 11:28:56 -0400 Message-ID: <20030921152855.61809.qmail@web12802.mail.yahoo.com> Date: Sun, 21 Sep 2003 08:28:55 -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: <20030921151418.GA29703@velociraptor.random> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1586994407-1064158135=:61713" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7674 Lines: 154 --0-1586994407-1064158135=:61713 Content-Type: text/plain; charset=us-ascii Content-Id: Content-Disposition: inline Great suggestion. Attached is a fixed patch. --- Andrea Arcangeli wrote: > On Sun, Sep 21, 2003 at 07:51:27AM -0700, Shantanu > Goel wrote: > > 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. > > I overlooked the *failed_swapout, I thought you used > only 0 and 1 as > parameters, the new version is fine. > > BTW, it would also be cleaner to add a __ in front > of the function name, > and to #define a _force version that will pass 1, so > you don't have less > readable 0/1 in the caller, but I don't mind even > with the status in > version 2 (it's simple enough to understand the > semantics of the 0/1). > > 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-1586994407-1064158135=:61713 Content-Type: application/octet-stream; name="vfs-interval3.patch" Content-Transfer-Encoding: base64 Content-Description: vfs-interval3.patch Content-Disposition: attachment; filename="vfs-interval3.patch" LS0tIC4va2VybmVsL3N5c2N0bC5jLn4xfgkyMDAzLTA5LTE2IDIwOjQ0OjE0 LjAwMDAwMDAwMCAtMDQwMAorKysgLi9rZXJuZWwvc3lzY3RsLmMJMjAwMy0w OS0yMSAwMDo0OTozMi4wMDAwMDAwMDAgLTA0MDAKQEAgLTI4MSw2ICsyODEs OCBAQAogCSAmdm1fZ2ZwX2RlYnVnLCBzaXplb2YoaW50KSwgMDY0NCwgTlVM TCwgJnByb2NfZG9pbnR2ZWN9LAogCXtWTV9WRlNfU0NBTl9SQVRJTywgInZt X3Zmc19zY2FuX3JhdGlvIiwgCiAJICZ2bV92ZnNfc2Nhbl9yYXRpbywgc2l6 ZW9mKGludCksIDA2NDQsIE5VTEwsICZwcm9jX2RvaW50dmVjfSwKKwl7Vk1f VkZTX1NDQU5fSU5URVJWQUwsICJ2bV92ZnNfc2Nhbl9pbnRlcnZhbCIsIAor CSAmdm1fdmZzX3NjYW5faW50ZXJ2YWwsIHNpemVvZihpbnQpLCAwNjQ0LCBO VUxMLCAmcHJvY19kb2ludHZlY30sCiAJe1ZNX0NBQ0hFX1NDQU5fUkFUSU8s ICJ2bV9jYWNoZV9zY2FuX3JhdGlvIiwgCiAJICZ2bV9jYWNoZV9zY2FuX3Jh dGlvLCBzaXplb2YoaW50KSwgMDY0NCwgTlVMTCwgJnByb2NfZG9pbnR2ZWN9 LAogCXtWTV9NQVBQRURfUkFUSU8sICJ2bV9tYXBwZWRfcmF0aW8iLCAKLS0t IC4vbW0vdm1zY2FuLmMufjF+CTIwMDMtMDktMTYgMjA6NDQ6MTQuMDAwMDAw MDAwIC0wNDAwC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DAwMDAwMDAwIC0wNDAwCkBAIC0xNTQsNiArMTU0LDcg QEAKIAlWTV9HRlBfREVCVUc9MTgsICAgICAgICAvKiBkZWJ1ZyBHRlAgZmFp bHVyZXMgKi8KIAlWTV9DQUNIRV9TQ0FOX1JBVElPPTE5LCAvKiBwYXJ0IG9m IHRoZSBpbmFjdGl2ZSBjYWNoZSBsaXN0IHRvIHNjYW4gKi8KIAlWTV9NQVBQ RURfUkFUSU89MjAsICAgICAvKiBhbW91bnQgb2YgdW5mcmVlYWJsZSBwYWdl cyB0aGF0IHRyaWdnZXJzIHN3YXBvdXQgKi8KKwlWTV9WRlNfU0NBTl9JTlRF UlZBTD0yMSwvKiBpbnRlcnZhbCAoaW4gc2VjcykgYmV0d2VlbiByZWNsYWlt aW5nIG1lbW9yeSBmcm9tIGlub2RlL2RlbnRyeSBjYWNoZSAqLwogfTsKIAog Cg== --0-1586994407-1064158135=:61713-- - 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/