From patchwork Sat Aug 19 08:13:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lu Jialin X-Patchwork-Id: 13358520 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD1BAEE49AA for ; Sat, 19 Aug 2023 08:14:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E7CE4900006; Sat, 19 Aug 2023 04:14:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E2C84900004; Sat, 19 Aug 2023 04:14:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1AFE900006; Sat, 19 Aug 2023 04:14:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C21FA900004 for ; Sat, 19 Aug 2023 04:14:12 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 411121A0B50 for ; Sat, 19 Aug 2023 08:14:12 +0000 (UTC) X-FDA: 81140141544.10.D92756D Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf12.hostedemail.com (Postfix) with ESMTP id DFD0140003 for ; Sat, 19 Aug 2023 08:14:09 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of lujialin4@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=lujialin4@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692432850; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=FYmhOQdgrGvUyUwkNqyUUS0khPx8+9BCsaBobBq+zes=; b=RLcnqCzg3V/uEZ3QS5+T07VQUpn0fxh7dwW39m0C7PeGQWNWlosCmpHDUjnrzPe/KBSJ8L pe9pG/KgvuAzGookSiAp1hhfZPHcT81pj4ENhmboe+7DR/RIK1FXvz/mjuV54xD5XlZEEH NQswRcxJMVjbogWMwLelRcvxqfYjg3U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692432850; a=rsa-sha256; cv=none; b=cw19kbAZ2hyyRtie3qVWWQPmf59dxslP3F2YbRJkOHHwoC40ZRq1+XlQ/dZHSjDICM+MJJ mb7ffR8g7VR/qa1lpz0sCjpWqeZ9AGMglsMJSiIBYQ/C6LPc4Or2H1PDOPoaSVzlzP3wHF 42pyC31RR97iek4mbGWuO+B+P2j75ls= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of lujialin4@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=lujialin4@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RSWfz1tktzVkCV; Sat, 19 Aug 2023 16:11:55 +0800 (CST) Received: from hulk-vt.huawei.com (10.67.174.118) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Sat, 19 Aug 2023 16:14:04 +0800 From: Lu Jialin To: Johannes Weiner , Andrew Morton , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song CC: Lu Jialin , , Subject: [PATCH] memcg: Removed duplication detection for mem_cgroup_uncharge_swap Date: Sat, 19 Aug 2023 08:13:02 +0000 Message-ID: <20230819081302.1217098-1-lujialin4@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.118] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: DFD0140003 X-Rspam-User: X-Stat-Signature: k1fby513nkw3s8gaqdi7dmsigz49xaji X-Rspamd-Server: rspam03 X-HE-Tag: 1692432849-628186 X-HE-Meta: U2FsdGVkX19NE1AqN2FKW2DWL+YxXoE+SHD38SZDMY72p3CC0O7Ip7gBlJsbbhoO2bPRZIFg6wskf9pRiwEKSSTmnUenWAzKLbh63jMQxYJslkvmNOGYGmHc+QFaqLRv/1jLTt3CBgLwQ6cPRE2u5RorZ2Z0CyVSbPYyKl1jay5MVOSlUyZxcLTrR0HwKQWWV2vXJSfZJzRTOD3HYZttpBDuonzD56GDlGIv8DAvTuT1RapGxHgAH1KbhFvVg/WhtHLM97S5mMiXYO8S5gsF6C8irY2xQcQs/XHH3HjImFZ0ez6q9rnrvxaRVPZ1tb8GJrIyiqZnr5KP25ORKt9sEX1TBzuK9YRzwwvkze9CmPtlHQVhx8GCpJctWGO7TbnWdIuErVne2JW0/fY9dX9eNMeWrCktVLLPiAb9MsKfQiUuH9pqIf0pn3Xlo4QGvxSwC9+l36XdgmeKMnMP1phRzaPJQepxt7hLeDtjrC3AHwDuHijuiqPtZmUq1ta8xLDWr250U3MPWtaa0BXHyp+WX+MkOrcXCZV2VHe193328XRrHCLMWF1oXGz23i+Dx2z+5GJCsYNZgOD+kkzfKv3EaXIQ/zVDAZO9oYu43TrQg8HVW/82VLV7tg5rM4O5WZfQxMf4KKQ+soojulDoBVRkRb7UJH3TQCrM1DY2nSJoxT1LaEHcpdys4Y9fl6iR4wVwFMgfvkjtFEO3HvI8IVl7vR44frfXJGPrrUN9HQ1my9RBQqsqjzHw+yAJeWIEX2BRokbK8t8A/S+YpVvw924otEhwthYb3Q8C32w2ru13AVjawFi7DYyykRAkX9/9L0m8Y4TQK5bMJAACIWiWh/DNpQsZIypc0ukvwrytAVawvA9qo0cAKangUN1UeDjbKfU4OJYXPSCSQnFDDtOpQfeBRv5pG4NweiPvgemmnIONcoZB/cmmDZSH4QGosz1JEFGAukT6xjH1UfD4EAiShuJ DXzMPRXH BHDNNvkOnUcVOF+JNlYRyvV3hmgih51RbtUFuxADPbp8AGMLFHzIUtElKrvn3xFUdEf86KpOy09nZwrobJD1yVvl6eYR3q/J+wL5dslvbKujlZB2vwZvSwaNK2KCMwoeVpX3vQLgnGSivzi/szk0OANrGsgfwfYzEgUzxw21yK1RKTwpeeuAS002pD/tqzmg/Fifc X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: __mem_cgroup_uncharge_swap is only called in mem_cgroup_uncharge_swap, if mem cgroup is disabled, __mem_cgroup_uncharge_swap cannot be called. Therefore, there is no need to judge whether mem_cgroup is disabled or not. Signed-off-by: Lu Jialin Acked-by: Shakeel Butt --- mm/memcontrol.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e8ca4bdcb03c..274af096c748 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -7535,9 +7535,6 @@ void __mem_cgroup_uncharge_swap(swp_entry_t entry, unsigned int nr_pages) struct mem_cgroup *memcg; unsigned short id; - if (mem_cgroup_disabled()) - return; - id = swap_cgroup_record(entry, 0, nr_pages); rcu_read_lock(); memcg = mem_cgroup_from_id(id);