Date: Tue, 23 Sep 2025 11:27:32 -0400 From: "Jonathan T. Looney" <jtl@freebsd.org> To: Guido Falsi <madpilot@freebsd.org> Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 0ec13430c583 - main - sys/netinet6: Fix ABI breakage introduced with RFC 7217 support Message-ID: <CADrOrmu_c0wwTvxWzi2ivUmJY8qNZeMjMPEDeG3yJdYzVN3N2A@mail.gmail.com> In-Reply-To: <d6f5fe28-67a2-49c2-8ab2-fdbf9e55a4d9@FreeBSD.org> References: <202509220759.58M7xkrM031432@gitrepo.freebsd.org> <CADrOrmv22FzL9oP-B3NF=McMawJkQ5%2BL0zuvYSd0xRK%2BdnNYXQ@mail.gmail.com> <d6f5fe28-67a2-49c2-8ab2-fdbf9e55a4d9@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <madpilot@freebsd.org>= 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 <div dir=3D"ltr"><div dir=3D"ltr">On Mon, Sep 22, 2025 at 11:44=E2=80=AFAM = Guido Falsi <<a href=3D"mailto:madpilot@freebsd.org">madpilot@freebsd.or= g</a>> wrote:</div><div class=3D"gmail_quote gmail_quote_container"><blo= ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left= :1px solid rgb(204,204,204);padding-left:1ex">On 9/22/25 17:37, Jonathan T.= Looney wrote:<br>> This seems like it is probably a low-frequency event= . If so, why is a <br> > counter a better choice for this than an atomic?<br> > <br> <br> I used counters because they were already being used in the netinet6 <br> code, and are a good match for the use.<br></blockquote><div><br></div><div= >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.</div><div><br></div><div>Jonathan</div></div></div> --000000000000d6d571063f7993cb--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADrOrmu_c0wwTvxWzi2ivUmJY8qNZeMjMPEDeG3yJdYzVN3N2A>