Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2207437rwb; Mon, 19 Sep 2022 01:03:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4vQA+VxHTXsAsbmRQ6B2E+2Sm8HVqPf+x8os6TDvFaiXMhphexQXihul3dSBnyCFPyNC3w X-Received: by 2002:a17:902:e801:b0:178:11e9:2ba2 with SMTP id u1-20020a170902e80100b0017811e92ba2mr11323276plg.26.1663574626465; Mon, 19 Sep 2022 01:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663574626; cv=none; d=google.com; s=arc-20160816; b=M78N5wK0bFAu8mpHX53kfFw3CCmBtxzZ8xWl69BqTo3N6AjlcASL9Mhgmsm4tAm8TT CTYhD2BWPMLEiQXDRvhCtVa4IsWi7S/VK153mbmkACe8Gl0YuyDbYeXV54+By3WqeX1u QVc4v0Y/aSisRZcXx2eql1qu+1j2Vk2ZR47QF5qpHvkQxxkgEEzy3Zpj7l/OUIT+Gkao ke65oMbFmZdY2Hb6088y7uHzQ2k6HByqNBeJ5ANgg91CpiqYlebvJqDEgA+QFZCFjDJJ j/5XHgMT7e5JrOmfdLMLVn4fOwI2CDd+qozyYoT8Y78kQx7GkkmfAwhDwSxi96lv7jfB 9TvQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=YwRnsJebqaeunJOctLjSVBm3x6gJiujgEAAtUoZ/ZXs=; b=y20Rx0ds1Xt+f0OqjWZiQ1mOSKFbGro0OiqHVZSmc6A8NAIttOAYJKEem7+c2ZNvDX msOW2EdHtRjGV0ovd7S93UDMzkIDnvXUhjTQi7syy8yciIIIE3OH0UdY9Phi9lzPnO+A n710LFtS8Zz0BYTWxe4tgHU/xNGTVZwigBaPky9maP/w1Qaj+5GdmmgWz70Oz9et5cuZ gUFcC6iS8fWdFY03NrvwK8WqS1IObiNbYVUiAKfdQjkF1Gdc/lT7bar4VBPTaljeCwW+ 0krdoGRV+Yt7sYnB4GhvOthsWKEnnPR0UWj6vxUUoa/cMWwMwayvQW+giiRewWVVwUrW kwVA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r8-20020a635148000000b0042bba5a062csi8971397pgl.280.2022.09.19.01.03.34; Mon, 19 Sep 2022 01:03:46 -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 S229997AbiISH61 (ORCPT + 99 others); Mon, 19 Sep 2022 03:58:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229931AbiISH6L (ORCPT ); Mon, 19 Sep 2022 03:58:11 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 997FB1EEF7 for ; Mon, 19 Sep 2022 00:58:10 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MWH4W3hWCzVfhv; Mon, 19 Sep 2022 15:54:03 +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; Mon, 19 Sep 2022 15:58:07 +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; Mon, 19 Sep 2022 15:58:07 +0800 From: Liu Shixin To: Andrew Morton CC: , Liu Shixin , "Kefeng Wang" Subject: [PATCH 2/9] fs/proc/kcore.c: use hotplug_memory_notifier() directly Date: Mon, 19 Sep 2022 16:31:45 +0800 Message-ID: <20220919083152.1824305-3-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220919083152.1824305-1-liushixin2@huawei.com> References: <20220919083152.1824305-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm100009.china.huawei.com (7.185.36.113) 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 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 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 --- 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; } -- 2.25.1