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: <4B270AA6.3050307@kernel.org>
Date:	Tue, 15 Dec 2009 13:03:50 +0900
From:	Tejun Heo <tj@...nel.org>
To:	Christoph Lameter <cl@...ux-foundation.org>
CC:	linux-kernel@...r.kernel.org, Mel Gorman <mel@....ul.ie>,
	Pekka Enberg <penberg@...helsinki.fi>,
	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
	Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [this_cpu_xx V7 7/8] Module handling: Use this_cpu_xx to dynamically
 allocate counters

(Rusty Russell cc'd.)

On 12/15/2009 07:03 AM, Christoph Lameter wrote:
> @@ -479,15 +467,15 @@ static inline int try_module_get(struct 
>  	int ret = 1;
>  
>  	if (module) {
> -		unsigned int cpu = get_cpu();
>  		if (likely(module_is_live(module))) {
> -			local_inc(__module_ref_addr(module, cpu));
> +			preempt_disable();
> +			__this_cpu_inc(module->refptr->count);
>  			trace_module_get(module, _THIS_IP_,
> -				local_read(__module_ref_addr(module, cpu)));
> +				__this_cpu_read(module->refptr->count));
> +			preempt_enable();
>  		}
>  		else
>  			ret = 0;
> -		put_cpu();

I think you need preemption disabled while checking whether
module_is_live().  The state is protected by stop_machine or
synchronize_sched().

Thanks.

-- 
tejun
--
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