linuxppc / issues

Issues repository for linuxppc
5 stars 0 forks source link

Use more __ro_after_init #453

Open npiggin opened 1 year ago

npiggin commented 1 year ago

__ro_after_init is a relatively new annotation, it should be used more often. Particularly things like ops tables are important to be RO protected at runtime if possible. ppc_md comes to mind, but there are lots of others, xive_ops, smp_ops, eeh_ops, etc. They might not all be read-only after init, in some cases code or data could be restructured slightly to make them so if they are close.

__read_mostly was sometimes used for readonly-after-init data, so that could give something to grep for, but it wasn't applied consistently so manual digging will be required.

This has the added benefit of ensuring read-only data doesn't accidentally get stored in frequently written cache lines.

It should really be an ongoing issue that we do as a matter of coding style, but I'll put this in for now because existing code could do with a few passes.

chleroy commented 8 months ago

That's in line with https://github.com/KSPP/linux/issues/15