Re: [PATCH v4 2/8] init.h: add __read_mostly to early_param_on_off()
From: Christoph Lameter
Date: Thu Apr 30 2015 - 14:46:32 EST
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/