Messages in this thread | | | Date | Thu, 30 Apr 2015 13:46:22 -0500 (CDT) | From | Christoph Lameter <> | Subject | Re: [PATCH v4 2/8] init.h: add __read_mostly to early_param_on_off() |
| |
On Thu, 30 Apr 2015, Luis R. Rodriguez wrote:
> > But for every param declared this way? I'm not sure we want that... > > I'm glad you bring this up, Christoph can you or anyone else can you provide > advise since you added __read_mostly ?
Well it should be reseved for data that is actually used frequently in hot paths. Initially we only moved variables into __read_mostly after we saw in performance traces that there was contention on an item because a neighboring variable was frequently written to.
You want the __read_mostly data to be tighly packed. In the best case multiple frequently read variables for a hot path will be next to each other in order to reduce the number of cachelines needed to execute a critical path. That means being selective and aware of which variables actually benefit.
| |