[PATCH v2 2/5] powerpc: module_[32|64].c: replace swap function with built-in one

Michael Ellerman mpe at ellerman.id.au
Mon Apr 1 04:08:30 PDT 2019

Andrey Abramov <st5pub at yandex.ru> writes:
> Replace relaswap with built-in one, because relaswap
> does a simple byte to byte swap.

I replied to v1 with an ack, which stands, this is just a clarification.

> Since Spectre mitigations have made indirect function calls more
> expensive, and the default simple byte copies swap is implemented
> without them, an "optimized" custom swap function is now
> a waste of time as well as code.

Spectre mitigations don't necessarily slow down indirect function calls
on all arches or in all configurations on all arches, so that
justification is a bit dubious.

That's not really a problem for this patch, because the existing
overhead of the function call is probably already enough to rival the
cost of the 24 byte copy.


More information about the linux-mtd mailing list