Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5108261ybe; Tue, 17 Sep 2019 02:45:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAD0s6AWk55AI9r95Ad4H044wvb5D7TPmyc8tKCByzYMaISqOvdArpHOpIaX8xTmP/kUvh X-Received: by 2002:a17:906:5584:: with SMTP id y4mr3833883ejp.89.1568713545604; Tue, 17 Sep 2019 02:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568713545; cv=none; d=google.com; s=arc-20160816; b=Cq3P+kG1Us+FY2D1imHBPTXxpl87GVl+/ykvpYaPQBBnWcUjdjcHve0S9AXwflKeeE ARofvfRLIWY20mqkYW22qUqce6eQQGRii2wjrSM3DjL5+Qe66MZTm0iOeUoC3amyZ2FS Vn4wcYvu2pwOlt8EZ5X/vcEPLkgM7k2CLeJuVpmep4gfz9kqTj7aY9LWuGuXXSZoR+eh SoYCE5Cb6c66DRl93SjRE/YDN1iR+fj5Xrc/RgLdA9740e7w50BzfO7950z8T4ty6mWI 8mNhU14TCPTFmq0QRIMoUV3G6JTk2Dw/IoD0DU5Jhf+RWnDh0AFcoTSk2nBYzHgZOVq7 qJZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Jic4rHTv3yMtwdOu17+6UfT3+SUC7jTwi6ljBW+pvYE=; b=Zd67Zp08+MHKBV8VSVwPH4n9mvas2u7+52zWtKkUWcEFFApqTmdkL9prvgFpGfmpyE R+47E90nggKOblurzJvcSLa4fUkMihkZz3l8/WX8fcgQ5lg2ez176B8MIixMQtv1oglP 7dvljcpDgz1DFq7IPOXHMVL28kaYi17oizHMI39Wn+Brrl9kHJbp6ijR74/KSl8W1gx8 rLu4Ad36hfWaIN2imr/qo0hexY2f0DoAAp6kstTeOchG1NhcPbYAVvQGecPZw1EjqPEC Gd/PKFUWfsfx2BVWXrvS9lTlmYRylo6D1J/bcbQu4Hi/Bz13qftVXK57HZvenB0KpmKR EIFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=IV3dtqvS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c51si1028438edc.317.2019.09.17.02.45.21; Tue, 17 Sep 2019 02:45:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=IV3dtqvS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404552AbfIQHw0 (ORCPT + 99 others); Tue, 17 Sep 2019 03:52:26 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:37165 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404543AbfIQHwY (ORCPT ); Tue, 17 Sep 2019 03:52:24 -0400 Received: by mail-io1-f65.google.com with SMTP id b19so5386357iob.4 for ; Tue, 17 Sep 2019 00:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Jic4rHTv3yMtwdOu17+6UfT3+SUC7jTwi6ljBW+pvYE=; b=IV3dtqvSDIRWDXPjXcX06Ffl/7ljGdcE8DIosKk5L/JRHh8kzXH24Rye+VdBQibPHO xg1S+GArM7qvm+Fr283w2sx1nmfwITJFPnv5lIMEc69DZgNWxtaa4tA2zilqhBEkHKXc zp0zekRQXdYTzXqNFgWZSH8mQTgV7Bq1ZMFKg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Jic4rHTv3yMtwdOu17+6UfT3+SUC7jTwi6ljBW+pvYE=; b=teOuUaZFiWe/+7TMo6QUnuEuQD+4w7yBxpuQJ10x1fk98TlktptgKMbLjb9TmpQRG3 +iUCRH6XMxShjM6TUDqXsV9Ele95/uP1mVO1VnEDN3kGnw9CoZbD9Xv50eo+aafdG66N 0SnxW+6wAHRRwsMi3Ex01OjjjnGLaz+Lsr/wYYA02jDzwE9MKAFtUhrRiNPsUY32OX/a GTkZHmXHJ5SqcFZWLYm7GVfRI7knxG3RXPsWGUDB4PHQPwpwmLRsmsLHHfj4ifhwQgbj mJGu84eeInoSd1X0Xiq2bFwv2znZBy4Pm08iw3p/mo1wvyvsx8IW9tkY9FKW5+tkuPWW RQNA== X-Gm-Message-State: APjAAAWxNuvlUZ3hcbNZ9e4fJYqKEsmgN6KDp6l33sA7N7aW+jR8wcTq dMGu5h1SwFNRW0ogsG93FzDYmUxiOA6wSsKdZLIwLA== X-Received: by 2002:a6b:bec6:: with SMTP id o189mr2094109iof.62.1568706743655; Tue, 17 Sep 2019 00:52:23 -0700 (PDT) MIME-Version: 1.0 References: <20190916235642.167583-1-khazhy@google.com> <20190916235642.167583-2-khazhy@google.com> In-Reply-To: <20190916235642.167583-2-khazhy@google.com> From: Miklos Szeredi Date: Tue, 17 Sep 2019 09:52:12 +0200 Message-ID: Subject: Re: [PATCH v3 2/2] fuse: kmemcg account fs data To: Khazhismel Kumykov Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Shakeel B Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 17, 2019 at 1:56 AM Khazhismel Kumykov wrote: > > account per-file, dentry, and inode data > > blockdev/superblock and temporary per-request data was left alone, as > this usually isn't accounted > > Signed-off-by: Khazhismel Kumykov > Reviewed-by: Shakeel Butt > --- > fs/fuse/dir.c | 3 ++- > fs/fuse/file.c | 5 +++-- > fs/fuse/inode.c | 3 ++- > 3 files changed, 7 insertions(+), 4 deletions(-) > > diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c > index 58557d4817e9..d572c900bb0f 100644 > --- a/fs/fuse/dir.c > +++ b/fs/fuse/dir.c > @@ -279,7 +279,8 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) > #if BITS_PER_LONG < 64 > static int fuse_dentry_init(struct dentry *dentry) > { > - dentry->d_fsdata = kzalloc(sizeof(union fuse_dentry), GFP_KERNEL); > + dentry->d_fsdata = kzalloc(sizeof(union fuse_dentry), > + GFP_KERNEL_ACCOUNT | __GFP_RECLAIMABLE); > > return dentry->d_fsdata ? 0 : -ENOMEM; > } > diff --git a/fs/fuse/file.c b/fs/fuse/file.c > index a2ea347c4d2c..862aff3665b5 100644 > --- a/fs/fuse/file.c > +++ b/fs/fuse/file.c > @@ -63,12 +63,13 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc) > { > struct fuse_file *ff; > > - ff = kzalloc(sizeof(struct fuse_file), GFP_KERNEL); > + ff = kzalloc(sizeof(struct fuse_file), GFP_KERNEL_ACCOUNT); > if (unlikely(!ff)) > return NULL; > > ff->fc = fc; > - ff->release_args = kzalloc(sizeof(*ff->release_args), GFP_KERNEL); > + ff->release_args = kzalloc(sizeof(*ff->release_args), > + GFP_KERNEL_ACCOUNT); > if (!ff->release_args) { > kfree(ff); > return NULL; > diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c > index 3d598a5bb5b5..6cb445bed89d 100644 > --- a/fs/fuse/inode.c > +++ b/fs/fuse/inode.c > @@ -66,7 +66,8 @@ static struct file_system_type fuseblk_fs_type; > > struct fuse_forget_link *fuse_alloc_forget(void) > { > - return kzalloc(sizeof(struct fuse_forget_link), GFP_KERNEL); > + return kzalloc(sizeof(struct fuse_forget_link), > + GFP_KERNEL_ACCOUNT | __GFP_RECLAIMABLE); What does __GFP_RECLAIMBALE signify in slab allocs? You understand that the forget_link is not reclaimable in the sense, that it requires action (reading requests from the fuse device) from the userspace filesystem daemon? Thanks, Miklos