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: 112903 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7440037vqr; Mon, 26 Jun 2023 05:20:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7za30Qw0Q+XSdB7OOXoPjowV42zO3npENqiECMgX/LIPEH8+x61YXKOoWWbiB2Rb1EucXQ X-Received: by 2002:a2e:9cd1:0:b0:2b4:70c1:b484 with SMTP id g17-20020a2e9cd1000000b002b470c1b484mr15823551ljj.38.1687782051859; Mon, 26 Jun 2023 05:20:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687782051; cv=none; d=google.com; s=arc-20160816; b=cIZu2NAoztOKRCrH4ezeUNma3/AgPBo5tNajRKcaIobnPVzDCJpgD3XZtkqCxMROkr Q6p8aALk1rt3fmBiJRSCavEsp0t0awx5r+bFqpR5X1qrdpoKXcNtDicN2RVWoGsA/5gC L5llR/cdST/msv/AYF68E53ZcBeC7tDuOQpzVxJZkmq1BvNV267cjgp+9jtYS9tDxT9S kpVkPo6IZidENMspILqrWm+orC7KUhevkbrsRNApZwi8A7pLhL52WS0TXFgNblzqkXEV mG6r36YN6fNM/rEhyGPdMsf0RkKT4r5o2CN/73Uayd819lMFhzp6Zo3gGbGvKFCXP1dC wqzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KgLevdxBGzScQv+PiLAjdScRKBIcEn0aEgkaWmHlSlw=; fh=FobMmrDqk0Azkn+fo26GJOi636EkoTJwUmD0cLgONUY=; b=gKnW0nrt5eLhMCAvXNqx/LC0da2xaFYMqqRULtGTuonBKy/Wpg5d+SNG6NmNJeXAQ6 Nz8yXLo2XTyyIxodW58jBfZnROpedN93WeItJkZcxIHMe0hF7FH9ALjHbaBkfwGr2gil EA/U1vOzoWwTrqxIldBrWlN86z2boZb5GqZQTKahS8QtrbQ0EoDCx7qJ+qPUItSHgSYL 9rOpGLwKe8Qj38XJ2ZxAT/8PnKZqhuA7bbo5kYOswktE798bHJCQhnc2WEZjkG7oek2E cLM7QiqDtRrnokYzPXaw4hFAeiHbUWObeUJgrr7irxAD/PTJgdvHCb3UNbM0CJj1Qm7a eYnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qx25-20020a170906fcd900b00982cac5fbb9si2747675ejb.36.2023.06.26.05.20.26; Mon, 26 Jun 2023 05:20:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbjFZMLw (ORCPT + 99 others); Mon, 26 Jun 2023 08:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbjFZMLt (ORCPT ); Mon, 26 Jun 2023 08:11:49 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A750210FB for ; Mon, 26 Jun 2023 05:11:39 -0700 (PDT) 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769767752636063507?= X-GMAIL-MSGID: =?utf-8?q?1769767752636063507?= 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); }