Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Apr 2012 21:06:01 +0700 (NOVT)
From:      Eugene Grosbein <eugen@grosbein.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/167204: terrible "netstat -rn" performance due to slow kvm_nlist()
Message-ID:  <201204221406.q3ME61Gw003676@grosbein.pp.ru>
Resent-Message-ID: <201204221410.q3MEABq0035977@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         167204
>Category:       kern
>Synopsis:       terrible "netstat -rn" performance due to slow kvm_nlist()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 22 14:10:10 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Eugene Grosbein
>Release:        FreeBSD 8.3-PRERELEASE i386
>Organization:
RDTC JSC
>Environment:
System: FreeBSD grosbein.pp.ru 8.3-PRERELEASE

>Description:

	My home router runs FreeBSD/i386 on AMD Geode:

%uname -a
FreeBSD gw.grosbein.pp.ru 8.3-PRERELEASE FreeBSD 8.3-PRERELEASE #1: Tue Mar  6 23:11:20 NOVT 2012     root@grosbein.pp.ru:/usr/local/obj/nanobsd.gw/i386/usr/local/src/sys/GW  i386
%grep CPU /var/run/dmesg.boot
CPU: Geode(TM) Integrated Processor by AMD PCS (499.91-MHz 586-class CPU)

	It has no IPv6 in the kernel config and pretty small routing table:

%sh -c 'time netstat -rn | wc -l'
        1.47 real         0.00 user         1.06 sys
      30

	As you can see, it takes more than a second
	for 'netstat -rn' to complete.

	Most of time it spends calling kldsym() system call
	from kvm_nlist() function:

%kdump | fgrep -c 'CALL  kldsym(0,KLDSYM_LOOKUP'
347

	For some unknown reason, the performace of this syscall is way too bad.

>How-To-Repeat:

	Run "time netstat -rn"

>Fix:

	Unknown
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204221406.q3ME61Gw003676>