Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp715104ybl; Fri, 23 Aug 2019 07:23:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxN70XhLAPEUz3vZmo6ocPvwCk1+DQmUoTRDCUc0MmLnUeiUhgDyOLssL100Gae4Gaej7B2 X-Received: by 2002:a63:3805:: with SMTP id f5mr4187653pga.272.1566570189485; Fri, 23 Aug 2019 07:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566570189; cv=none; d=google.com; s=arc-20160816; b=okz8/a+iNyO34VVCCw4lMogqjAb/baiygTGzy2Z/lrr65kJVmalO5TGdxazc0EH4Zo PasxQOuDlY2wt5jA3IC9vL0nfuboOTslQWbgYU9p/yOTRJSzGsKU4PtxECgIIrceZKpX dfX/SxFYG6+8yGv2z+uVdRukmy078Xo6NZjMuOTO9G16QnukRYtLxs+bvRIiGqQ25tmW JAQDjPh9DEsUig0A8Mpz56OENKzxuJbBRQUFhvCoP0BI9g/v/Y5Km96GUUTEr203wxX1 +wZps3vpcFOu9u9zFF7OGdIOOYqbHoOjgQD6o1kIBvQf4MMO9z6nU4vWZgscnmv2UvoM mh8A== 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=jUm6yXYTlbTXopviUp4rylkFQbLJR/m96Sizb+UK2Sk=; b=OZ4Q/33aGzJ7fE4a9t3UwZW7xAu4NbSocgnwlRRZWLtRauXp6eHlQZMUmmoGLp9Fwx vv1toRwVbq5R9jQZy+Qo+TEUVvKstkAm1ZxInfvkiRBLobRwvR6WrGobss3DvKo2cmuL ylk1YjFWuPV2Mv8yXjC2WjHVvlNI3f5D5ExQIkx3Jc6TZ2G//S4BX1rX1DikiBpQwR2Q SbTSN2OAD3cGkbqfjE3BU06XIHa/mFU3eUiVlP76qxVTLOuV/4Q4U+L3HSyzOG+f5rvQ ILM+kEstoqDT1w9P9et+hHYx1zag1xJJ4kSFCjYFx3GZ+ai3NZvYKnPC6AVzjUJnwlIA 24Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=H31YN4ZN; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q38si2107832pgk.63.2019.08.23.07.22.53; Fri, 23 Aug 2019 07:23:09 -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=pass header.i=@google.com header.s=20161025 header.b=H31YN4ZN; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393296AbfHVVn3 (ORCPT + 99 others); Thu, 22 Aug 2019 17:43:29 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:40513 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393045AbfHVVn2 (ORCPT ); Thu, 22 Aug 2019 17:43:28 -0400 Received: by mail-yb1-f196.google.com with SMTP id g7so3129813ybd.7 for ; Thu, 22 Aug 2019 14:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jUm6yXYTlbTXopviUp4rylkFQbLJR/m96Sizb+UK2Sk=; b=H31YN4ZNsUnU299kwk54yLpzwRjkKDvY2XEOe7J+nAsMhciLQ8pxdS2tbnNaGjgiID A03OpSrudtbbeZUOHGHlPfuGOH8T4sflQ7jd9/Pmt7+CuIiUVLXEoDcp8t02bTzkXM88 FTWlKUQgTADJV3eWyOD/cvwdi9xAyXZUN18OSIBFgAlSaNns4xeMN6ccXtANOpwknQUJ /I9yMuEBn7nIS0yu8302B4kf0H2NF1Q6F2CP4IfW/h30ysAAzaQZBqhIJ2PXtfCUBgUe NTnG2KYoiHG+ZDkXih1IaR5Lx3OTOodsRcIwis4Bd9Ec5I2Shs+IELs+aGbeQK/9owR0 DkrA== 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=jUm6yXYTlbTXopviUp4rylkFQbLJR/m96Sizb+UK2Sk=; b=Mq5/04IMMfjtfT6RDNiN6INbkXlH7u8KKVjABbSHowRFyr7+olN8auDVGHOWALLNih 9CqpD3XK3Lfp8vZPt9ZBB6FWRI8s0u6i1jWrTfFSIgp2u+wrxBcHsk4+sg3oBBvdcIH1 kUnchlhKs4E8VH8bLDecF08U+3PCv9AcYoZ85099SqshBvOboLn3pxUZXZ06GIHcTQEu FbcE4LKGnvoFZwWMm10WJRe3ljxLq0DsOjSxwCqrePwFkW3yj8Gz1zvFqdJ4R87kcHvQ FsIRsGDOlkVALEdA//v5DrQd8dmXMlEmbjWiqDvUpDOM2CM4n1QXxtUAJvrNidoRY2al QEEA== X-Gm-Message-State: APjAAAUGZ0a/uIVyqVuKgHI4uew4XptiQ0cXREZA4/rtWU+Ocn6ayZaA h4sKOCDbAHjeYYJGdRALBC9qzeNgozhIHIToinJs+g== X-Received: by 2002:a25:e6c9:: with SMTP id d192mr828435ybh.467.1566510207880; Thu, 22 Aug 2019 14:43:27 -0700 (PDT) MIME-Version: 1.0 References: <20190822200030.141272-1-khazhy@google.com> <20190822200030.141272-3-khazhy@google.com> In-Reply-To: <20190822200030.141272-3-khazhy@google.com> From: Shakeel Butt Date: Thu, 22 Aug 2019 14:43:17 -0700 Message-ID: Subject: Re: [PATCH v2 3/3] fuse: kmemcg account fs data To: Khazhismel Kumykov Cc: miklos@szeredi.hu, linux-fsdevel , LKML 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 Thu, Aug 22, 2019 at 1:00 PM Khazhismel Kumykov wrote: > > account per-file, dentry, and inode data > > accounts the per-file reserved request, adding new > fuse_request_alloc_account() > > 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 | 4 ++-- > fs/fuse/inode.c | 3 ++- > 3 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c > index f9c59a296568..2013e1222de7 100644 > --- a/fs/fuse/dir.c > +++ b/fs/fuse/dir.c > @@ -258,7 +258,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 572d8347ebcb..ae8c8016bb8e 100644 > --- a/fs/fuse/file.c > +++ b/fs/fuse/file.c > @@ -45,12 +45,12 @@ 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->reserved_req = fuse_request_alloc(0, GFP_KERNEL); > + ff->reserved_req = fuse_request_alloc(0, GFP_KERNEL_ACCOUNT); > if (unlikely(!ff->reserved_req)) { > kfree(ff); > return NULL; > diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c > index 5afd1872b8b1..ad92e93eaddd 100644 > --- a/fs/fuse/inode.c > +++ b/fs/fuse/inode.c > @@ -76,7 +76,8 @@ struct fuse_mount_data { > > 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); > } > > static struct inode *fuse_alloc_inode(struct super_block *sb) > -- > 2.23.0.187.g17f5b7556c-goog >