Date: Mon, 5 Nov 2012 09:49:24 -0800 From: Juli Mallett <juli@clockworksquid.com> To: Ian Lepore <freebsd@damnhippie.dyndns.org> Cc: "Rodney W. Grimes" <freebsd@pdx.rh.cn85.chatusa.com>, "freebsd-mips@FreeBSD.org" <freebsd-mips@freebsd.org> Subject: Re: CACHE_LINE_SIZE macro. Message-ID: <CACVs6=9ROHwqq6JWTskuCw4J-bU5xxN9xsUQ9m7ZX8o4RUGBAw@mail.gmail.com> In-Reply-To: <1352137087.1120.180.camel@revolution.hippie.lan> References: <CACVs6=_BrwJ19CPj7OqKvV8boHfujVWqn96u3VPUmZ040JpAeQ@mail.gmail.com> <201211041828.qA4ISomC076058@pdx.rh.CN85.ChatUSA.com> <CAF6rxgn-bNJOuvdiRj_UUGQUTRaeOt54OdzHOioNz5f566hoig@mail.gmail.com> <DAE462F0-9D85-4942-8826-C0709E36D3B7@bsdimp.com> <CAF6rxg=Et1d6u4RBCB88KibW_uiaRbNdb75v0TQOr-0BrEXV=g@mail.gmail.com> <B4225C25-BD43-423C-A1A2-C9FD4AC92ECB@bsdimp.com> <1352137087.1120.180.camel@revolution.hippie.lan>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 5, 2012 at 9:38 AM, Ian Lepore <freebsd@damnhippie.dyndns.org>wrote: > When I commented on Attilio's recent checkins concerning padding of > locks to cache line size and the fact that the value changes per-cpu and > we're not well-positioned to handle that right now, his main concern was > modules matching the kernel. I had suggested making the padding > conditional on SMP (because apparently there's no benefit to the padding > in a UP kernel), but then a module compiled for UP wouldn't work right > on an SMP kernel, and vice versa. I'm not sure why that's a problem, my > solution to that would be "So then don't do that." > > What scares me the most is the mushy definition of what CACHE_LINE_SIZE > really means. There's nothing about the name that says "This may not be > the actual cache line size but it's probably close," but increasingly I > see people talking about it as if it had such a malleable meaning. Is > that consistant with the existing uses in the code? Is it a good idea? Agreed. If the point of the macro is to ensure that something aligned and padded to that size will never, ever share a cache line, and if it affects module builds, it seems like the only really safe thing would be just to align to page size, and enough of all this more conservative, namely too-conservative, stuff. And it shouldn't be named such that anyone tries to make it even remotely related to anything that may vary within an architecture. I had thought there were user/kernel interfaces where it might start to matter, but if not then the module/kernel interfaces are the worst of it, but still bad enough. (Although there are other things complicating things on MIPS based on CPU type, it would be nice to find ways to reduce those things, rather than increasing them.)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACVs6=9ROHwqq6JWTskuCw4J-bU5xxN9xsUQ9m7ZX8o4RUGBAw>