Florian Westphal
b0f38338ae
netfilter: reduce size of hook entry point locations
...
struct net contains:
struct nf_hook_entries __rcu *hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS];
which store the hook entry point locations for the various protocol
families and the hooks.
Using array results in compact c code when doing accesses, i.e.
x = rcu_dereference(net->nf.hooks[pf][hook]);
but its also wasting a lot of memory, as most families are
not used.
So split the array into those families that are used, which
are only 5 (instead of 13). In most cases, the 'pf' argument is
constant, i.e. gcc removes switch statement.
struct net before:
/* size: 5184, cachelines: 81, members: 46 */
after:
/* size: 4672, cachelines: 73, members: 46 */
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2018-01-08 18:01:08 +01:00
..
2017-07-11 06:08:58 -04:00
2017-10-30 12:25:45 +02:00
2017-11-02 11:10:55 +01:00
2018-01-08 18:01:06 +01:00
2018-01-08 18:01:08 +01:00
2017-04-05 10:15:20 +02:00
2017-10-07 23:15:08 +01:00
2017-12-15 13:52:22 -05:00
2017-12-06 14:50:13 -05:00
2017-04-12 22:02:36 +02:00
2017-12-13 13:58:41 -05:00
2017-12-04 13:35:36 -05:00
2017-10-18 11:42:48 +01:00
2017-11-02 11:10:55 +01:00
2017-10-05 18:44:17 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-05-27 18:51:41 -04:00
2017-10-25 10:54:39 +09:00
2017-08-11 14:59:24 -07:00
2017-07-04 22:35:16 +01:00
2018-01-04 14:33:29 -05:00
2016-07-08 12:20:57 +02:00
2017-01-20 12:12:13 -05:00
2017-07-04 01:29:04 -07:00
2016-06-25 12:19:35 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-08-31 14:42:19 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-18 12:39:36 +01:00
2017-11-30 09:54:25 -05:00
2017-11-04 09:26:51 +09:00
2017-12-07 14:14:54 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-04 09:26:51 +09:00
2017-11-02 11:10:55 +01:00
2017-11-30 09:54:27 -05:00
2017-12-15 12:34:00 -05:00
2017-11-02 11:10:55 +01:00
2017-11-01 11:50:43 +09:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-11 15:36:05 +09:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-30 21:09:24 +09:00
2017-10-11 09:49:34 +02:00
2017-11-02 11:10:55 +01:00
2017-12-08 13:32:26 -05:00
2017-11-16 10:49:00 +09:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-11 14:10:06 -05:00
2017-11-02 11:10:55 +01:00
2017-01-25 16:00:33 +01:00
2017-07-04 01:29:04 -07:00
2017-11-02 11:10:55 +01:00
2017-01-18 13:04:28 -05:00
2017-08-07 11:39:22 -07:00
2017-11-02 11:10:55 +01:00
2017-12-03 10:18:28 -05:00
2017-11-04 09:26:51 +09:00
2017-11-04 09:26:51 +09:00
2017-12-03 10:18:28 -05:00
2017-12-20 14:00:25 -05:00
2017-12-13 14:33:10 -05:00
2017-11-02 11:10:55 +01:00
2018-01-07 21:29:40 -05:00
2018-01-07 21:29:40 -05:00
2017-12-15 12:34:00 -05:00
2017-09-29 06:19:32 +01:00
2017-12-15 12:34:00 -05:00
2018-01-08 18:01:02 +01:00
2017-12-16 22:11:55 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-03 10:18:28 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2016-08-17 19:36:23 -04:00
2016-10-13 12:05:26 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-25 12:06:25 +09:00
2017-07-04 22:35:15 +01:00
2017-11-02 11:10:55 +01:00
2017-12-19 10:12:48 +01:00
2016-07-08 13:23:12 +02:00
2017-11-02 11:10:55 +01:00
2017-04-01 20:21:44 -07:00
2016-10-03 02:00:22 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-04 09:26:51 +09:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-04 09:26:51 +09:00
2017-07-01 07:39:09 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2016-07-08 12:20:57 +02:00
2017-11-08 16:12:33 +09:00
2017-11-02 11:10:55 +01:00
2018-01-05 11:18:27 -05:00
2017-12-21 12:32:51 -05:00
2017-11-02 11:10:55 +01:00
2017-10-01 03:55:47 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-08-07 11:39:21 -07:00
2017-11-02 11:10:55 +01:00
2017-12-05 14:37:13 -05:00
2017-10-20 13:21:36 +01:00
2017-11-02 11:10:55 +01:00
2017-10-01 03:55:47 +01:00
2017-12-04 11:32:53 -05:00
2017-12-21 12:32:51 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2016-11-09 20:40:06 -05:00
2017-08-25 17:10:23 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-29 15:42:26 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-25 10:37:11 +09:00
2017-11-10 13:41:40 +09:00
2017-12-13 15:51:12 -05:00
2017-11-11 15:36:05 +09:00
2017-11-15 13:54:18 +09:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-08-29 15:16:52 -07:00
2017-11-02 11:10:55 +01:00
2017-10-01 03:55:47 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-01-05 15:21:21 -08:00
2017-12-29 15:42:26 -05:00