Thread (12 messages) 12 messages, 5 authors, 2016-05-23

Re: [PATCHv2] mm/zsmalloc: don't fail if can't create debugfs info

From: Dan Streetman <hidden>
Date: 2016-05-20 10:33:28
Also in: lkml

On Fri, May 20, 2016 at 12:08 AM, Sergey Senozhatsky
[off-list ref] wrote:
On (05/19/16 11:18), Dan Streetman wrote:
[..]
quoted
      zs_stat_root = debugfs_create_dir("zsmalloc", NULL);
      if (!zs_stat_root)
-             return -ENOMEM;
-
-     return 0;
+             pr_warn("debugfs 'zsmalloc' stat dir creation failed\n");
 }

 static void __exit zs_stat_exit(void)
@@ -573,17 +575,19 @@ static const struct file_operations zs_stat_size_ops = {
      .release        = single_release,
 };

-static int zs_pool_stat_create(struct zs_pool *pool, const char *name)
+static void zs_pool_stat_create(struct zs_pool *pool, const char *name)
 {
      struct dentry *entry;

-     if (!zs_stat_root)
-             return -ENODEV;
+     if (!zs_stat_root) {
+             pr_warn("no root stat dir, not creating <%s> stat dir\n", name);
+             return;
+     }
just a small nit, there are basically two warn messages now for
`!zs_stat_root':

        debugfs 'zsmalloc' stat dir creation failed
        no root stat dir, not creating <%s> stat dir
They're logged at different times though, the first at module load
time, the second at every pool creation time.  So while they may be
logged together if the module is loaded because a pool is being
created, any later pools created will only log the second message.
may be we need only one of them; but no strong opinions.
If we drop either, I'd drop the first, but I think it could be useful
also in case zsmalloc is built-in or manually loaded without creating
a pool.
        -ss
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help