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]
Date:	Sat, 30 Apr 2016 18:17:48 +0800
From:	Minfei Huang <mnghuan@...il.com>
To:	john.stultz@...aro.org, tglx@...utronix.de
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Make clocksource insert entry more efficiently

Ping.

Any comment is appreciate.

Thanks
Minfei

On 04/25/16 at 05:20P, Minfei Huang wrote:
> It is unnecessary to continue looping the list, if we find there is an
> entry that the value of rating is smaller than the new one. It is safe
> to be out the loop, because all of entry are inserted in descending
> order.
> 
> Signed-off-by: Minfei Huang <mnghuan@...il.com>
> ---
>  kernel/time/clocksource.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
> index 56ece14..6a5a310 100644
> --- a/kernel/time/clocksource.c
> +++ b/kernel/time/clocksource.c
> @@ -669,10 +669,12 @@ static void clocksource_enqueue(struct clocksource *cs)
>  	struct list_head *entry = &clocksource_list;
>  	struct clocksource *tmp;
>  
> -	list_for_each_entry(tmp, &clocksource_list, list)
> +	list_for_each_entry(tmp, &clocksource_list, list) {
>  		/* Keep track of the place, where to insert */
> -		if (tmp->rating >= cs->rating)
> -			entry = &tmp->list;
> +		if (tmp->rating < cs->rating)
> +			break;
> +		entry = &tmp->list;
> +	}
>  	list_add(&cs->list, entry);
>  }
>  
> -- 
> 2.6.3
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ