From owner-freebsd-current@FreeBSD.ORG Tue Sep 30 15:46:46 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41FE4272 for ; Tue, 30 Sep 2014 15:46:46 +0000 (UTC) Received: from nm22-vm1.bullet.mail.bf1.yahoo.com (nm22-vm1.bullet.mail.bf1.yahoo.com [98.139.212.127]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3D60E59 for ; Tue, 30 Sep 2014 15:46:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1412091839; bh=nQC9Prln2zTU62/ese7jcT/kShS9xTgaTR/I+mxVGl8=; h=Received:Received:Received:DKIM-Signature:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:From:Subject; b=rFqR5U+5pWKHr3sJy4+g8R7mQzuHuMs4V66WP83fOQtYxJg1Bt7Vaxet70HDFVQoZEfU82HOogRmzzdkiYMohKog00loSC3dWeQ7nVuYnzd3JkE6Y61tDPIIy9kCzzbQrA9CH1nIjSm76tXxfbauoHs6qO+62k2VNDbmAcvoBoacmHtQ9T8jp4bwams8+vD+BxGy1lDzeeanb7BVfHPY5ZjMu1Th6u4UGifdK0THCGEZOWj3nLbEpx2x9IS75lmi0ORUx4KWtODIgT6sp0stTTki7xTw/i8zQ3gGN7U2IdcTf6uGatg+774BWtdtC8SIPM4H2gpeGzLuKq1ahBmORg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=SmbepU/dP6atH3fyA9J24Bfu9e9gh6Fw/BO6Czvnn61EusaikjnlsFkv3i/2p8d0FFy9nfOg+EHOKxqiFymo/PPjZ2GDQtUieOZ5dpmRi1dfB2xq0cTOAWhm9GYqsUuhZdw4yZRrBombD+fS3cP106+a62mpCKMNJXUUEHCLYwld2+Wg80joTn5/DVsNCuE9icciQTTDH/L/7m9QuoGq3OznKYci+fCepPzoJ+PBBOR7uLb10PEDVrlfaVGTByUMRn7PwespT+5NzvOaTFLMlDTA62OLmyAweZdeRaSlpazOlFs+aoEk1ewCI+LZ48EG9x0kh53v2x0sC79tqGAplA==; Received: from [66.196.81.171] by nm22.bullet.mail.bf1.yahoo.com with NNFMP; 30 Sep 2014 15:43:59 -0000 Received: from [68.142.230.74] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 30 Sep 2014 15:43:59 -0000 Received: from [127.0.0.1] by smtp231.mail.bf1.yahoo.com with NNFMP; 30 Sep 2014 15:43:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1412091839; bh=nQC9Prln2zTU62/ese7jcT/kShS9xTgaTR/I+mxVGl8=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=lzGNGgIH2bm3b8T5VYiFoUe1uuhKyw4nQIISceQXZf96EMnuI/m+R+LsZJAybr3Xmnq5binyrflOwnji+EDQX7G0ZnDGj6o1Qt71qI2Y0V5JABYaRqPbfXwVnNukT/cez6vs62OOE58uAJ4QNX1RbR/Def39KxQ+2AyQtqO3fKM= X-Yahoo-Newman-Id: 651540.3725.bm@smtp231.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: NfJYp9cVM1nvGxzsNZsl9UCMkG6O0kLUzd_KJBHRZl3RGTJ B.0BEEqaeRAcY1R0sVoo8f4530bUgMQ_ItfXIQe4pv0DciRGDzVkJ5VO1qKR HQDFGW3WcV1wB3MBQxHQzqQIR8pX9GHeIpDSR4XgVSVvrdfqXVir8M1H3MIZ 6Cx8_wBsP3yEY3T6VvpAMYHKGi36Cf3Na77_5lGvVebjE23xQxFA3UhItBZl .onOiAcvJlKexG_qz.NNjFy0XEcr_eM3AEpS7.9b8ROmMM.Clfplg4I77OGX UkRlhVDECpRuJUgtNBqWaLt6ABb1LNF5ef0SZv0SWFiThshqcrrHcbfXIj0v OSoDJ._lI7VT2w4SfzvKjjfU4mUinGWpvyFk4wBetRtcvKYxhq4mDkaV81Es bSShDtB9RWk.4EOauOxcU4Plc4wt34NnwpZRz2dAG1GazLxhQE7bIjXPzAAR raWK8TlSzT8ktTYzA2W1UQVDuHP3sTnJztH3X.S28AyBlR._9pSeYjkiRtx_ N2W_0nU9Y4IA0ZjLP8SEf X-Yahoo-SMTP: 4VhmBaWswBBKhhYsa0wE5OAFfRI- Message-ID: <542ACFBD.3000407@yahoo.com> Date: Tue, 30 Sep 2014 11:43:57 -0400 From: David Shane Holden User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: "Eggert, Lars" Subject: Re: [PATCH] nscd References: <007A0492-5F92-44E8-8904-699F4A42C667@netapp.com> In-Reply-To: <007A0492-5F92-44E8-8904-699F4A42C667@netapp.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-current@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 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: Tue, 30 Sep 2014 15:46:46 -0000 On 09/30/14 04:17, Eggert, Lars wrote: > When I start "nscd -n -s -t" and then run top in another shell, top > takes ~10 seconds to start up every time; if nscd did its thing, > repeat invocations should be much faster. nscd doesn't seem to see > any activity either, based on its log: The -t switch will only work after you change the #ifdef in debug.h to define the trace routines, and even then it doesn't give you too much information other than what methods are called. nscd could really use some debug logging but that's a whole other issue. As for why it's not working in your setup I can't say. Have you tried testing with getent to see which database is taking so long, and is that 10 seconds before or after the patch? By default nscd is suppose to timeout after 8 seconds so there might be something else going on in nscd which you're being affected by which is now being exposed. What I do know is when the timeout value is unusually large (in this case due to the bad memcpy) the kevent timer registered at the end of nscd.c:process_socket_event() doesn't seem to be honored. My guess is inside the kernel it's setting it to 0 if it exceeds some threshold so it immediately gets triggered. It's basically shooting itself in the head right when a connection to the socket is made. You can test this by running 'socat UNIX-CONNECT:/var/run/nscd -'. You'll notice that it instantly disconnects without the patch, then 8 seconds with it.