mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Namhyung Kim <namhyung@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>,
	Roland McGrath <roland@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] signal: annotate siglock acquisition
Date: Sat, 25 Sep 2010 14:23:43 +0200	[thread overview]
Message-ID: <1285417423.2478.475.camel@edumazet-laptop> (raw)
In-Reply-To: <AANLkTimD2zfLoYrXARs2dNHq7XEjpuVgCxEXEp-qm2Go@mail.gmail.com>

Le samedi 25 septembre 2010 à 20:33 +0900, Namhyung Kim a écrit :

> What's the difference? I didn't change the semantics of likely clause
> but simply exchange the order of then-else part because IMHO a
> negative expression make it hard to understand, generally.
> I've checked compiled binaries for both cases on x86 and they
> produced exactly same code.
> 


Anyway, re-reading your patch, I just dont get why you use __cond_lock()
two times, but not on this part ?

if (!likely(__cond_lock(&t->sighand->siglock,
			lock_task_sighand(t, &flags))))
	goto ret;

This way, your patch would not be misleading.


Another way to deal with this sparse mess is to use a macro, like we do
for read_trylock() :

#define read_trylock(lock)    __cond_lock(lock, _raw_read_trylock(lock))

-->

#define lock_task_sighand(t, flags) 			\
	__cond_lock(&(t)->sighand->siglock,		\
		    _raw_lock_task_sighand(t, flags))




  reply	other threads:[~2010-09-25 12:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-25  9:21 Namhyung Kim
2010-09-25  9:42 ` Eric Dumazet
2010-09-25 11:33   ` Namhyung Kim
2010-09-25 12:23     ` Eric Dumazet [this message]
2010-09-25 12:51       ` Namhyung Kim

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=1285417423.2478.475.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@gmail.com \
    --cc=oleg@redhat.com \
    --cc=roland@redhat.com \
    /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®