Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp379075rwb; Thu, 22 Sep 2022 20:17:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QmlpB/ex4B+bvpFV+MFEQ6AgshitlicV9aG3TBMRSo0G3nkTHJsF/2Id1TAy6g1+73lLe X-Received: by 2002:a63:4d0d:0:b0:43a:eb08:6eaa with SMTP id a13-20020a634d0d000000b0043aeb086eaamr5868158pgb.590.1663903070169; Thu, 22 Sep 2022 20:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663903070; cv=none; d=google.com; s=arc-20160816; b=u4wLit0vrhw51I6d5nsO9NyCVwxHT458kcvGGzHtSdwG7gjXPx6374mqQTQ6YcbJDt NTWiNfOfXeBuWRYgUCRLAB0JzVXfDVTnB6F7wZctYAFVPEr+1Q+iEyovLJv5S23btRv8 j0b0C0K/gb6FJm2q2VadIwhtdf3TVFbYxkTbXdazvYYxrHWNCgq7xoHQWsxDpIa6QTVI ioc8CS4vbu7nvgAaW1dLS+5VzQI2vIPiZcKdEKt/pfJydWbOXp7SF7/F/0ytntmOjjr1 yuh9L1FWpIsuN9HnWHHutK5jwhtPLHnScVr2soFe6zuUuJJ+3XXbCZ3BdFUXPMlw9TSC IdXg== 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=B40jSThi3VGie/1WH+9iV/2iHA0O9bI24IqYiqnK4Gs=; b=eFvSIQEWGbU00DKgCv3BfZPE2ufz5zlvrNs2Wj/wULM4vr6E8cJPFd8USAlVvfaP+/ lPA8CiRh+O+K3b5RsPy9dhkdMz2+lctamgJaWEIlUTM/LEaMuIjAMy292GSfpNSOd/lK /t4GARkB2mxqD+gw052zJW66P92fT/h65lU2bUO8UhyIi82CgzQ8NIfjdW22bRttbVxj L8nBtg95M7+mrPEZGBNZMkmx02Y6Wj+TJTdUE4dSS5/CjVPOMa1taiXCESG4a4q4+QTk 42bDw3bIZ7sdTv2ItiMSGMTEYVcJHzZhAaB8nDvRvEJSa8n1/8JQjmTbbEfD/kD8uTao iYTg== 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 l7-20020a056a00140700b0051f2b9f9b3bsi8429750pfu.243.2022.09.22.20.17.32; Thu, 22 Sep 2022 20:17:50 -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 S231972AbiIWDAc (ORCPT + 99 others); Thu, 22 Sep 2022 23:00:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231236AbiIWDAQ (ORCPT ); Thu, 22 Sep 2022 23:00:16 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B4816E889 for ; Thu, 22 Sep 2022 20:00:13 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MYcJJ5QMhzpVZh; Fri, 23 Sep 2022 10:57:20 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500022.china.huawei.com (7.185.36.162) 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:11 +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:10 +0800 From: Liu Shixin To: Andrew Morton , David Hildenbrand , Waiman Long , Zefan Li , Christoph Lameter CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH v4 4/8] mm/mmap: use hotplug_memory_notifier() directly Date: Fri, 23 Sep 2022 11:33:43 +0800 Message-ID: <20220923033347.3935160-5-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 --- mm/mmap.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 6445fd386f04..5a217378a62a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -3745,13 +3745,9 @@ static int reserve_mem_notifier(struct notifier_block *nb, return NOTIFY_OK; } -static struct notifier_block reserve_mem_nb = { - .notifier_call = reserve_mem_notifier, -}; - static int __meminit init_reserve_notifier(void) { - if (register_hotmemory_notifier(&reserve_mem_nb)) + if (hotplug_memory_notifier(reserve_mem_notifier, 0)) pr_err("Failed registering memory add/remove notifier for admin reserve\n"); return 0; -- 2.25.1