X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=fs%2Fkernfs%2Fdir.c;fp=fs%2Fkernfs%2Fdir.c;h=fffca9517321c88ee1e0128b864b257c56e2350d;hb=499611ed451508a42d1d7d1faff10177827755d5;hp=f131fc23ffc4c18f03a9764973fa998bf0e5f79e;hpb=8f4fc071b1926d0b20336e2b3f8ab85c94c734c5;p=firefly-linux-kernel-4.4.55.git diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index f131fc23ffc4..fffca9517321 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -518,7 +518,14 @@ static struct kernfs_node *__kernfs_new_node(struct kernfs_root *root, if (!kn) goto err_out1; - ret = ida_simple_get(&root->ino_ida, 1, 0, GFP_KERNEL); + /* + * If the ino of the sysfs entry created for a kmem cache gets + * allocated from an ida layer, which is accounted to the memcg that + * owns the cache, the memcg will get pinned forever. So do not account + * ino ida allocations. + */ + ret = ida_simple_get(&root->ino_ida, 1, 0, + GFP_KERNEL | __GFP_NOACCOUNT); if (ret < 0) goto err_out2; kn->ino = ret;