Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp207212rdb; Fri, 5 Jan 2024 07:22:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IGD7GFRQ37u/qgg8xkdWNHSfHZNRlpQFI6IIpC1M3r7w9owadZs3ScPcy+JG79dBh0NXGFc X-Received: by 2002:a05:6808:e82:b0:3bc:7b:4e1f with SMTP id k2-20020a0568080e8200b003bc007b4e1fmr2365758oil.92.1704468156489; Fri, 05 Jan 2024 07:22:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704468156; cv=none; d=google.com; s=arc-20160816; b=ALQjcAh+f7/8WIwiPf69Is1f1d7IifMDPntoQfllLE/o1F7c07WyHGMn3CNZOvpX+H 8yn2xwvUYRzts+++Xxv0qgaxvLVA3L1XDCc/XxjqZhQQW/IicUXqPe2uZCF+sAo8Jfo3 7cYN64DRGq1ZLP0peCMX7ph1TRj0g51OTv3CHGZK3rQHIDZgdhZXbyxTJq8aHhuT3X3g L1bdw47zFILVos6QHFe4A4t4D6EfVXaCBWNstsCMJj2U76qqpNEZtG5vkZnvxFWX6hYS gc1JjimhINEJfkMjsCz08GYvGYRzsLoHwmcPGWACadWKsnhdoHK/LKXh2idZzgDT4NoJ 9PCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=lY3Wm0rqUAhsDJUxSGP7DuG2vuWegRTpE6t0VrqtHps=; fh=M4lKxbx7t4+v8w8mr3dCDGJLS5GyU9pIAnhNR3sOycQ=; b=Qcmheoqus70SfOowJIrsnHlDyIYQrqF9951nMj+cNX4YQrSTlkxGhaN1sUAlkKM/hz vda42N6YPvxalAF4V5KJg94PUoZkUE8PRPYJ8/6szQzs70Wn8L/zEU3b5GmJjBkII6xW 43WhQn8xBWXfaQgAF2Ct9jMn7wO0wpZNmJQX85HnD94lMQTdAQDHsMDaADcCLgKEvOI2 TSAV7x99mfaPEpgNNa7BP0KSChW6i4M37slzPoJHci5UMpMAMxXsPmLAcuimY6uFC1q0 l2+Gqj3DmWRGSrSS7ZuqfXCbO2d/OknEl6qYgKvOl3U89W/UpS/YT/Gq4UdCNx80jaOz uoPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b="jeLTI0B/"; spf=pass (google.com: domain of linux-kernel+bounces-17990-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a13-20020a0ce34d000000b0067f41a37e60si1881880qvm.610.2024.01.05.07.22.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 07:22:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17990-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b="jeLTI0B/"; spf=pass (google.com: domain of linux-kernel+bounces-17990-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3BE1E1C21419 for ; Fri, 5 Jan 2024 15:22:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7252B31725; Fri, 5 Jan 2024 15:22:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="jeLTI0B/" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DDE62E849 for ; Fri, 5 Jan 2024 15:21:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=canonical.com Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id A75683F154 for ; Fri, 5 Jan 2024 15:21:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1704468118; bh=lY3Wm0rqUAhsDJUxSGP7DuG2vuWegRTpE6t0VrqtHps=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jeLTI0B/iGD4kYv1X6OzcLyIqcUp9pAx63SDlbSVBTrPjzAMsGIMXLWcuk5rdBm81 XOmLAGFOynjdiHiWnc4yUjZsGXM5xsGwx+qhd6heNdbSlAiUO6ULewRMlwvcKd1MuJ gCkOMqg3pnnXgZrSA71kRR1um5A1qpJD8azBFvBGDKpnNx/6fBClFWSzlffVMeBiu7 gYG/OqLeEEmDZDx5L5DXMa2e+viiujjU/7296/n3KgKeCJ4NKj9Yfpog0HtU+6K6oY Lk3d8/8f0sQJtgeYlp1wqYVxCM+OOwK9++JWj+8uFFwcq1r6AfgEAum0M5QoJYUbyL 4sY7XEAIxvByw== Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a2336591d48so72624866b.3 for ; Fri, 05 Jan 2024 07:21:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704468116; x=1705072916; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lY3Wm0rqUAhsDJUxSGP7DuG2vuWegRTpE6t0VrqtHps=; b=YDeDMNX7vhnc+IdV7GaJKazm/gkEqfI/RcWEPWAM6XlUHewL+LsZ2/i1uLOknmUO5m bLvx31K1QYniWjALqC9kH50ZhaK3ioHWwjLplaRHYCDoLwHMMsQQv/6Jlc51Mi69SD6f R7ZVyv654nCVwzHaiVnMEj0M5rbrZPmOLcu/Agt2TAkuP1nRknwWgLjaS0UYMY2GU42k m/vmng+Gm6/dOhU7VnnBzizb7O1obxckgVjwlnyeUhC/ALdcfAVIySxirAl04GEzaRtz lkG3nOWLRmxZqEwUqoOXNukXYEBs+jXPWKTiYWIk/474hHOqYrlQsrtXDXZSmos/LqHQ 2hjA== X-Gm-Message-State: AOJu0Yw+XhD7ZyHvD2bXAZ/5kHU/jdxySFht0JsOXsGJ7BGf4NxUKmr/ arBYLV04jmEh0bFQTnjMaXikL88Y/2bP77284Bp+C2zsSmT+X11u3+J57Kp3vyvHD0uEYaM3b1x MV8khPfE4dn94L5I9aevTFiHXfkJZfkY8gss1h5aWU659xT4o X-Received: by 2002:a17:906:270b:b0:a28:e451:b023 with SMTP id z11-20020a170906270b00b00a28e451b023mr1093669ejc.145.1704468116335; Fri, 05 Jan 2024 07:21:56 -0800 (PST) X-Received: by 2002:a17:906:270b:b0:a28:e451:b023 with SMTP id z11-20020a170906270b00b00a28e451b023mr1093664ejc.145.1704468116100; Fri, 05 Jan 2024 07:21:56 -0800 (PST) Received: from amikhalitsyn.lan ([91.64.72.41]) by smtp.gmail.com with ESMTPSA id i23-20020a170906115700b00a298adde5a1sm345630eja.189.2024.01.05.07.21.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 07:21:55 -0800 (PST) From: Alexander Mikhalitsyn To: mszeredi@redhat.com Cc: Alexander Mikhalitsyn , Miklos Szeredi , Amir Goldstein , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 2/3] fuse: use GFP_KERNEL_ACCOUNT for allocations in fuse_dev_alloc Date: Fri, 5 Jan 2024 16:21:28 +0100 Message-Id: <20240105152129.196824-3-aleksandr.mikhalitsyn@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240105152129.196824-1-aleksandr.mikhalitsyn@canonical.com> References: <20240105152129.196824-1-aleksandr.mikhalitsyn@canonical.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit fuse_dev_alloc() is called from the process context and it makes sense to properly account allocated memory to the kmemcg as these allocations are for long living objects. Cc: Miklos Szeredi Cc: Amir Goldstein Cc: Cc: Signed-off-by: Alexander Mikhalitsyn --- fs/fuse/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 2a6d44f91729..b8636b5e79dc 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -1415,11 +1415,11 @@ struct fuse_dev *fuse_dev_alloc(void) struct fuse_dev *fud; struct list_head *pq; - fud = kzalloc(sizeof(struct fuse_dev), GFP_KERNEL); + fud = kzalloc(sizeof(struct fuse_dev), GFP_KERNEL_ACCOUNT); if (!fud) return NULL; - pq = kcalloc(FUSE_PQ_HASH_SIZE, sizeof(struct list_head), GFP_KERNEL); + pq = kcalloc(FUSE_PQ_HASH_SIZE, sizeof(struct list_head), GFP_KERNEL_ACCOUNT); if (!pq) { kfree(fud); return NULL; -- 2.34.1