From patchwork Mon Jun 26 12:10:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13292805 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 4231AEB64D7 for ; Mon, 26 Jun 2023 12:11:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A23468E0011; Mon, 26 Jun 2023 08:11:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9AC888E0006; Mon, 26 Jun 2023 08:11:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84CEA8E0011; Mon, 26 Jun 2023 08:11:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 72F0B8E0006 for ; Mon, 26 Jun 2023 08:11:46 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3A72CAFE0F for ; Mon, 26 Jun 2023 12:11:46 +0000 (UTC) X-FDA: 80944785012.07.9B052CF Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf01.hostedemail.com (Postfix) with ESMTP id 597D040014 for ; Mon, 26 Jun 2023 12:11:41 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@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=1687781504; 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=KgLevdxBGzScQv+PiLAjdScRKBIcEn0aEgkaWmHlSlw=; b=VLoihvxo8ZUj0e6QZE+EXU8zC5awfEoU7FJHKDg11Kut7JDj/jfVncjpg+7JRxXwtMwqPN FoAOpAZcvOeYX+IqSsdNdMlPXI1rtLhUBp5dZnHFw7i3UptpSlL/saI8oE612OKhL8edca XVSKb89ur/79BdfLzSjZQcvYnyLVGm8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687781504; a=rsa-sha256; cv=none; b=S5RvIl28NfAnn8YIINgadrWmp2B8rxpkaNRiaWCNmW2coO0mcvn086PA0CCA3zXkpOmDBC llKc+FTwx+5qWfO355iCojyKlxOGQPX/G7NdLJlyrzY5R1oynt+AlqrQ3FcVYXj3BCMO4i k4zy70Fyfl2q72tnmGB9c19EqtJ/aVo= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4QqRV56mhMzLmvS; Mon, 26 Jun 2023 20:09:33 +0800 (CST) Received: from huawei.com (10.175.104.170) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 26 Jun 2023 20:11:36 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH] memory tier: Use helper function destroy_memory_type() Date: Mon, 26 Jun 2023 20:10:53 +0800 Message-ID: <20230626121053.1916447-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.104.170] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Stat-Signature: ftdgz6qb44bznmbfhdmi6hqa5uazz84q X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 597D040014 X-Rspam-User: X-HE-Tag: 1687781501-36048 X-HE-Meta: U2FsdGVkX185E8SgLA2jx1n8/O2gtyeKWZ977Rk2h1utoO+EVIkXCS1V1QmKU8pMzXEBj7MIGRdd3S0wFIPW4lgVyx33iZl7ydFtYyuUbmMvNKOdaOo9qi40/HQsc8jHZp0F2hHU1LUZl4GgtLXfhhJbWiH89N/hNRxdBMRk7/GtmbKT0LyIdBe+2djB8ino03QOKAR3B8dy8LMYOUo7fdsCdUpbmqzdoauCzl2FDJ6HT46YFISEUycbBQa+pgwZfOrxQv0nYP3OzFc9n/FRMrLoQJgcOxRuaElfBq37CDg0oGHLmCdubMQlwUpyhR8Nt9sBCeRXdhZbm0mBfZB/QoG6HBBovh56ESZp5cBFAEZTNOL/cq9yz+NQE5qdKqfKDcHR2XzJXHKNv1B0zyu5/2k/sdit3SVWPCQdi0U65ORXyrVmgBA3AvHiqlwEz99Aa87xydlvHQGY7zHTGnxb8g10TKC2BwNrIxt1a2rN+xj8PQHtEpstKxf7HuK1hHIOcP/aqk/jeyvjaS4J3aVAaJi1vk5kBv8n/CY1SjxgAUqe+hf+1zryEN0nwHjqsHIUCtXld/1vPyIuTbpUFTXWbqE2MYldonWdfNchUZhi4S9t1E4GpgSzkW8HhzyD7PvnOjVzbOaGlBuPF613O7uSeA+7X0u3MEasl4Sb96R/R1VOfa+PhtWQwtDZ8TSGpCuz1uPMDgw7JxneC33KidBlaeG9x7bjXAnYGjVr7bWBYa5CqwbAK2t6zWDmN809H64iZQG4IcnDyM1yYsxlGQhgbGXHg4XA1CTQhE53ssbzJooWrWiXn4ACrF6hMEb5mfYiN4x1R6EfuOHX+eN0EbeDtlO5t8odjjJBfkqD8IVqDBPofjcJazYsov28xXzT5xsnhx89XS6ssqB8xoXsmmLwXdkL2ZlEz11yvJv03ppnsJ7Jo6kkNdMinM6F09MCMif5YLZLzAMFrxED/kKgelm weNFgeXQ MykOvlY+mvgftHAqIk+9YLG3zMF0WI7CFQIRp6fduDTKLqVnCYJZnA8pnemJYPp4WvdZF/TgavsogZknmGZGvgAfKFsvUmpdzbaR8ay1ySTOzKQmvQKEpr85aMaIqei3cW4Wh1j2zEiXjf+XVjBtyCCyNz1N791cWZUzb+bttXPdcTgZ93i2SuvYdWqHG5usXBZu1 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: Use helper function destroy_memory_type() to release memtype instead of open code it to help improve code readability a bit. No functional change intended. Signed-off-by: Miaohe Lin --- mm/memory-tiers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c index e593e56e530b..0b8b76078c12 100644 --- a/mm/memory-tiers.c +++ b/mm/memory-tiers.c @@ -587,7 +587,7 @@ void clear_node_memory_type(int node, struct memory_dev_type *memtype) */ if (!node_memory_types[node].map_count) { node_memory_types[node].memtype = NULL; - kref_put(&memtype->kref, release_memtype); + destroy_memory_type(memtype); } mutex_unlock(&memory_tier_lock); }