All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li RongQing <roy.qing.li@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
	fabf@skynet.be, jkosina@suse.cz,
	Paul McKenney <paulmck@linux.vnet.ibm.com>,
	richard@nod.at, oleg@redhat.com, akpm@linux-foundation.org
Subject: Re: [RFC][PATCH] signal: replace !likely with unlikely!
Date: Sat, 13 Sep 2014 10:48:14 +0800	[thread overview]
Message-ID: <CAJFZqHwsjuw5As6duphrgbzxtwmE2ZqbraNEme88M3hi1WBiRQ@mail.gmail.com> (raw)
In-Reply-To: <20140911191830.GA31511@roeck-us.net>

I did not test, how to test it?

On Fri, Sep 12, 2014 at 3:18 AM, Guenter Roeck <linux@roeck-us.net> wrote:
> On Thu, Sep 11, 2014 at 08:48:16AM +0800, roy.qing.li@gmail.com wrote:
>> From: Li RongQing <roy.qing.li@gmail.com>
>>
>> !likely() is hard to be understood, and I do not know if compiler can
>> optimise this condition, but unlikely(!()) is clear
>>
>> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
>> ---
>>  kernel/signal.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/signal.c b/kernel/signal.c
>> index 8f0876f..6156cfa 100644
>> --- a/kernel/signal.c
>> +++ b/kernel/signal.c
>> @@ -1571,7 +1571,7 @@ int send_sigqueue(struct sigqueue *q, struct task_struct *t, int group)
>>       BUG_ON(!(q->flags & SIGQUEUE_PREALLOC));
>>
>>       ret = -1;
>> -     if (!likely(lock_task_sighand(t, &flags)))
>> +     if (unlikely(!lock_task_sighand(t, &flags)))
>
> I wonder if you tested this code. Seems to be unlikely (punt not intended).
>
> Guenter
>
>>               goto ret;
>>
>>       ret = 1; /* the signal is ignored */
>> --
>> 1.7.10.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>>
>>

  reply	other threads:[~2014-09-13  2:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11  0:48 [RFC][PATCH] signal: replace !likely with unlikely! roy.qing.li
2014-09-11 19:18 ` Guenter Roeck
2014-09-13  2:48   ` Li RongQing [this message]
2014-09-13 10:04     ` Richard Weinberger
2014-09-13 13:28       ` Guenter Roeck

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=CAJFZqHwsjuw5As6duphrgbzxtwmE2ZqbraNEme88M3hi1WBiRQ@mail.gmail.com \
    --to=roy.qing.li@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=oleg@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=richard@nod.at \
    --cc=viro@zeniv.linux.org.uk \
    /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.