From owner-svn-src-user@FreeBSD.ORG Wed Mar 4 23:46:23 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C123106564A for ; Wed, 4 Mar 2009 23:46:23 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.239]) by mx1.freebsd.org (Postfix) with ESMTP id 5DAE88FC17 for ; Wed, 4 Mar 2009 23:46:23 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by rv-out-0506.google.com with SMTP id f6so4062798rvb.43 for ; Wed, 04 Mar 2009 15:46:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=ZS8+bqyZ7CS19NqRVGu46mdsbo3/XoVi8K3Rhs7cpsM=; b=oUQ0cOfNcw9Op110GwdmmOcsb3OTKQ6xfo6KdZpXMUf0XIN54P/MNNtFcujOttFls2 m9IMJj4FXfcEcGgRMyI7q7uqGvpRw0oqw30oFDpFNt7FwKTAqK50kTSpPiFMfV3dd0kz BQ9rSo2yN2Q4qdOXX9ltoNgistl3cFkJwtqTY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=iTHnu2GLDw0CUAAL5+xMtnaVvAGsHLm7yyI8m12pkItiJrQRhF/GQb1MOqmAbQjyUI bTCcNlOheGv8jkbiSfE1Ox0xtmaSXQhXr+3GZX5nkivZ1c2s/pxpszyQEvTkr463podH uJyeRh97OljqY+YH2fVhDFowGS6QHTOlDQUtQ= MIME-Version: 1.0 Sender: mat.macy@gmail.com Received: by 10.141.52.3 with SMTP id e3mr225494rvk.73.1236208855113; Wed, 04 Mar 2009 15:20:55 -0800 (PST) In-Reply-To: <200903041759.31535.jhb@freebsd.org> References: <200903042122.n24LMdO3053650@svn.freebsd.org> <200903041759.31535.jhb@freebsd.org> Date: Wed, 4 Mar 2009 15:20:55 -0800 X-Google-Sender-Auth: 4bf395658eedf924 Message-ID: <3c1674c90903041520o145b0c42uc1dd2d41870432e6@mail.gmail.com> From: Kip Macy To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r189374 - user/kmacy/HEAD_fast_net_merge/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2009 23:46:23 -0000 Do we have any mechanism for handling sparse cpuids? If so I can do modulo the number of active cpus and then taking that value as an index. If not its a bit of an academic observation. -Kip On Wed, Mar 4, 2009 at 2:59 PM, John Baldwin wrote: > On Wednesday 04 March 2009 4:22:39 pm Kip Macy wrote: >> Author: kmacy >> Date: Wed Mar =A04 21:22:39 2009 >> New Revision: 189374 >> URL: http://svn.freebsd.org/changeset/base/189374 >> >> Log: >> =A0 Use per-cpu callouts for tcp_timer >> =A0 186694, 187660 >> >> =A0 186694: >> =A0 - convert tcp_timer_activate over to using >> =A0 =A0 per-cpu callouts >> =A0 - don't acquire the tcbinfo lock exclusively >> =A0 =A0 in tcp_timer_rexmt unless needed for tcp_drop >> >> =A0 187660: >> =A0 - mp_maxid may not be valid ensure that we >> =A0 =A0 re-schedule on cpuid less than or equal to >> =A0 =A0 the current one for tcp callouts >> >> Modified: >> =A0 user/kmacy/HEAD_fast_net_merge/sys/netinet/tcp_timer.c >> >> Modified: user/kmacy/HEAD_fast_net_merge/sys/netinet/tcp_timer.c >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- user/kmacy/HEAD_fast_net_merge/sys/netinet/tcp_timer.c =A0 =A0Wed Ma= r =A04 > 21:04:52 2009 =A0 (r189373) >> +++ user/kmacy/HEAD_fast_net_merge/sys/netinet/tcp_timer.c =A0 =A0Wed Ma= r =A04 > 21:22:39 2009 =A0 (r189374) >> @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); >> =A0#include >> =A0#include >> =A0#include >> +#include >> =A0#include >> =A0#include >> =A0#include >> @@ -118,6 +119,8 @@ int =A0 =A0 =A0 tcp_maxpersistidle; >> =A0 =A0 =A0 /* max idle time in persist */ >> =A0int =A0tcp_maxidle; >> >> +#define =A0 =A0 =A0INP_CPU(inp) =A0 =A0min(curcpu, ((inp)->inp_flowid %= mp_maxid)) > > This is not really safe. =A0CPU ID's may be sparse. =A0The only guarantee= s you > have are that 0 is the boot CPU, and that all valid CPU IDs are in the ra= nge > [0 .. mp_maxid] (inclusive). =A0Thus, you could have a system that only h= as > CPUs 0 and 3 and if you are on CPU 3 and flowid is 5, then this will choo= se > min(3, 5 % 3) =3D=3D min(3, 2) =3D=3D 2 which is an invalid CPU. > > -- > John Baldwin >