From owner-freebsd-current@FreeBSD.ORG Wed Jan 9 17:43:28 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E02DA16A41B for ; Wed, 9 Jan 2008 17:43:27 +0000 (UTC) (envelope-from frascone@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.191]) by mx1.freebsd.org (Postfix) with ESMTP id 246ED13C4DB for ; Wed, 9 Jan 2008 17:43:27 +0000 (UTC) (envelope-from frascone@gmail.com) Received: by rv-out-0910.google.com with SMTP id l15so347359rvb.43 for ; Wed, 09 Jan 2008 09:43:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; bh=QbZg/WEU7BqVTTZfmorKRTkQNhZOGNcMK054HJCHaWo=; b=cMdflf01mv8UzGDUUJ+43ZmnQHI+I1py7+VjuG3m5Q+f3NTS4V2cKTTGLm2p3kbyxqLDuxoMhsz/dBy8NWtQTvYS9H9WYJOcReCB+Ag82yANe9YxCrJQttYjkXWaE5BF0gOfUD6o2P9iFFg/DzVR9hWrlUa4pgsfhD/2gwRkwmw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; b=YtuJ04HyPnVCy7bvNI3SRjoiUWgmSZ3cfb41Vx/SKSceZ3IfukCd+J3rd0kHgZcQ83Tu5GZ3eyBjorPN7zJYWO6s2Prx20ULOVHJZyWoOJ/9o5EIfFQXdYPiDhRqqiefdHPHyhJI5u5l0npblvs3Hh7LRd/C//xRQabkEyRGQgc= Received: by 10.141.193.1 with SMTP id v1mr569560rvp.73.1199898925589; Wed, 09 Jan 2008 09:15:25 -0800 (PST) Received: by 10.141.50.5 with HTTP; Wed, 9 Jan 2008 09:15:25 -0800 (PST) Message-ID: <9cf5ced20801090915i3df2d4a1lc057a38b20fc5ac2@mail.gmail.com> Date: Wed, 9 Jan 2008 12:15:25 -0500 From: "David Frascone" Sender: frascone@gmail.com To: freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_33095_22656966.1199898925564" X-Google-Sender-Auth: e95508e58938d8b2 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Small patch to fix top in large NIS environments X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2008 17:43:28 -0000 ------=_Part_33095_22656966.1199898925564 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline The -u flag to top is supposed to limit uid lookups. But, it was still spinning through the entire password database with while (getpwent()). At Cisco, which has a fairly large NIS database, this takes forever, and top never starts. I filed this bug to address it: http://www.freebsd.org/cgi/query-pr.cgi?pr=119490 The attached patch fixes it. This is my first submission, so let me know if this is the proper order, etc, to post the patches (i.e. file the bug, the post a fix) -Dave ------=_Part_33095_22656966.1199898925564 Content-Type: text/plain; name=patch.txt Content-Transfer-Encoding: base64 X-Attachment-Id: f_fb84tib80 Content-Disposition: attachment; filename=patch.txt SW5kZXg6IHVzci5iaW4vdG9wL21hY2hpbmUuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvdXNyL0Zy ZWVCU0QvY3ZzdXAvc3JjL3Vzci5iaW4vdG9wL21hY2hpbmUuYyx2CnJldHJpZXZpbmcgcmV2aXNp b24gMS44MwpkaWZmIC1yMS44MyBtYWNoaW5lLmMKMjI2YzIyNgo8IG1hY2hpbmVfaW5pdChzdHJ1 Y3Qgc3RhdGljcyAqc3RhdGljcykKLS0tCj4gbWFjaGluZV9pbml0KHN0cnVjdCBzdGF0aWNzICpz dGF0aWNzLCBjaGFyIGRvX3VuYW1lcykKMjQwYzI0MCwyNDEKPCAJd2hpbGUgKChwdyA9IGdldHB3 ZW50KCkpICE9IE5VTEwpIHsKLS0tCj4gCWlmIChkb191bmFtZXMpIHsKPiAJICAgIHdoaWxlICgo cHcgPSBnZXRwd2VudCgpKSAhPSBOVUxMKSB7CjI0MmEyNDQKPiAJICAgIH0KSW5kZXg6IGNvbnRy aWIvdG9wL3RvcC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC91c3IvRnJlZUJTRC9jdnN1cC9zcmMv Y29udHJpYi90b3AvdG9wLmMsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMjMKZGlmZiAtcjEuMjMg dG9wLmMKNDUzYzQ1Mwo8ICAgICBpZiAobWFjaGluZV9pbml0KCZzdGF0aWNzKSA9PSAtMSkKLS0t Cj4gICAgIGlmIChtYWNoaW5lX2luaXQoJnN0YXRpY3MsIGRvX3VuYW1lcykgPT0gLTEpCg== ------=_Part_33095_22656966.1199898925564--