From owner-freebsd-current@FreeBSD.ORG Wed Jan 9 22:24:25 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 4D8B516A418 for ; Wed, 9 Jan 2008 22:24:25 +0000 (UTC) (envelope-from frascone@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.185]) by mx1.freebsd.org (Postfix) with ESMTP id 2152A13C44B for ; Wed, 9 Jan 2008 22:24:25 +0000 (UTC) (envelope-from frascone@gmail.com) Received: by rv-out-0910.google.com with SMTP id l15so422338rvb.43 for ; Wed, 09 Jan 2008 14:24:24 -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:in-reply-to:mime-version:content-type:references:x-google-sender-auth; bh=dEZ4mAbn+kRhe30TSCSeTL6kQvLS2SyVq/q/zDkWUww=; b=iqn959nBHEB/aOSuV/tZBMBmGhE40A0Bn/A8lTF/xKc0MpZRc++I8fqTNv/La10i6x8fAfciMImEcVzS9Xor02ww10fniuoeTaZ8Ydl+bY+XwJK2B10UkDmeYuEzxqz0oLgPgsAPS13sErocvVyAX35BfCro9MdaFRw3l+BlVWQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=Sin2d94BDln4JuOxoXVKw5srGWDqRGzYI07dRT/KKsTO6TpVSKQFzUKsHXKJfw+PPtJmImpZDzbmKD7kiHE8SDmpmoUogySTPVtZC/HUDbDF8rlnDqIAi+FT/VWFbbndbj+0m0VXxBW463be7AlPoB1aaNbA9qqhy4tyAgbI7A0= Received: by 10.141.79.12 with SMTP id g12mr772184rvl.87.1199917464826; Wed, 09 Jan 2008 14:24:24 -0800 (PST) Received: by 10.141.50.5 with HTTP; Wed, 9 Jan 2008 14:24:24 -0800 (PST) Message-ID: <9cf5ced20801091424k60d136a7xc4a62d0e105fafff@mail.gmail.com> Date: Wed, 9 Jan 2008 17:24:24 -0500 From: "David Frascone" Sender: frascone@gmail.com To: freebsd-current@freebsd.org In-Reply-To: <9cf5ced20801090915i3df2d4a1lc057a38b20fc5ac2@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_33913_22734575.1199917464826" References: <9cf5ced20801090915i3df2d4a1lc057a38b20fc5ac2@mail.gmail.com> X-Google-Sender-Auth: 88661bcea8bf975a X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: 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 22:24:25 -0000 ------=_Part_33913_22734575.1199917464826 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Oops -- should have checked -- I am not used to working as root, so root didn't have my normal .cvsrc. Unified diff attached. -Dave On Jan 9, 2008 12:15 PM, David Frascone wrote: > > 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_33913_22734575.1199917464826 Content-Type: text/plain; name=patch.txt Content-Transfer-Encoding: base64 X-Attachment-Id: f_fb8fvfoh1 Content-Disposition: attachment; filename=patch.txt SW5kZXg6IHVzci5iaW4vdG9wL21hY2hpbmUuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBm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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC91c3IvRnJl ZUJTRC9jdnN1cC9zcmMvY29udHJpYi90b3AvdG9wLmMsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEu MjMKZGlmZiAtdSAtcjEuMjMgdG9wLmMKLS0tIGNvbnRyaWIvdG9wL3RvcC5jCTQgTWF5IDIwMDcg MTU6NDI6NTggLTAwMDAJMS4yMworKysgY29udHJpYi90b3AvdG9wLmMJOSBKYW4gMjAwOCAxNzow ODo1NiAtMDAwMApAQCAtNDUwLDcgKzQ1MCw3IEBACiAgICAgfQogCiAgICAgLyogaW5pdGlhbGl6 ZSB0aGUga2VybmVsIG1lbW9yeSBpbnRlcmZhY2UgKi8KLSAgICBpZiAobWFjaGluZV9pbml0KCZz dGF0aWNzKSA9PSAtMSkKKyAgICBpZiAobWFjaGluZV9pbml0KCZzdGF0aWNzLCBkb191bmFtZXMp ID09IC0xKQogICAgIHsKIAlleGl0KDEpOwogICAgIH0K ------=_Part_33913_22734575.1199917464826--