From patchwork Fri Sep 23 03:33:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 12986087 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 2E4B4C54EE9 for ; Fri, 23 Sep 2022 03:00:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5350080009; Thu, 22 Sep 2022 23:00:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 225658000F; Thu, 22 Sep 2022 23:00:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF82E8000D; Thu, 22 Sep 2022 23:00:16 -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 972C78000E for ; Thu, 22 Sep 2022 23:00:16 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 70245A077B for ; Fri, 23 Sep 2022 03:00:16 +0000 (UTC) X-FDA: 79941846432.19.3DBAC8E Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf06.hostedemail.com (Postfix) with ESMTP id DFE6D18000A for ; Fri, 23 Sep 2022 03:00:14 +0000 (UTC) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MYcK26cDgzHqHF; Fri, 23 Sep 2022 10:57:58 +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; Fri, 23 Sep 2022 11:00:10 +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; Fri, 23 Sep 2022 11:00:09 +0800 From: Liu Shixin To: Andrew Morton , David Hildenbrand , Waiman Long , Zefan Li , Christoph Lameter CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH v4 2/8] fs/proc/kcore.c: use hotplug_memory_notifier() directly Date: Fri, 23 Sep 2022 11:33:41 +0800 Message-ID: <20220923033347.3935160-3-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220923033347.3935160-1-liushixin2@huawei.com> References: <20220923033347.3935160-1-liushixin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; spf=pass (imf06.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663902015; a=rsa-sha256; cv=none; b=JSRiFgGTSr0fvzzdsI8UBKv35wVkyiqZa05eWqG6sMkkE3IU3iIR6W33WANqnl3uOmlbUa TxaBPjcMbaQE10tMC/Viqzzrjj4WrGQZ/ubk0WWF+mk4RpTCRf5UWxONXYJ7X8e2uzWjs2 bfiV087Fmk7LanlRWnmZMonoegessLw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663902015; 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=15eo3E7MwIJ7aYpz1qqKm1JyfzadiMsEyongJQzuY0Y=; b=K+9F9tXn44/piUuhgFIwY1Wue5V9HzidmPXx8japu2UGWr1zAJQSyc9lIbvCOHdGdaqlo5 HPWKYink4sMO9oVIkm+mcbg3ly0/yhivwWHRZh/hICDcsdbABIQlgIiGpvT05bvCBI9sRB ParUii7t7PpN3fa7E4O7BAVXtzH9yvU= Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.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-Rspam-User: X-Stat-Signature: 1f4pp5m537o5apaocoq7tbruxiuw9qhp X-Rspamd-Queue-Id: DFE6D18000A X-Rspamd-Server: rspam09 X-HE-Tag: 1663902014-885806 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 Reviewed-by: David Hildenbrand --- fs/proc/kcore.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index dff921f7ca33..7692a360972d 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -638,10 +637,6 @@ static int __meminit kcore_callback(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block kcore_callback_nb __meminitdata = { - .notifier_call = kcore_callback, - .priority = 0, -}; static struct kcore_list kcore_vmalloc; @@ -694,7 +689,7 @@ static int __init proc_kcore_init(void) add_modules_range(); /* Store direct-map area from physical memory map */ kcore_update_ram(); - register_hotmemory_notifier(&kcore_callback_nb); + hotplug_memory_notifier(kcore_callback, 0); return 0; }