You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[NETFILTER]: x_tables: struct xt_table_info diet
Instead of using a big array of NR_CPUS entries, we can compute the size needed at runtime, using nr_cpu_ids This should save some ram (especially on David's machines where NR_CPUS=4096 : 32 KB can be saved per table, and 64KB for dynamically allocated ones (because of slab/slub alignements) ) In particular, the 'bootstrap' tables are not any more static (in data section) but on stack as their size is now very small. This also should reduce the size used on stack in compat functions (get_info() declares an automatic variable, that could be bigger than kernel stack size for big NR_CPUS) Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
d3c5ee6d54
commit
259d4e41f3
@@ -269,9 +269,12 @@ struct xt_table_info
|
||||
unsigned int underflow[NF_INET_NUMHOOKS];
|
||||
|
||||
/* ipt_entry tables: one per CPU */
|
||||
char *entries[NR_CPUS];
|
||||
/* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */
|
||||
char *entries[1];
|
||||
};
|
||||
|
||||
#define XT_TABLE_INFO_SZ (offsetof(struct xt_table_info, entries) \
|
||||
+ nr_cpu_ids * sizeof(char *))
|
||||
extern int xt_register_target(struct xt_target *target);
|
||||
extern void xt_unregister_target(struct xt_target *target);
|
||||
extern int xt_register_targets(struct xt_target *target, unsigned int n);
|
||||
|
||||
Reference in New Issue
Block a user