Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp814242rwb; Thu, 22 Sep 2022 06:48:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4AWoG7iJEYGZBOTTgLm7UTxQ9qFKu0FfErDNBY3fgLSIlPauxR7rcs0hoRAtooQ0FiS9hp X-Received: by 2002:a05:6402:518e:b0:452:49bc:179f with SMTP id q14-20020a056402518e00b0045249bc179fmr3458208edd.224.1663854490984; Thu, 22 Sep 2022 06:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663854490; cv=none; d=google.com; s=arc-20160816; b=n3nh1y7BaasstmIpT3b63iP11Ds39o88xS/pr8W08YR6IhUnDiFobcNRIq6Y2jz+s9 8bYhdrcNyUSgvq0FXvV3ExRxAAh6xR/OFzSkUJrhOo0MN++QBXLtSeLh/FFe3jp0+8fj Ogl38AqcU7H5Dl46/r7PFErTvgmGDOg8D+n5JhbDBkGL/rSP+7LT80qVRInaRDHA5xKl H1TCKNgIovnHJZXhJNSNgJFfIxZHnVga5TNWp8m2+SG4VxXWW3UtNRWP3OXLhF0BkLSG aPXvXIWvI4ogJ0ePnthVbz9ceHjHcfn1KDdCHiIFsjimvOq7N6eC1y3w9h1FDjC86zOV rIzw== 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=g/7tyIxPWbH568A0bzvf+Ck+EkbhJIax2c0xILqqTSE=; b=muFFATFKaWleyN0sm8gY4/S8B5ttN8VFBBcqcjNHbbehA0PT58kKxWh/9G+Z0wbR+z +Dm1hUlunX2dBu12BWqtxbGGDuWcb0P6RPwuIEwljySU+Obp1PFjH1ql48NuKN3t1thW 9dcz42++N8t42kaSUxCi1EJs30ss37yfuoMmmcfTSYbrg6Yq7fEXEY/wFjjV93lJZwPm FKCOO2GiKU7jY+2PC2vstAlZvLGrcQ+d//QOZ+KW9RiHZJ6hfxBo8TEPX1hdZMLmTegX B0NBYvTMF9+AvpGS+OXEQtKm9i/7WMxOzEQtgKWH2qqmWboGWG1yvDsZ+nu6aa4ZowaB DnlQ== 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 gt31-20020a1709072d9f00b0078217f3a033si5422112ejc.652.2022.09.22.06.47.44; Thu, 22 Sep 2022 06:48:10 -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 S231344AbiIVNpm (ORCPT + 99 others); Thu, 22 Sep 2022 09:45:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231287AbiIVNpW (ORCPT ); Thu, 22 Sep 2022 09:45:22 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1BDF4B0CC for ; Thu, 22 Sep 2022 06:45:21 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MYGgB1ZzfzpTpC; Thu, 22 Sep 2022 21:42:30 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500020.china.huawei.com (7.185.36.49) 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 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:19 +0800 From: Liu Shixin To: Andrew Morton , David Hildenbrand , Waiman Long , Zefan Li , Christoph Lameter CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH v3 4/8] mm/mmap: use hotplug_memory_notifier() directly Date: Thu, 22 Sep 2022 22:19:00 +0800 Message-ID: <20220922141904.3245505-5-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 --- 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