From owner-freebsd-net@FreeBSD.ORG Thu Jan 14 18:11:20 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C1A8106568D for ; Thu, 14 Jan 2010 18:11:20 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id 0B6748FC27 for ; Thu, 14 Jan 2010 18:11:19 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 3so725373qwe.7 for ; Thu, 14 Jan 2010 10:11:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=DFpLeMLvBIW7kk8j9ILhC05v5KLMB6WihYuzj2S5hzA=; b=uMmGgNLs4YYym1dbvsRnJFDQBt1ScV7Y0MTP9sHV2srboU/zAYckv45cbF2tgBC9Jp H8dv/bJq2VuA7IHSAPj4y5BjQUAV1WGqrKE2Eh7bJEaQtPBVIjK7S2gYa3wC67+aHtyY FUmVSiMjCYFWslSCH3FRrRXNPiI5+PX6rSt2k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=JV7O8Ui1oLa5Fuj89XxHM8/5KKAysa1mEBk/KLNBPDehcrIcWR7HHp7PPW8HoPL6f1 Ik6cxlHXA9ZnP+lXAINW0wQndxcqkOhpB1MmIZL6JerlGc61QvXBkI6VHcPnurHBzN98 qHobbvItTbog6ZzBYzAvkm6pgK+HPKjwcQWD0= Received: by 10.224.32.149 with SMTP id c21mr1156520qad.33.1263492672238; Thu, 14 Jan 2010 10:11:12 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 8sm2408002qwj.3.2010.01.14.10.11.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 14 Jan 2010 10:11:11 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 14 Jan 2010 10:10:31 -0800 From: Pyun YongHyeon Date: Thu, 14 Jan 2010 10:10:31 -0800 To: Igor Sysoev Message-ID: <20100114181031.GX1228@michelle.cdnetworks.com> References: <20091204075440.GH14822@rambler-co.ru> <20091204173243.GC16491@michelle.cdnetworks.com> <20091204191114.GB76992@rambler-co.ru> <20091204195140.GH16491@michelle.cdnetworks.com> <20091204201303.GD76992@rambler-co.ru> <20091204202213.GI16491@michelle.cdnetworks.com> <20100114160333.GC16657@rambler-co.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="p8PhoBjPxaQXD0vg" Content-Disposition: inline In-Reply-To: <20100114160333.GC16657@rambler-co.ru> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org Subject: Re: hw.bge.forced_collapse X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 18:11:20 -0000 --p8PhoBjPxaQXD0vg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 14, 2010 at 07:03:33PM +0300, Igor Sysoev wrote: > On Fri, Dec 04, 2009 at 12:22:13PM -0800, Pyun YongHyeon wrote: > > > On Fri, Dec 04, 2009 at 11:13:03PM +0300, Igor Sysoev wrote: > > > On Fri, Dec 04, 2009 at 11:51:40AM -0800, Pyun YongHyeon wrote: > > > > > > > On Fri, Dec 04, 2009 at 10:11:14PM +0300, Igor Sysoev wrote: > > > > > On Fri, Dec 04, 2009 at 09:32:43AM -0800, Pyun YongHyeon wrote: > > > > > > > > > > > On Fri, Dec 04, 2009 at 10:54:40AM +0300, Igor Sysoev wrote: > > > > > > > I saw commit introducing hw.bge.forced_collapse loader tunable. > > > > > > > Just intresting, why it can not be a sysctl ? > > > > > > > > > > > > I didn't think the sysctl variable would be frequently changed > > > > > > in runtime except debugging driver so I took simple path. > > > > > > > > > > I do not think it's worth to reboot server just to look how various > > > > > values affect on bandwidth and CPU usage, expecially in production. > > > > > > > > > > As I understand the change is trivial: > > > > > > > > > > - CTLFLAG_RD > > > > > + CTLFLAG_RW > > > > > > > > > > since bge_forced_collapse is used atomically. > > > > > > > > > > > > > I have no problem changing it to RW but that case I may have to > > > > create actual sysctl node(e.g. dev.bge.0.forced_collapse) instead > > > > of hw.bge.forced_collapse which may affect all bge(4) controllers > > > > on system. Attached patch may be what you want. You can change the > > > > value at any time. > > > > > > Thank you for the patch. Can it be installed on 8-STABLE ? > > > > > > > bge(4) in HEAD has many fixes which were not MFCed to stable/8 so > > I'm not sure that patch could be applied cleanly. But I guess you > > can manually patch it. > > I'll wait a couple of days for wider testing/review and commit the > > patch. > > Sorry for the late response. We've tested bge.forced_collapse in December > on HEAD and found that values >1 froze connections with big data amount, > for example, "top -Ss1" output. Connection with small data amount such as > short ssh commands worked OK. Now I've tested modern 7.2-STABLE and found > that forced_collapse >1 freezes it too. > Thanks for reporting! It seems I've incorrectly dropped mbuf chains when collapsing fails. Would you try attached patch? --p8PhoBjPxaQXD0vg Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bge.collapse.patch5" Index: sys/dev/bge/if_bge.c =================================================================== --- sys/dev/bge/if_bge.c (revision 202268) +++ sys/dev/bge/if_bge.c (working copy) @@ -3940,11 +3940,8 @@ m = m_defrag(m, M_DONTWAIT); else m = m_collapse(m, M_DONTWAIT, sc->bge_forced_collapse); - if (m == NULL) { - m_freem(*m_head); - *m_head = NULL; - return (ENOBUFS); - } + if (m == NULL) + m = *m_head; *m_head = m; } --p8PhoBjPxaQXD0vg--