Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp827422rwb; Thu, 22 Sep 2022 06:58:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6RYXHVccqAOsHxgU3wnWghPzU7Q5fFsC4xVbdGaNYqBGUH0NmFGJVsZ1FjceXaFj+t/unr X-Received: by 2002:a05:6402:1f0e:b0:453:a419:b3a0 with SMTP id b14-20020a0564021f0e00b00453a419b3a0mr3448953edb.124.1663855124971; Thu, 22 Sep 2022 06:58:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663855124; cv=none; d=google.com; s=arc-20160816; b=NrFstHtHoOI9RDPHYcmKpoxwMV1B7ypWCRTy39t96F0Ws3xbsxV8FfvpvZ76/tbUYY MIWB/xlRAWnBTkncu2nsuxEYyvarVHE8Bb/ytw2artrWMF9HZdtdbfbV2YxXeGEP2IlG DDahh19QT+8D7HbXCsL4kV6M+fTG3aclNaHuxoyX0xQLqXujxcIe7iYeFzscLz/yE78f WWmZelMmcnyPppOC7ltWa/WpaBUMIA3SGAda6lhHVpW7q3x0fa6aA4QU9s7uSzhFRuJm hrs81B9T425byFHGfrbYzbgOuLKfZeZ2vNzP8w64/i9z2boz0y+Hrgyq/LhjKdMSR8hp 0CRg== 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=D6u3G098eFAUWdJDWwGsqCtHKIgZ4BsBp5feAZXm47xqDGcMk2ikSuIEyZfnezqioh x0oKjhWYUtWvx/3b0gbvr8zmaryAolh8HHfUnTT1dAKUiohw8YTZ6/bM34J0oMpVG8Id dT+LKWSUmhIIPM92lhlEJxN8EuWVjuySpW/d8JbqAYAA+cQlm6AZAHHJAhjbkWuh/c+o 4iRJdnROdLduutDcuvmMDnRfPMXc5aI19mqxCKhhZ7ETazg2wENDi84JPXHopq0p+Evr ZHxYkyD5Kkbqd4TVg6CmooKAlPONhEK21bqIgct+5GDAMWhsZpJufySZtd/fpMuTAq/p XTJg== 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 h4-20020a0564020e0400b0045167ff0f25si5378542edh.483.2022.09.22.06.58.14; Thu, 22 Sep 2022 06:58:44 -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 S231621AbiIVNph (ORCPT + 99 others); Thu, 22 Sep 2022 09:45:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231204AbiIVNpV (ORCPT ); Thu, 22 Sep 2022 09:45:21 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 104B43D58D for ; Thu, 22 Sep 2022 06:45:21 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MYGd03bb4zMp4g; Thu, 22 Sep 2022 21:40:36 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500024.china.huawei.com (7.185.36.203) 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:18 +0800 From: Liu Shixin To: Andrew Morton , David Hildenbrand , Waiman Long , Zefan Li , Christoph Lameter CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH v3 2/8] fs/proc/kcore.c: use hotplug_memory_notifier() directly Date: Thu, 22 Sep 2022 22:18:58 +0800 Message-ID: <20220922141904.3245505-3-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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 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