From nobody Tue Sep 23 15:27:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cWP4M2kNPz68mVK for ; Tue, 23 Sep 2025 15:27:47 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cWP4M0qsVz3qgv for ; Tue, 23 Sep 2025 15:27:47 +0000 (UTC) (envelope-from jonlooney@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-6318855a83fso5855823a12.2 for ; Tue, 23 Sep 2025 08:27:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758641265; x=1759246065; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=E4ljfWZhdWJI+fXf/636eP3pxfoTOoyclT1EchK3qJ8=; b=ETt2LX567xsVC6cDQ4iPvJOnSjVY+IKaVyr7JMgo9jbq9cXoZTNmToFgmEdtSKJrnI GUbIDCGZ0YUJboMea3DcA8g2VOcAJlxGC1/BsebQtgy4uKhWp7ik/e6ikQ2GJCEcxh4y 87cCzZ4duwVs+p1x0S8pZ627zUhQdx2xnRMTxA1ve8qo4yT83qXUVbrp0o9Y6WWtHPIp TYjAMHIFS17fZVBAlaN8w8J4K8U9v38RmvUl9cFrSygX8uiTRKs9OfXc2U9ow60W6wAN Czrn/ZYGSP8y+/jRvbz0OJpYvSHztECFSKKcbryeBpiV17mHEtYJ75Zqd71ESP4Sp9Vy sLEw== X-Forwarded-Encrypted: i=1; AJvYcCXYtfwSNzZzXkQ8ZkN/ZBE5TYqDOSXqeTjQHeg/bAHD4Lr4IlaeSsrGV3m4bB1I0Cj2+T9Fx7zlaowe9TmCY+fmP5UP@freebsd.org X-Gm-Message-State: AOJu0YxKRyBMlBoM48zww+7tZatHYPh3vDRlLFvcJU63ycZWb6vfwbrJ WWoa/783U11RR3YvYzs+L2ZBs8YGIsV3zJL4OuImDLJ+83HdKYyCs3VENmsI9NeV X-Gm-Gg: ASbGncvSI0t+2A9IoHHEUzTdUuWXx/CWCtBMdniWNcrcHhr/qhB9tUYZJl6O8ksm7xt wxehkRqja83aRltUehFi5cDU5TEk+bhomtrs8YTNwAv2yMxDN2/I2lwMARXgPgqRYmjgWN4JgN6 hNi2eHxvsI2hb1a4SLfEbvR25QCxl1Ym1ZSfmK69bjSlaMFpwiabQy7vBF17K/uowHkgK5uiWXg IsLuOyOn0kjpKDuEJrNQ/Etl9sUCahFr2ncKy4CPkLMBm0BqPbQV6v9BUTdIl7V1yqd1evLgqzR 4ce1AUxJrIX8jxmw8cqeWf+ASTXHGG7h5ILfhk+fyZlxCQPTGtx4ScXC3nOBYAkOeHAzbW3hViY fnuX22QJvshcUeODiRlpRdfMpk161qtqKNkO8f7fRbJOTfzgP2AHf1Q== X-Google-Smtp-Source: AGHT+IEQSY5cQfdrDojtuemal3U+oTKszmLW8CFH02Pn3trMerM03RTFwMz+Y/JnrhGuFkJVg5SKLg== X-Received: by 2002:a17:907:7e93:b0:b28:e1b8:565d with SMTP id a640c23a62f3a-b302716c035mr296496766b.10.1758641264495; Tue, 23 Sep 2025 08:27:44 -0700 (PDT) Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com. [209.85.218.43]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b2a66073890sm671798666b.78.2025.09.23.08.27.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Sep 2025 08:27:44 -0700 (PDT) Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-b2e66a300cbso359543866b.3 for ; Tue, 23 Sep 2025 08:27:44 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWPdZMz1Lk2awmuL3qN8qCyDUi6nCrcvcxXvRO19Ic1bYx+vv5pZ1mDX1cHhrqwa5TUQXcW87P3YNRSgndMBu7OYXzP@freebsd.org X-Received: by 2002:a17:907:3cc7:b0:aff:17b1:dde1 with SMTP id a640c23a62f3a-b3027262102mr288840166b.1.1758641264184; Tue, 23 Sep 2025 08:27:44 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202509220759.58M7xkrM031432@gitrepo.freebsd.org> In-Reply-To: From: "Jonathan T. Looney" Date: Tue, 23 Sep 2025 11:27:32 -0400 X-Gmail-Original-Message-ID: X-Gm-Features: AS18NWDvW7cZeCXsRrkn8CuteOlOgc7Ln37gvmewzGa2AgsrtDDxT0aQ6vdaSu4 Message-ID: Subject: Re: git: 0ec13430c583 - main - sys/netinet6: Fix ABI breakage introduced with RFC 7217 support To: Guido Falsi Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000d6d571063f7993cb" X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4cWP4M0qsVz3qgv --000000000000d6d571063f7993cb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Sep 22, 2025 at 11:44=E2=80=AFAM Guido Falsi = wrote: > On 9/22/25 17:37, Jonathan T. Looney wrote: > > This seems like it is probably a low-frequency event. If so, why is a > > counter a better choice for this than an atomic? > > > > I used counters because they were already being used in the netinet6 > code, and are a good match for the use. > What makes them a good match for the use? Counters are generally best for write-often, read-rarely (by comparison) things, like statistics, where we want to avoid contention in a often-used critical path. For low-frequency events, the expense of keeping the counters (memory usage multiplied by the number of cores; more difficult debugging; etc.) may outweigh the benefits. Jonathan --000000000000d6d571063f7993cb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Sep 22, 2025 at 11:44=E2=80=AFAM = Guido Falsi <madpilot@freebsd.or= g> wrote:
On 9/22/25 17:37, Jonathan T.= Looney wrote:
> This seems like it is probably a low-frequency event= . If so, why is a
> counter a better choice for this than an atomic?
>

I used counters because they were already being used in the netinet6
code, and are a good match for the use.

What makes them a good match for the use? Counters are generally best for = write-often, read-rarely=C2=A0(by comparison) things, like statistics, wher= e we want to avoid contention in a often-used critical path. For low-freque= ncy events, the expense of keeping the counters (memory usage multiplied by= the number of cores; more difficult debugging; etc.) may outweigh the bene= fits.

Jonathan
--000000000000d6d571063f7993cb--