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] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1303011408230.25001@pobox.suse.cz>
Date:	Fri, 1 Mar 2013 14:09:08 +0100 (CET)
From:	Jiri Kosina <jkosina@...e.cz>
To:	liguang <lig.fnst@...fujitsu.com>
Cc:	luciarosculete@...il.com, linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/2] semaphore: give an unlikely for down's timeout

On Fri, 1 Mar 2013, liguang wrote:

> Signed-off-by: liguang <lig.fnst@...fujitsu.com>

Acked-by: Jiri Kosina <jkosina@...e.cz>


Makes sense. Adding Andrew to CC.

> ---
>  kernel/semaphore.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/semaphore.c b/kernel/semaphore.c
> index 4567fc0..9c7017d 100644
> --- a/kernel/semaphore.c
> +++ b/kernel/semaphore.c
> @@ -214,7 +214,7 @@ static inline int __sched __down_common(struct semaphore *sem, long state,
>  	for (;;) {
>  		if (signal_pending_state(state, task))
>  			goto interrupted;
> -		if (timeout <= 0)
> +		if (unlikely(timeout <= 0))
>  			goto timed_out;
>  		__set_task_state(task, state);
>  		raw_spin_unlock_irq(&sem->lock);
> -- 
> 1.7.2.5
> 

-- 
Jiri Kosina
SUSE Labs
--
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