lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJFZqHwsjuw5As6duphrgbzxtwmE2ZqbraNEme88M3hi1WBiRQ@mail.gmail.com>
Date:	Sat, 13 Sep 2014 10:48:14 +0800
From:	Li RongQing <roy.qing.li@...il.com>
To:	Guenter Roeck <linux@...ck-us.net>
Cc:	linux-kernel@...r.kernel.org, viro@...iv.linux.org.uk,
	fabf@...net.be, jkosina@...e.cz,
	Paul McKenney <paulmck@...ux.vnet.ibm.com>, richard@....at,
	oleg@...hat.com, akpm@...ux-foundation.org
Subject: Re: [RFC][PATCH] signal: replace !likely with unlikely!

I did not test, how to test it?

On Fri, Sep 12, 2014 at 3:18 AM, Guenter Roeck <linux@...ck-us.net> wrote:
> On Thu, Sep 11, 2014 at 08:48:16AM +0800, roy.qing.li@...il.com wrote:
>> From: Li RongQing <roy.qing.li@...il.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@...il.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@...r.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>>
>>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ