Commit 8058ea64 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Add a sysfs attr for triggering discards

We're currently debugging an issue with discards not getting run; this
patch adds a manual trigger so we can then watch the tracepoint while it
runs.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 48620e51
...@@ -150,6 +150,7 @@ do { \ ...@@ -150,6 +150,7 @@ do { \
} while (0) } while (0)
write_attribute(trigger_gc); write_attribute(trigger_gc);
write_attribute(trigger_discards);
write_attribute(prune_cache); write_attribute(prune_cache);
rw_attribute(btree_gc_periodic); rw_attribute(btree_gc_periodic);
rw_attribute(gc_gens_pos); rw_attribute(gc_gens_pos);
...@@ -505,6 +506,9 @@ STORE(bch2_fs) ...@@ -505,6 +506,9 @@ STORE(bch2_fs)
#endif #endif
} }
if (attr == &sysfs_trigger_discards)
bch2_do_discards(c);
#ifdef CONFIG_BCACHEFS_TESTS #ifdef CONFIG_BCACHEFS_TESTS
if (attr == &sysfs_perf_test) { if (attr == &sysfs_perf_test) {
char *tmp = kstrdup(buf, GFP_KERNEL), *p = tmp; char *tmp = kstrdup(buf, GFP_KERNEL), *p = tmp;
...@@ -573,6 +577,7 @@ struct attribute *bch2_fs_internal_files[] = { ...@@ -573,6 +577,7 @@ struct attribute *bch2_fs_internal_files[] = {
&sysfs_io_timers_write, &sysfs_io_timers_write,
&sysfs_trigger_gc, &sysfs_trigger_gc,
&sysfs_trigger_discards,
&sysfs_prune_cache, &sysfs_prune_cache,
&sysfs_read_realloc_races, &sysfs_read_realloc_races,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment