aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/debugfs.c
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@hq.newdream.net>2009-12-18 16:51:57 -0500
committerSage Weil <sage@newdream.net>2009-12-21 19:39:56 -0500
commit2baba25019ec564cd247af74013873d69a0b8190 (patch)
treec0995b8087cff771dd51aaf1194fd238f4490f01 /fs/ceph/debugfs.c
parentdbd646a851713bec5bfff40ecf624b2e78518fe5 (diff)
ceph: writeback congestion control
Set bdi congestion bit when amount of write data in flight exceeds adjustable threshold. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/debugfs.c')
-rw-r--r--fs/ceph/debugfs.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index 441484ab7e94..22d3b47fb1be 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -320,6 +320,30 @@ DEFINE_SHOW_FUNC(osdc_show)
320DEFINE_SHOW_FUNC(dentry_lru_show) 320DEFINE_SHOW_FUNC(dentry_lru_show)
321DEFINE_SHOW_FUNC(caps_show) 321DEFINE_SHOW_FUNC(caps_show)
322 322
323static int congestion_kb_set(void *data, u64 val)
324{
325 struct ceph_client *client = (struct ceph_client *)data;
326
327 if (client)
328 client->mount_args->congestion_kb = (int)val;
329
330 return 0;
331}
332
333static int congestion_kb_get(void *data, u64 *val)
334{
335 struct ceph_client *client = (struct ceph_client *)data;
336
337 if (client)
338 *val = (u64)client->mount_args->congestion_kb;
339
340 return 0;
341}
342
343
344DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
345 congestion_kb_set, "%llu\n");
346
323int __init ceph_debugfs_init(void) 347int __init ceph_debugfs_init(void)
324{ 348{
325 ceph_debugfs_dir = debugfs_create_dir("ceph", NULL); 349 ceph_debugfs_dir = debugfs_create_dir("ceph", NULL);
@@ -409,6 +433,14 @@ int ceph_debugfs_client_init(struct ceph_client *client)
409 if (!client->debugfs_caps) 433 if (!client->debugfs_caps)
410 goto out; 434 goto out;
411 435
436 client->debugfs_congestion_kb = debugfs_create_file("writeback_congestion_kb",
437 0600,
438 client->debugfs_dir,
439 client,
440 &congestion_kb_fops);
441 if (!client->debugfs_congestion_kb)
442 goto out;
443
412 sprintf(name, "../../bdi/%s", dev_name(client->sb->s_bdi->dev)); 444 sprintf(name, "../../bdi/%s", dev_name(client->sb->s_bdi->dev));
413 client->debugfs_bdi = debugfs_create_symlink("bdi", client->debugfs_dir, 445 client->debugfs_bdi = debugfs_create_symlink("bdi", client->debugfs_dir,
414 name); 446 name);
@@ -431,6 +463,7 @@ void ceph_debugfs_client_cleanup(struct ceph_client *client)
431 debugfs_remove(client->osdc.debugfs_file); 463 debugfs_remove(client->osdc.debugfs_file);
432 debugfs_remove(client->mdsc.debugfs_file); 464 debugfs_remove(client->mdsc.debugfs_file);
433 debugfs_remove(client->monc.debugfs_file); 465 debugfs_remove(client->monc.debugfs_file);
466 debugfs_remove(client->debugfs_congestion_kb);
434 debugfs_remove(client->debugfs_dir); 467 debugfs_remove(client->debugfs_dir);
435} 468}
436 469