Re: [PATCH] futex: split PI support to a file of its own

From: Nicolas Pitre
Date: Tue Aug 01 2017 - 00:24:13 EST


On Mon, 31 Jul 2017, Thomas Gleixner wrote:

> But I really do not agree with your reasoning about easier to understand
> and maintain. I have the dubious pleasure to stare into that code on a
> regular base. PI and non PI share a lot of code and it's really not helping
> to have two separate files to stare at. That makes following the PI code
> even harder than it is already. So I rather like to see that PI code in an
> #ifdef block and not split out into its own file.

OK. And in fact I think I now managed to keep #ifdef's to a very small
number, counting on dead code elimination instead. Please see next
patch.

> Please provide a diffstat along with the patch next time.

Hmmm... was supposed to be there. For the record it was:

include/linux/futex.h | 7 +-
init/Kconfig | 7 +-
kernel/futex.c | 1559 +-----------------------------------------
kernel/futex_pi.c | 1563 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 1598 insertions(+), 1538 deletions(-)

Admitedly not small. But when PI is disabled then futex.o shrinks by
roughly the half of its original size. So a lot of code is dedicated to
PI.


Nicolas