From owner-svn-src-all@freebsd.org Fri Jan 24 03:09:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27D8822C043 for ; Fri, 24 Jan 2020 03:09:20 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483kdC03Lpz4Q4s for ; Fri, 24 Jan 2020 03:09:18 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pf1-x441.google.com with SMTP id 4so385851pfz.9 for ; Thu, 23 Jan 2020 19:09:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=TaRU2ZjEuifaE+mZUGRDqy9j5q9IOODlHOhlPSKa6Cs=; b=Wo50L/meM+EOWd5zWVzCUgeaJT3uFon4R9QhMojpdzZ+kLjmDd5al2BN/awop20/mZ nE+6TG65usXmc2swekx8emz2/oqQ/NHx88j/a7kORXJ5f8FiBhz2aIhhToWPWAxl+09s lbIzYkvvTtqVf1dKKCk3bnVZxrYJSBQuWPHqpOZyg8mkUkloZa6hJXwXE64Z57ohOOlJ 7cRHmuyXinSLLtjR8hoFqLINlHTWlrG38UFzfvl7swy4dFTeUrb1RtioY8xDzzadXJ1g ZTq9IWq0QTuKgqNJaQP5ObZaoMOZzokipy91d43MM0qqZ06hUeQXacDeMVp6Sl921BRi qRmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=TaRU2ZjEuifaE+mZUGRDqy9j5q9IOODlHOhlPSKa6Cs=; b=CyR6346Dbm5S2sMXkzo+pBywYTkuDSLfYYtIWru18bb/QtcEq4REZRcyPapIOJ/EqZ U9YaJjscTEGAZwyRMNv6wlYgCAl1RfanZad/Q07LOjAb57aNjs8590i1CvB20ztAykfj dTvVj3AA7aKZSK5kCmVCBxiNnJaV26NFQ0G3bZ4My4xkbLF/ggyEO0J6TJg6VF1G5IFK tKrY8mDsoiUBUQEbaW6sP7HPwzZXXVV6XDMNyTIFkucXkZl0mjzu8vjbsxDJ55YwM4yt sBnCYtSpPkIcoiZ0CsdzIMtUMZKyV6SsIKySHrYXPDQKUAeaR31xRAp5tiV4ZTw/chc0 Io9g== X-Gm-Message-State: APjAAAX4UxcyUQGmeWxsPDQCD+L8yD3+8rFFUWc3hW+gaHlwn/cQr6gn QOi13QBhYtzb7ynESaCzDF95xg== X-Google-Smtp-Source: APXvYqwdtXwZL4ncxOBEmLEbTjVEzp5k6NhN+befoSQfFo/h5cDjj/Ont41iulJM9o+AWs1j6yDfaA== X-Received: by 2002:a62:14c4:: with SMTP id 187mr1324905pfu.96.1579835357162; Thu, 23 Jan 2020 19:09:17 -0800 (PST) Received: from rrcs-76-81-105-82.west.biz.rr.com (rrcs-76-81-105-82.west.biz.rr.com. [76.81.105.82]) by smtp.gmail.com with ESMTPSA id q11sm3926336pff.111.2020.01.23.19.09.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 19:09:16 -0800 (PST) Date: Thu, 23 Jan 2020 17:09:14 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Gleb Smirnoff cc: Ryan Stone , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r357051 - head/sys/dev/bge In-Reply-To: <20200124024356.GK1268@FreeBSD.org> Message-ID: References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> <20200124012458.GI1268@FreeBSD.org> <20200124024356.GK1268@FreeBSD.org> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 483kdC03Lpz4Q4s X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=Wo50L/me; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::441) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-2.71 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[jroberson-net.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; IP_SCORE(-0.91)[ip: (-0.63), ipnet: 2607:f8b0::/32(-2.07), asn: 15169(-1.81), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[jroberson-net.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_CC(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jan 2020 03:09:20 -0000 On Thu, 23 Jan 2020, Gleb Smirnoff wrote: > On Thu, Jan 23, 2020 at 08:33:58PM -0500, Ryan Stone wrote: > R> > Because at interrupt level we can batch multiple packets in a single epoch. > R> > This speeds up unfiltered packet forwarding performance by 5%. > R> > > R> > With driver level pfil hooks I would claim even more improvement, because before > R> > the change we needed to enter epoch twice - once for filtering, than for ether_input. > R> > > R> > Epoch isn't a layer, it is a synchronisation primitive, so I disagree about > R> > statement on layering violation. > R> > R> Epoch is a synchronization primitive, but the net_epoch is absolutely > R> a part of the networking layer. If we need better batching then the > R> correct solution is to introduce a batched interface for drivers to > R> push packets up the stack, not to mess around at the interrupt layer. > > Such interface of course would be valuable but will not cover case > when an interrupt arrives during processing of previous one. So its > batching possiblities are limited compared to interrupt level batching. > > And I already noted that ether_input() isn't the only way to enter > the network stack. > > R> Note that the only reason why this works for mlx4/mlx5 is that > R> linuxkpi *always* requests a INTR_TYPE_NET no matter what driver is > R> running. This means that all drm graphics driver interrupts are now > R> running under the net_epoch: > R> > R> https://svnweb.freebsd.org/base/head/sys/compat/linuxkpi/common/include/linux/interrupt.h?revision=352205&view=markup#l103 The historical reason is that linuxkpi was originally made to support ofed and there was no real way to get this information from the driver. > > Well, it is not my fault that a video driver requests INTR_TYPE_NET > interrupt. I mean, you can't put this as a rationale against using > network epoch for all interrrupts that declare theirselves as network > interrupts. However, this is harmless. While we don't have a policy strictly requiring reviews it is the norm to have substantial changes socialized and reviewed. I appreciate the work that you are doing but it likely should've been discussed somewhere more publicly. I apologized if I missed it but I don't see reference to anything. Architecturally I am more concerned with the coarseness of net_epoch and the duration of hold becoming a resource utilization problem in high turn-over workloads. Like short connection tcp. Has anyone done substantial testing here? epoch as it is today will hold every free callback for a minimum of several clock ticks and a maximum of 2x the duration of the longest epoch section time. With preemption, etc. this could be 100s of ms of PCBs held. Thanks, Jeff > > -- > Gleb Smirnoff >