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:	Fri, 29 Mar 2013 09:07:17 +0800
From:	RongQing Li <roy.qing.li@...il.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	netdev@...r.kernel.org, Christoph Lameter <cl@...ux.com>
Subject: Re: [PATCH net-next] core: simplify the getting percpu of flow_cache

2013/3/28 Eric Dumazet <eric.dumazet@...il.com>:
> On Thu, 2013-03-28 at 20:24 +0800, roy.qing.li@...il.com wrote:
>> From: Li RongQing <roy.qing.li@...il.com>
>>
>> replace per_cpu with per_cpu_ptr to save conversion between address and pointer
>>
>> Signed-off-by: Li RongQing <roy.qing.li@...il.com>
>> ---
>>  net/core/flow.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/core/flow.c b/net/core/flow.c
>> index 7fae135..707fb7b 100644
>> --- a/net/core/flow.c
>> +++ b/net/core/flow.c
>> @@ -334,7 +334,7 @@ static int flow_cache_percpu_empty(struct flow_cache *fc, int cpu)
>>       struct flow_cache_percpu *fcp;
>>       int i;
>>
>> -     fcp = &per_cpu(*fc->percpu, cpu);
>> +     fcp = per_cpu_ptr(fc->percpu, cpu);
>>       for (i = 0; i < flow_cache_hash_size(fc); i++)
>>               if (!hlist_empty(&fcp->hash_table[i]))
>>                       return 0;
>
>
> This makes no difference at all, at least on x86
>
> Care to elaborate ?
>
I think it seems to be same as per_cpu, but it makes the codes easy to read,
by ignore & before per_cpu() and * beore fc->percpu, and other places in flow.c
are using  per_cpu_ptr(fc->percpu, cpu)

-Roy
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ