From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751595AbdGaH6p (ORCPT ); Mon, 31 Jul 2017 03:58:45 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:36700 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750923AbdGaH6o (ORCPT ); Mon, 31 Jul 2017 03:58:44 -0400 Date: Mon, 31 Jul 2017 09:58:40 +0200 (CEST) From: Thomas Gleixner To: Nicolas Pitre cc: Ingo Molnar , Peter Zijlstra , LKML Subject: Re: [PATCH] futex: split PI support to a file of its own In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 29 Jul 2017, Nicolas Pitre wrote: > Split out the priority inheritance support to a file of its own > to make futex.c much smaller, easier to understand and, hopefully, > to maintain. This also makes it easy to preserve basic futex support > and compile out the PI support when RT mutexes are not available. I can see your motivation to compile out PI support, which is why you worked on this in the first place. 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. > Signed-off-by: Nicolas Pitre Please provide a diffstat along with the patch next time. > diff --git a/include/linux/futex.h b/include/linux/futex.h > +#ifdef CONFIG_FUTEX_PI > +#include "futex_pi.c" > +#else > +#define get_pi_state(...) > +#define put_pi_state(...) > +#define refill_pi_state_cache() false > +#define lookup_pi_state(...) -ENOSYS > +#define rt_mutex_start_proxy_lock(...) -ENOSYS > +#define requeue_pi_wake_futex(...) > +#define futex_proxy_trylock_atomic(...) -ENOSYS > +#define futex_lock_pi(...) -ENOSYS > +#define futex_unlock_pi(...) -ENOSYS > +#define futex_wait_requeue_pi(...) -ENOSYS > +#endif Bah, no. We use static inlines as stubs whereever it's possible. Using macros is just a sloppy hackery. Thanks, tglx