From: Guenter Roeck <linux@roeck-us.net>
To: roy.qing.li@gmail.com
Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
fabf@skynet.be, jkosina@suse.cz, 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: Thu, 11 Sep 2014 12:18:30 -0700 [thread overview]
Message-ID: <20140911191830.GA31511@roeck-us.net> (raw)
In-Reply-To: <1410396496-13845-1-git-send-email-roy.qing.li@gmail.com>
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/
>
>
next prev parent reply other threads:[~2014-09-11 19:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-11 0:48 roy.qing.li
2014-09-11 19:18 ` Guenter Roeck [this message]
2014-09-13 2:48 ` Li RongQing
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=20140911191830.GA31511@roeck-us.net \
--to=linux@roeck-us.net \
--cc=akpm@linux-foundation.org \
--cc=fabf@skynet.be \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=richard@nod.at \
--cc=roy.qing.li@gmail.com \
--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 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®