From patchwork Thu Sep 22 14:18:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 12985138 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 6A82FC54EE9 for ; Thu, 22 Sep 2022 13:45:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4DF666B0072; Thu, 22 Sep 2022 09:45:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 42CC36B0073; Thu, 22 Sep 2022 09:45:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D287580009; Thu, 22 Sep 2022 09:45:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B622E6B0073 for ; Thu, 22 Sep 2022 09:45:23 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 7B92F8095B for ; Thu, 22 Sep 2022 13:45:23 +0000 (UTC) X-FDA: 79939843326.26.08DB3FD Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf28.hostedemail.com (Postfix) with ESMTP id B4D01C0021 for ; Thu, 22 Sep 2022 13:45:22 +0000 (UTC) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MYGgw6yTFzHqKS; Thu, 22 Sep 2022 21:43:08 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 21:45:19 +0800 Received: from huawei.com (10.175.113.32) by dggpemm100009.china.huawei.com (7.185.36.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 21:45:19 +0800 From: Liu Shixin To: Andrew Morton , David Hildenbrand , Waiman Long , Zefan Li , Christoph Lameter CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH v3 3/8] mm/slub.c: use hotplug_memory_notifier() directly Date: Thu, 22 Sep 2022 22:18:59 +0800 Message-ID: <20220922141904.3245505-4-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922141904.3245505-1-liushixin2@huawei.com> References: <20220922141904.3245505-1-liushixin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663854323; a=rsa-sha256; cv=none; b=LgL40PJdEWODKRUMk7TFS3162LXpy5DEjNRmw4ClO8wGU5tbDihQu2BxIFoazXdnxoKoBC 8+q+ZSXyaJTAzhld8r5Z0hkbYAV1yU2x4jkKP7afHPWHLRC2esWouXxdHXMj0SUzPzmfDq A4MW9uR+D04PfBjne7KDVuKD/9BrgDQ= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=liushixin2@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=1663854322; 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:in-reply-to:references:references; bh=ywdK4ChRbZlec/Wxw45KygCvRkJ7281y7JwiJ2QmKMw=; b=hc/qHNNnm4DGs0G6axnraSPM6Va0NgFannDEoWLJKsimOsRuqfnkqT33eod7GSNXyIwFkV rs6qp8cc1Ruy7lAt/ZI5KVNmEw4f+2QouHju8jxeGGD8TDWnfNLytGRFwqAxJX7PD640QL zXIDRTrXaNli2fXF1JE3Vao6BDdv128= X-Stat-Signature: e9b63i99tf8rg4ipos6dkdsfu9pc57ua X-Rspamd-Queue-Id: B4D01C0021 X-Rspam-User: X-Rspamd-Server: rspam11 Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=liushixin2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1663854322-537631 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: Since patch 316346243be6 has already updated the minimum gcc version to 5.1. The previous problem mentioned in patch f02c69680088 is not existed. So we can now revert to use hotplug_memory_notifier() directly rather than register_hotmemory_notifier(). Signed-off-by: Liu Shixin --- mm/slub.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 234bf0e44262..9a0853e01fd7 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -4698,11 +4698,6 @@ static int slab_memory_callback(struct notifier_block *self, return ret; } -static struct notifier_block slab_memory_callback_nb = { - .notifier_call = slab_memory_callback, - .priority = SLAB_CALLBACK_PRI, -}; - /******************************************************************** * Basic setup of slabs *******************************************************************/ @@ -4768,7 +4763,7 @@ void __init kmem_cache_init(void) create_boot_cache(kmem_cache_node, "kmem_cache_node", sizeof(struct kmem_cache_node), SLAB_HWCACHE_ALIGN, 0, 0); - register_hotmemory_notifier(&slab_memory_callback_nb); + hotplug_memory_notifier(slab_memory_callback, SLAB_CALLBACK_PRI); /* Able to allocate the per node structures */ slab_state = PARTIAL;