mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
net: clean up snmp stats code
commit8f0ea0fe3a(snmp: reduce percpu needs by 50%) reduced snmp array size to 1, so technically it doesn't have to be an array any more. What's more, after the following commit: commit933393f58fDate: Thu Dec 22 11:58:51 2011 -0600 percpu: Remove irqsafe_cpu_xxx variants We simply say that regular this_cpu use must be safe regardless of preemption and interrupt state. That has no material change for x86 and s390 implementations of this_cpu operations. However, arches that do not provide their own implementation for this_cpu operations will now get code generated that disables interrupts instead of preemption. probably no arch wants to have SNMP_ARRAY_SZ == 2. At least after almost 3 years, no one complains. So, just convert the array to a single pointer and remove snmp_mib_init() and snmp_mib_free() as well. Cc: Christoph Lameter <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: David S. Miller <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
d1f88a667c
commit
698365fa18
12 changed files with 103 additions and 162 deletions
|
|
@ -1084,14 +1084,15 @@ EXPORT_SYMBOL_GPL(dccp_shutdown);
|
|||
|
||||
static inline int dccp_mib_init(void)
|
||||
{
|
||||
return snmp_mib_init((void __percpu **)dccp_statistics,
|
||||
sizeof(struct dccp_mib),
|
||||
__alignof__(struct dccp_mib));
|
||||
dccp_statistics = alloc_percpu(struct dccp_mib);
|
||||
if (!dccp_statistics)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void dccp_mib_exit(void)
|
||||
{
|
||||
snmp_mib_free((void __percpu **)dccp_statistics);
|
||||
free_percpu(dccp_statistics);
|
||||
}
|
||||
|
||||
static int thash_entries;
|
||||
|
|
|
|||
Loading…
Reference in a new issue