Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 10 Nov 2000 18:32:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 10 Nov 2000 18:31:54 -0500 Received: from e34.co.us.ibm.com ([32.97.110.132]:46294 "EHLO e34.esmtp.ibm.com") by vger.kernel.org with ESMTP id ; Fri, 10 Nov 2000 18:31:39 -0500 Importance: Normal Subject: [patch] nfsd optimizations for test10 To: linux-kernel@vger.kernel.org Cc: nfs@lists.sourceforge.net, hjl@valinux.com X-Mailer: Lotus Notes Release 5.0.2a (Intl) 23 November 1999 Message-ID: From: "Ying Chen/Almaden/IBM" Date: Fri, 10 Nov 2000 15:31:31 -0800 X-MIMETrack: Serialize by Router on D03NM042/03/M/IBM(Release 5.0.5 |September 22, 2000) at 11/10/2000 03:31:33 PM MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=882569930080B3208f9e8a93df938690918c882569930080B320" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org --0__=882569930080B3208f9e8a93df938690918c882569930080B320 Content-type: text/plain; charset=us-ascii Hi, I made some optimizations on racache in nfsd in test10. The idea is to replace with existing fixed length table for readahead cache in NFSD with a hash table. The old racache is essentially ineffective in dealing with large # of files, and yet eats CPU cycles in scanning the table (even though the table is small), the hash table-based is much more effective and fast. I have generated the patch for test10 and tested it. (See attached file: nfshdiff)(See attached file: nfsdiff) Ying --0__=882569930080B3208f9e8a93df938690918c882569930080B320 Content-type: application/octet-stream; name="nfshdiff" Content-Disposition: attachment; filename="nfshdiff" Content-transfer-encoding: base64 ZGlmZiAtcnVOIG5mc2Qub3JpZy9uZnNkLmggbmZzZC5vcHQvbmZzZC5oCi0tLSBuZnNkLm9yaWcv bmZzZC5oCUZyaSBOb3YgMTAgMTU6Mjc6MzcgMjAwMAorKysgbmZzZC5vcHQvbmZzZC5oCUZyaSBO b3YgMTAgMTY6MDM6NDMgMjAwMApA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CAtMjUsOCArMjUsOCBAQAogCQkJCQkgKiBvZiBhdmFpbGFibGUgdGhyZWFk cyB3ZXJlIGluIHVzZSAqLwogCXVuc2lnbmVkIGludAl0aF9mdWxsY250OwkvKiBudW1iZXIgb2Yg dGltZXMgbGFzdCBmcmVlIHRocmVhZCB3YXMgdXNlZCAqLwogCXVuc2lnbmVkIGludAlyYV9zaXpl OwkvKiBzaXplIG9mIHJhIGNhY2hlICovCi0JdW5zaWduZWQgaW50CXJhX2RlcHRoWzExXTsJLyog bnVtYmVyIG9mIHRpbWVzIHJhIGVudHJ5IHdhcyBmb3VuZCB0aGF0IGRlZXAKLQkJCQkJICogaW4g dGhlIGNhY2hlICgxMHBlcmNlbnRpbGVzKS4gWzEwXSA9IG5vdCBmb3VuZCAqLworCXVuc2lnbmVk IGludAlyYV9oaXRzOwkvKiByYSBjYWNoZSBoaXRzICovCisJdW5zaWduZWQgaW50CXJhX21pc3Nl czsJLyogcmEgY2FjaGUgbWlzc2VzICovCiB9OwogCiAvKiB0aHJlYWQgdXNhZ2Ugd3JhcHMgdmVy eSBtaWxsaW9uIHNlY29uZHMgKGFwcHJveCBvbmUgZm9ydG5pZ2h0KSAqLwo= --0__=882569930080B3208f9e8a93df938690918c882569930080B320 Content-type: application/octet-stream; name="nfsdiff" Content-Disposition: attachment; filename="nfsdiff" Content-transfer-encoding: base64 ZGlmZiAtcnVOIG5mc2Qub3JpZy9NYWtlZmlsZSBuZnNkLm9wdC9NYWtlZmlsZQotLS0gbmZzZC5v cmlnL01ha2VmaWxlCVdlZCBEZWMgIDggMTU6MTc6NTUgMTk5OQorKysgbmZzZC5vcHQvTWFrZWZp bGUJRnJpIE5vdiAxMCAxNzoxMDo1NiAyMDAwCkBAIC05LDcgKzksNyBAQAogCiBPX1RBUkdFVCA6 PSBuZnNkLm8KIE9fT0JKUyAgIDo9IG5mc3N2Yy5vIG5mc2N0bC5vIG5mc3Byb2MubyBuZnNmaC5v IHZmcy5vIFwKLQkgICAgZXhwb3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h0OworCXJh LT5wX2hhc2hfcHJldiA9IChzdHJ1Y3QgcmFwYXJtcyAqKSByYXA7CisJcmFwLT5uZXh0LT5wX2hh c2hfcHJldiA9IHJhOworCXJhcC0+bmV4dCA9IHJhOworCisJbHJ1X2luc2VydF9mcm9udChyYSk7 CisJcmV0dXJuIHJhOworfQorCisvKgorICogVHJ5IHRvIGZpbmQgYW4gZW50cnkgbWF0Y2hpbmcg dGhlIGN1cnJlbnQgY2FsbCBpbiB0aGUgY2FjaGUuIFdoZW4gbm9uZQorICogaXMgZm91bmQsIHdl IGdyYWIgdGhlIG9sZGVzdCB1bmxvY2tlZCBlbnRyeSBvZmYgdGhlIExSVSBsaXN0LgorICogTm90 ZSB0aGF0IG5vIG9wZXJhdGlvbiB3aXRoaW4gdGhlIGxvb3AgbWF5IHNsZWVwLgorICovCitzdHJ1 Y3QgcmFwYXJtcyAqCituZnNkX2dldF9yYXBhcm1zKGRldl90IGRldiwgaW5vX3QgaW5vKQorewor CXN0cnVjdCByYXBhcm1zCSpyYWhlYWQ7CisJc3RydWN0IHJhcGFybXMJKnJhID0gTlVMTDsKKwor CXNwaW5fbG9jaygmcmFjYWNoZV9sb2NrKTsKKworCXJhID0gcmFoZWFkID0gKHN0cnVjdCByYXBh cm1zICopICZoYXNoX2xpc3RbUkVRSEFTSChpbm8sIGRldildOworCXdoaWxlICgocmEgPSByYS0+ cF9oYXNoX25leHQpICE9IHJhaGVhZCkgeworCSAgICAgCWlmICgocmEtPnBfaW5vID09IGlubykg JiYgKHJhLT5wX2RldiA9PSBkZXYpKSB7IAorCQkJbHJ1X3B1dF9mcm9udChyYSk7CisJCQluZnNk c3RhdHMucmFfaGl0cysrOworCQkJZ290byBmb3VuZDsKKwkJfQorCX0KKwkvKiBEaWQgbm90IGZp bmQgb25lLiBHZXQgYSBuZXcgaXRlbSBhbmQgaW5zZXJ0IGl0IGludG8gdGhlIGhhc2ggdGFibGUu ICovCisJcmEgPSBuZnNkX3JhY2FjaGVfaW5zZX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hcm1fY2FjaGUgPSByYXBhcm1sID0gTlVM TDsKLX0KLS8qCi0gKiBJbml0aWFsaXplIHJlYWRhaGVhZCBwYXJhbSBjYWNoZQotICovCi1pbnQK LW5mc2RfcmFjYWNoZV9pbml0KGludCBjYWNoZV9zaXplKQotewotCWludAlpOwotCi0JaWYgKHJh cGFybV9jYWNoZSkKLQkJcmV0dXJuIDA7Ci0JcmFwYXJtbCA9IGttYWxsb2Moc2l6ZW9mKHN0cnVj dCByYXBhcm1zKSAqIGNhY2hlX3NpemUsIEdGUF9LRVJORUwpOwotCi0JaWYgKHJhcGFybWwgIT0g TlVMTCkgewotCQlkcHJpbnRrKCJuZnNkOiBhbGxvY2F0aW5nICVkIHJlYWRhaGVhZCBidWZmZXJz LlxuIiwKLQkJCWNhY2hlX3NpemUpOwotCQltZW1zZXQocmFwYXJtbCwgMCwgc2l6ZW9mKHN0cnVj dCByYXBhcm1zKSAqIGNhY2hlX3NpemUpOwotCQlmb3IgKGkgPSAwOyBpIDwgY2FjaGVfc2l6ZSAt IDE7IGkrKykgewotCQkJcmFwYXJtbFtpXS5wX25leHQgPSByYXBhcm1sICsgaSArIDE7Ci0JCX0K LQkJcmFwYXJtX2NhY2hlID0gcmFwYXJtbDsKLQl9IGVsc2UgewotCQlwcmludGsoS0VSTl9XQVJO SU5HCi0JCSAgICAgICAibmZzZDogQ291bGQgbm90IGFsbG9jYXRlIG1lbW9yeSByZWFkLWFoZWFk IGNhY2hlLlxuIik7Ci0JCXJldHVybiAtRU5PTUVNOwotCX0KLQluZnNkc3RhdHMucmFfc2l6ZSA9 IGNhY2hlX3NpemU7Ci0JcmV0dXJuIDA7CiB9Cg== --0__=882569930080B3208f9e8a93df938690918c882569930080B320-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/