Date: Fri, 6 Jul 2018 22:06:57 -0700 (PDT) From: Don Lewis <truckman@FreeBSD.org> To: Warner Losh <imp@bsdimp.com> Cc: "Rodney W. Grimes" <rgrimes@freebsd.org>, Hans Petter Selasky <hselasky@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336025 - in head/sys: amd64/include i386/include Message-ID: <tkrat.bdb8022245bb8819@FreeBSD.org> In-Reply-To: <CANCZdfonr5f%2BMBcCBzezKUrbFCzcK_e0M%2BHYKAb=2j6Pj16Kpw@mail.gmail.com> References: <201807061013.w66ADgbJ087546@repo.freebsd.org> <201807061532.w66FWPEN052842@pdx.rh.CN85.dnsmgr.net> <CANCZdfpZpeCVSs1%2BMptwuN76SED-W4XyLCyQfrd4OpGwFk8Hrg@mail.gmail.com> <tkrat.0557727c4f01a481@FreeBSD.org> <CANCZdfonr5f%2BMBcCBzezKUrbFCzcK_e0M%2BHYKAb=2j6Pj16Kpw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 6 Jul, Warner Losh wrote: > On Fri, Jul 6, 2018 at 6:06 PM, Don Lewis <truckman@freebsd.org> wrote: > >> On 6 Jul, Warner Losh wrote: >> > On Fri, Jul 6, 2018 at 9:32 AM, Rodney W. Grimes < >> > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: >> > >> >> > Author: hselasky >> >> > Date: Fri Jul 6 10:13:42 2018 >> >> > New Revision: 336025 >> >> > URL: https://svnweb.freebsd.org/changeset/base/336025 >> >> > >> >> > Log: >> >> > Make sure kernel modules built by default are portable between UP >> and >> >> > SMP systems by extending defined(SMP) to include >> defined(KLD_MODULE). >> >> > >> >> > This is a regression issue after r335873 . >> >> > >> >> > Discussed with: mmacy@ >> >> > Sponsored by: Mellanox Technologies >> >> >> >> Though this fixes the issue, it also means that now when >> >> anyone intentionally builds a UP kernel with modules >> >> they are getting SMP support in the modules and I am >> >> not sure they would want that. I know I don't. >> >> >> > >> > >> > On UP systems, these additional opcodes are harmless. They take a few >> extra >> > cycles (since they lock an uncontested bus) and add a couple extra memory >> > barriers (which will be NOPs). On MP systems, atomics now work by >> default. >> > Had we not defaulted like this, all modules built outside of a kernel >> build >> > env would have broken atomics. Given that (a) the overwhelming majority >> > (99% or more) is SMP and (b) the MP code merely adds a few cycles to >> what's >> > already a not-too-expensive operation, this was the right choice. >> > >> > It simply doesn't matter for systems that are relevant to the project >> > today. While one could try to optimize this a little (for example, by >> > having SMP defined to be 0 or 1, say, and changing all the ifdef SMP to >> if >> > (defined(SMP) && SMP != 0)), it's likely not going to matter enough for >> > anybody to make the effort. UP on x86 is simply not relevant enough to >> > optimize for it. Even in VMs, people run SMP kernels typically even when >> > they just allocate one CPU to the VM. >> > >> > So while we still support the UP config, and we'll let people build >> > optimized kernels for x86, we've flipped the switch from pessimized for >> SMP >> > modules to pessimized for UP modules, which seems like quite the >> reasonable >> > trade-off. >> > >> > Were it practical to do so, I'd suggest de-orbiting UP on x86. However, >> > it's a lot of work for not much benefit and we'd need to invent much >> crazy >> > to get there. >> >> I would distinguish i386 from amd64 here. SMP is pretty rare and exotic >> in the i386 world > > > I don't know I'd say that. There's been MP systems widely available since > Pentium Pro days. They aren't in laptops, but they were fairly common in > i386 land since the mid 90's, especially in server class machines. Not > cheap, but not too pricy as to be uncommon.... Back in the mid-90's to early 00's I was running a fairly large collection of i386-class FreeBSD servers, starting with Pentium CPUs which were mostly replaced by Pentium III's by the end. They used desktop motherboards and were all UP. They were stacked on shelves in our raised-floor computer room next to the VAX, so I consider them servers. We stopped at FreeBSD 4.x, so SMP would not have been that great anyway. The Pentium III motherboard that I purchased required the use of special Pentium III CPU chips. They were hard to find on Ebay as I recall. What is kind of funny is that the workloads I was running back in those days were mostly I/O bound. Now that CPUs have gotten so much faster and CPUs have grown so many cores, my workloads are now mostly CPU limited.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?tkrat.bdb8022245bb8819>