mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] futex: split PI support to a file of its own
Date: Mon, 31 Jul 2017 09:58:40 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1707310948230.2314@nanos> (raw)
In-Reply-To: <alpine.LFD.2.20.1707290034210.5981@knanqh.ubzr>

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 <nico@linaro.org>

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

  reply	other threads:[~2017-07-31  7:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-29  4:45 Nicolas Pitre
2017-07-31  7:58 ` Thomas Gleixner [this message]
2017-08-01  4:23   ` Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1707310948230.2314@nanos \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=nicolas.pitre@linaro.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®