aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/ksysfs.c
diff options
context:
space:
mode:
authorAntti P Miettinen <ananaza@iki.fi>2012-10-05 02:59:15 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-10-23 17:54:08 -0400
commit3705b88db0d7cc4a097c32d9e554054103d3f807 (patch)
treef3baf8c94363506964c9f944496267f74cdee47c /kernel/ksysfs.c
parentba49df4767d4fa5bbd2af3a51709fb81f94264ec (diff)
rcu: Add a module parameter to force use of expedited RCU primitives
There have been some embedded applications that would benefit from use of expedited grace-period primitives. In some ways, this is similar to synchronize_net() doing either a normal or an expedited grace period depending on lock state, but with control outside of the kernel. This commit therefore adds rcu_expedited boot and sysfs parameters that cause the kernel to substitute expedited primitives for the normal grace-period primitives. [ paulmck: Add trace/event/rcu.h to kernel/srcu.c to avoid build error. Get rid of infinite loop through contention path.] Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/ksysfs.c')
-rw-r--r--kernel/ksysfs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index 4e316e1acf58..8715a798aa7c 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -141,6 +141,23 @@ static ssize_t fscaps_show(struct kobject *kobj,
141} 141}
142KERNEL_ATTR_RO(fscaps); 142KERNEL_ATTR_RO(fscaps);
143 143
144int rcu_expedited;
145static ssize_t rcu_expedited_show(struct kobject *kobj,
146 struct kobj_attribute *attr, char *buf)
147{
148 return sprintf(buf, "%d\n", rcu_expedited);
149}
150static ssize_t rcu_expedited_store(struct kobject *kobj,
151 struct kobj_attribute *attr,
152 const char *buf, size_t count)
153{
154 if (kstrtoint(buf, 0, &rcu_expedited))
155 return -EINVAL;
156
157 return count;
158}
159KERNEL_ATTR_RW(rcu_expedited);
160
144/* 161/*
145 * Make /sys/kernel/notes give the raw contents of our kernel .notes section. 162 * Make /sys/kernel/notes give the raw contents of our kernel .notes section.
146 */ 163 */
@@ -182,6 +199,7 @@ static struct attribute * kernel_attrs[] = {
182 &kexec_crash_size_attr.attr, 199 &kexec_crash_size_attr.attr,
183 &vmcoreinfo_attr.attr, 200 &vmcoreinfo_attr.attr,
184#endif 201#endif
202 &rcu_expedited_attr.attr,
185 NULL 203 NULL
186}; 204};
187 205