All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Xenomai-core@domain.hid
Subject: Re: [Xenomai-core] [PATCH 1/4] Refactor generic system.h
Date: Sat, 01 Mar 2008 20:22:33 +0100	[thread overview]
Message-ID: <47C9ACF9.4020106@domain.hid> (raw)
In-Reply-To: <18377.42613.595681.980063@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 2742 bytes --]

Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>  > Gilles Chanteperdrix wrote:
>  > > Jan Kiszka wrote:
>  > >  > In order to allow further optimizations of xnlock, I started with
>  > >  > refactoring the related system.h. This improves the readability
>  > >  > significantly, IMHO. It also happen to reduce the text size of
>  > >  > __xnlock_get a bit by avoid redundant rthal_processor_id read-outs.
>  > >  > 
>  > >  > Another quirk I happen to remove: xnlock debugging depends on
>  > >  > XENO_OPT_DEBUG_NUCLEUS, but needlessly we used to pick the debug version
>  > >  > of xnlock_t already with XENO_OPT_DEBUG.
>  > > 
>  > > There is a lot of whitespace change in this patch, which make it hard to
>  > > read.
>  > 
>  > Well, this patch is mostly about whitespace and formatting fixes (among
>  > which ifdef reduction falls for me as well). But I can split it up if
>  > desired.
>  > 
>  > > 
>  > > Anyway, there are a few things I do not like in this patch:
>  > > - macro which make reference to symbols defined elsewhere
>  > 
>  > You mean XNLOCK_DBG_PREPARE_ACQUIRE vs. XNLOCK_DBG_SPINNING/ACQUIRED?
>  > Granted, not nice but so far the most compact approach I found. My goal
>  > was to keep the lock implementations as pure as possible (you can easily
>  > ignore the debug stuff now when reading xnlock_get/put).
>  > 
>  > > - functions arguments as macro, I find more readable the #ifdef with the
>  > >   different function prototypes, the code can be read without having to
>  > >   look at a different place.
>  > 
>  > I'm open to learn a third way to achieve what we need. I'm just
>  > convinced that the old way was far worse.
>  > 
>  > Please consider for a better suggestion that the number of variants
>  > increase with my ticket lock. That's why I tried to stuff things in
>  > macros. Hmm, maybe we should simply get rid of the file/line/function
>  > stuff completely and switch to IP + ksyms. What do you think?
> 
> I do not want to leave this in a dead end. IMO, your approach make
> xnlock_get readable in the non debugging case at the expense of its
> readability in the debugging case. I would better see the two
> implementations with a unique ifdef. Granted, there will be some code
> duplication, but it will not be that much, and this allows us to move
> the debugging version out of line while keeping the non debugging case
> inline.

Don't panic. I'm sitting on a new version of this patch series, only 
running a final benchmark to estimate the gain. This unfortunately takes 
a lot of time.

BTW, the series will also add lock debugging for UP, and it beautifies 
the refactoring a bit more, addressing your concerns.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2008-03-01 19:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-23 13:33 [Xenomai-core] [PATCH 0/4] Fixes and improvements around xnlock Jan Kiszka
2008-02-23 13:36 ` [Xenomai-core] [PATCH 2/4] Fix and optimize xnlock_put Jan Kiszka
2008-02-23 17:41   ` Gilles Chanteperdrix
2008-02-23 18:05     ` Jan Kiszka
2008-02-23 18:29       ` Gilles Chanteperdrix
2008-02-23 18:57         ` Jan Kiszka
2008-02-23 19:41           ` Gilles Chanteperdrix
2008-02-23 23:50           ` Philippe Gerum
2008-02-23 13:37 ` [Xenomai-core] [PATCH 1/4] Refactor generic system.h Jan Kiszka
2008-02-23 17:38   ` Gilles Chanteperdrix
2008-02-23 18:03     ` Jan Kiszka
2008-02-23 18:59       ` Gilles Chanteperdrix
2008-03-01 18:54       ` Gilles Chanteperdrix
2008-03-01 19:22         ` Jan Kiszka [this message]
2008-02-23 13:38 ` [Xenomai-core] [PATCH 3/4] Uninline heavy locking functions Jan Kiszka
2008-02-23 17:51   ` Gilles Chanteperdrix
2008-02-23 18:13     ` Jan Kiszka
2008-02-23 18:33       ` Gilles Chanteperdrix
2008-02-23 18:58         ` Jan Kiszka
2008-02-23 21:36   ` Jeroen Van den Keybus
2008-02-23 13:50 ` [Xenomai-core] [RFC][PATCH 4/4] Recursive FIFO ticket xnlock Jan Kiszka
2008-02-23 17:54   ` Gilles Chanteperdrix
2008-02-23 18:20     ` Jan Kiszka
2008-02-23 18:43       ` Gilles Chanteperdrix
2008-02-23 19:13         ` Jan Kiszka

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=47C9ACF9.4020106@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=Xenomai-core@domain.hid \
    --cc=gilles.chanteperdrix@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.