Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp386352rwb; Thu, 22 Sep 2022 20:27:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Hursg64UfMElTUnYidQ8uDt8HV3h6Y6rN8E5ffml0LMIlRLf4Gd4SIb+l0VL98wG06sA9 X-Received: by 2002:a17:90a:cc9:b0:203:ab27:78c7 with SMTP id 9-20020a17090a0cc900b00203ab2778c7mr18395249pjt.123.1663903677029; Thu, 22 Sep 2022 20:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663903677; cv=none; d=google.com; s=arc-20160816; b=lYNEGNWV1n39oEmVUUUvTDuoHnLB/WmSgGqLCec0OHQW5utZldjIF3hplBT/lKZCEn 4k5yCJ0PNwsJp7boq62/vgOTOtBJZh8asIv69Lgc5MvA/X+gRs9Jar9E+M7fdCAMj+7N 6W741e1brD00wLeOxDXJiWW+nC4CQvC9FC9N6TnNrAqrnD07dPcgocjN3DzkoEnwnxvX LhTByZieWCfS2IZ+R/7xcWhuFZcluvSqAwe3sATMQucq4Dozv1G3TN+2MUUJxaZjIiAh bIUE3gMCmcUAfhCWFb5j+1tSZ+R5UEIkYfws3a3RaW2e4tddmCoVFCG4v8WhtJCheW0p mS5A== 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=15eo3E7MwIJ7aYpz1qqKm1JyfzadiMsEyongJQzuY0Y=; b=k4UFUtcu1kYPLtWAZMuhzOOSiLxpsB1tYI+RlOWmoiMFrEfte55FsIrNyt42ZibgYm 9YmVnsrklb22f8O0DO+J1QCizR+/GT/swt1n/EYhgl01fCQD9qvVKn0D6ex/uFpMinmR 3/DjL7+epbX6Rm384oEA50RV3rLSvlbIFJAI3JxTVKcjCWaFg4T4nhAmdIRNGVyq1HDG 3/UMRvcItY5MTPbh7LTNZB5cHUKahRG652E7s9NEh5t4GTq90YUUZGMBUg1UWH9W6prt BReNEaHcT9XahKT6lJgsCxWB/Rzp/Mb8J61RVdx9WCD3+TFb8LTvbM5OExZH9D2EQY80 XjDQ== 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 d6-20020a17090abf8600b0020388f845e9si1465536pjs.52.2022.09.22.20.27.45; Thu, 22 Sep 2022 20:27:57 -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 S231976AbiIWDA1 (ORCPT + 99 others); Thu, 22 Sep 2022 23:00:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbiIWDAQ (ORCPT ); Thu, 22 Sep 2022 23:00:16 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76317659F1 for ; Thu, 22 Sep 2022 20:00:12 -0700 (PDT) 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 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 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; } -- 2.25.1