From patchwork Tue Sep 20 02:51:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 12981227 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 F2F2CC6FA92 for ; Tue, 20 Sep 2022 02:17:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7ED518000A; Mon, 19 Sep 2022 22:17:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 46BCC80008; Mon, 19 Sep 2022 22:17:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2723180007; Mon, 19 Sep 2022 22:17:55 -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 EC26A80007 for ; Mon, 19 Sep 2022 22:17:54 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B4D3B12041A for ; Tue, 20 Sep 2022 02:17:54 +0000 (UTC) X-FDA: 79930853268.20.A9661AE Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf14.hostedemail.com (Postfix) with ESMTP id 2EE83100008 for ; Tue, 20 Sep 2022 02:17:53 +0000 (UTC) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MWlTN459Nz14Qgh; Tue, 20 Sep 2022 10:13:44 +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; Tue, 20 Sep 2022 10:17:49 +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; Tue, 20 Sep 2022 10:17:49 +0800 From: Liu Shixin To: Andrew Morton , Zefan Li , Waiman Long , "Christoph Lameter" CC: , Liu Shixin , Kefeng Wang Subject: [PATCH v2 2/9] fs/proc/kcore.c: use hotplug_memory_notifier() directly Date: Tue, 20 Sep 2022 10:51:16 +0800 Message-ID: <20220920025123.2868953-3-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220920025123.2868953-1-liushixin2@huawei.com> References: <20220920025123.2868953-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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663640274; a=rsa-sha256; cv=none; b=QUXjkkvem/1G8qS1vGGy8NQT07ezyvNPjawYo4C51QRIfTs9uq0nsZOGdgjoEbSNZgTqx6 qCXffjHKh/+fPvLY+tj3d5V/oaem9HnfGDjypOlogKlM0snhskEdK1IqqBzNAKLPVA7Cd+ OlxIrMyT6qcreu5UrDOA4ql+y2enNUE= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.255 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=1663640274; 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=YwRnsJebqaeunJOctLjSVBm3x6gJiujgEAAtUoZ/ZXs=; b=dks0FhZWbMRcg8tD35fOQiwz/PXMHEoZ5B9GuvYhZiXUBwpZTRfOokBXUHN4EcFcs6qIj3 Vevz481ZgYOiMw2Udzb6rXa9Qh0laRrj5jPIrPEx7gT+GBwmf9YSRn1TJoGMd54clogIH8 MqCWPK94FEKr+JyncCo2tsFtKEVMRZc= X-Rspamd-Server: rspam06 X-Rspam-User: X-Stat-Signature: bmx671g8ycek53tufx74cnkt1k6y5iuk X-Rspamd-Queue-Id: 2EE83100008 Authentication-Results: imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=liushixin2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1663640273-115684 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; }