diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-01-08 02:24:30 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-01-24 19:40:29 -0500 |
commit | 0e47c99d7fe25e0f3907d9f3401079169d904891 (patch) | |
tree | b8d8e5b1d7d7ba00431d3e476f72644b374b9010 /include/linux/sysctl.h | |
parent | 6980128fe1b834c92a85e556ca8198030f0d8d01 (diff) |
sysctl: Replace root_list with links between sysctl_table_sets.
Piecing together directories by looking first in one directory
tree, than in another directory tree and finally in a third
directory tree makes it hard to verify that some directory
entries are not multiply defined and makes it hard to create
efficient implementations the sysctl filesystem.
Replace the sysctl wide list of roots with autogenerated
links from the core sysctl directory tree to the other
sysctl directory trees.
This simplifies sysctl directory reading and lookups as now
only entries in a single sysctl directory tree need to be
considered.
Benchmark before:
make-dummies 0 999 -> 0.44s
rmmod dummy -> 0.065s
make-dummies 0 9999 -> 1m36s
rmmod dummy -> 0.4s
Benchmark after:
make-dummies 0 999 -> 0.63s
rmmod dummy -> 0.12s
make-dummies 0 9999 -> 2m35s
rmmod dummy -> 18s
The slowdown is caused by the lookups used in insert_headers
and put_links to see if we need to add links or remove links.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'include/linux/sysctl.h')
-rw-r--r-- | include/linux/sysctl.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 3084b624868c..2a1446a96094 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -1051,12 +1051,11 @@ struct ctl_dir { | |||
1051 | 1051 | ||
1052 | struct ctl_table_set { | 1052 | struct ctl_table_set { |
1053 | struct list_head list; | 1053 | struct list_head list; |
1054 | struct ctl_table_root *root; | ||
1055 | int (*is_seen)(struct ctl_table_set *); | 1054 | int (*is_seen)(struct ctl_table_set *); |
1055 | struct ctl_dir dir; | ||
1056 | }; | 1056 | }; |
1057 | 1057 | ||
1058 | struct ctl_table_root { | 1058 | struct ctl_table_root { |
1059 | struct list_head root_list; | ||
1060 | struct ctl_table_set default_set; | 1059 | struct ctl_table_set default_set; |
1061 | struct ctl_table_set *(*lookup)(struct ctl_table_root *root, | 1060 | struct ctl_table_set *(*lookup)(struct ctl_table_root *root, |
1062 | struct nsproxy *namespaces); | 1061 | struct nsproxy *namespaces); |