Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5767416ybe; Tue, 17 Sep 2019 13:10:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlRbECycX0PFmnIwva7XjhS629FzsEpFjShwW/yFZc771N0EbFwiWc1G9nCQ6AoUPs6dKV X-Received: by 2002:a17:906:139b:: with SMTP id f27mr6280426ejc.195.1568751042505; Tue, 17 Sep 2019 13:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568751042; cv=none; d=google.com; s=arc-20160816; b=hSVp6KsM6OW5aXQiS3cT1klDlhId90RLVcOX6jvJoPM2Ny33PP0wj6WaY9OmJRyy8l uwgqFnuWa9NUjO7Zlee8Jmnv7GuuDZx0OMZ6UovuRJsH8q+TG08skoqODrkzJ0r0Vdyc 0otUFjfIIeWKFOLnhiayGUCt8XUYkgk+9L7eev6rr8OiKWAzcZwTlX0z0qK5cKaXxymC ZqUUy2IX61vr6M/WhXWrOYaiUYVXOexxg904sG+g+9IUNNoS8YpiiLcUPt8ugSJ234YA G6TgjwjpReIDUAn9jqzolP2HcyuxEwtqAhBZS8qsdyxdo3Hz2t2yCXRlAdZrG0mmfJO9 k2cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=2NRtuvKbt7hoCUKdcO2DQz0SKjqBn1iBiRT69g1zRIM=; b=G0QTyjU68oEGwiLPOlY0lMCkpAzKC6mFtGAVfd19/X/msOjbuP7cd6KQw4FClVBYV4 7e+ot11SvY9BsHiad6UsS+MuwyuW7FupVYU9wydEWuhMubkv7hjKs5VOs6ZFPJRQ4JmP 53xhUgBFWx6Jv8Vez2YXD7rzfdC1uXe4AMk8xuqASyZRjIVOo2W37bzDzZx2G4ehSESx BPz3NmQPOyM6CXFMDIItNW+HGpAPHW+BxIsnboXDJ3CNwegXc2e6slBvJpQ15XuZ3oF2 iSUZd0Z964LHaQmE0UiUVpXoRh/Wy2X2vuh/wQiYjx+ZihrdPipkidGqP3GRTbdtdmcM zczA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lz74ltzi; 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 b24si1663374eje.85.2019.09.17.13.10.19; Tue, 17 Sep 2019 13:10:42 -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=lz74ltzi; 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 S1727614AbfIQTgK (ORCPT + 99 others); Tue, 17 Sep 2019 15:36:10 -0400 Received: from mail-pl1-f202.google.com ([209.85.214.202]:37901 "EHLO mail-pl1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727337AbfIQTgK (ORCPT ); Tue, 17 Sep 2019 15:36:10 -0400 Received: by mail-pl1-f202.google.com with SMTP id x5so2732180pln.5 for ; Tue, 17 Sep 2019 12:36:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=2NRtuvKbt7hoCUKdcO2DQz0SKjqBn1iBiRT69g1zRIM=; b=lz74ltziFu7N9FdWM2Wk+leFwy2lbrUMLopHSlydWLgsiEG7PXi/086swTVSMcdu5F r1nmdQsBiezhx7jBZb+kdnZp8YDjEAGrkuT+/hvcAp4MSxy7SWFBXkGGTQT9O0Ii7+Sc 4ThlfTDBVQQ0JJvS/kiOG3AJzgeQw78nnQaYieDZ7ReIyQ8+SkCI4VzHcDWJu7jTLK/5 wkAmi2Qexp0DuMjJROd05a/tqULAtaLuOelQmiYHx/vbYFg6DszOY4lrSNW2G/T3JLri Z8izXlv+5yWGFc0/9APv/DPwvXPXZbBv9IczXa6UGUhkApS6XEY+2LrYBPoFyFcexGvJ kmFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=2NRtuvKbt7hoCUKdcO2DQz0SKjqBn1iBiRT69g1zRIM=; b=NLdz97uc8ICv2kw6SAD7q09mszJgWNzyaHuyd7rgx0Q2f5RMNRLDcn4BY9dWNSc/Vc s3CJ6SKiKkutatiTsOLA8bNDGA4+NXg/T8fZUVzAiRkEyvG5KLopeGn20OxDf1ogdMNX 5ZpyBT5P3YLjEgLAAQGlHxjkNf5FMzW56uDVWq+tvwCWXG6rWk9WCmYjWv1yagYChLtm bQg8HdVgfZfsYKjzbuzu86dQtsDwUwzjcgAhJX+JcJGkgKsJNBvAVG7/LpapbeK0MG0d S4NMbQg8h2lmXInOfC+J1Hu0uA2tBpxnhNdnrs+5nB5cN8NyWbH1jhIof80X84dx4Ngm DrGw== X-Gm-Message-State: APjAAAXIFB9oA2JqMQrLCdbSfK4M0dQUfeLoqmZ01B5rtMj9sFmwZ2Gj rm1biFoAJvwB92c2Q+owE1SY0z+pEMg= X-Received: by 2002:a65:6901:: with SMTP id s1mr472083pgq.338.1568748967798; Tue, 17 Sep 2019 12:36:07 -0700 (PDT) Date: Tue, 17 Sep 2019 12:35:33 -0700 In-Reply-To: Message-Id: <20190917193533.34984-1-khazhy@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.23.0.237.gc6a4ce50a0-goog Subject: [PATCH v4] fuse: kmemcg account fs data From: Khazhismel Kumykov To: miklos@szeredi.hu Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, shakeelb@google.com, Khazhismel Kumykov 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 account per-file, dentry, and inode data blockdev/superblock and temporary per-request data was left alone, as this usually isn't accounted Reviewed-by: Shakeel Butt Signed-off-by: Khazhismel Kumykov --- fs/fuse/dir.c | 3 ++- fs/fuse/file.c | 5 +++-- fs/fuse/inode.c | 2 +- 3 files changed, 6 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 8c7578b95d2c..0f0225686aee 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..e040e2a2b621 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -66,7 +66,7 @@ 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); } static struct inode *fuse_alloc_inode(struct super_block *sb) -- 2.23.0.237.gc6a4ce50a0-goog