From patchwork Tue Sep 20 02:51:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 12981229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2B1DC6FA82 for ; Tue, 20 Sep 2022 02:18:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07A4E8000D; Mon, 19 Sep 2022 22:17:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E57178000B; Mon, 19 Sep 2022 22:17:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AAF2394000A; Mon, 19 Sep 2022 22:17:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7C0E080007 for ; Mon, 19 Sep 2022 22:17:55 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4F763C0595 for ; Tue, 20 Sep 2022 02:17:55 +0000 (UTC) X-FDA: 79930853310.10.AFAC6F2 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf28.hostedemail.com (Postfix) with ESMTP id C687FC0009 for ; Tue, 20 Sep 2022 02:17:54 +0000 (UTC) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MWlTP0VzmzlW0q; Tue, 20 Sep 2022 10:13:45 +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; Tue, 20 Sep 2022 10:17:50 +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; Tue, 20 Sep 2022 10:17:49 +0800 From: Liu Shixin To: Andrew Morton , Zefan Li , Waiman Long , "Christoph Lameter" CC: , Liu Shixin , Kefeng Wang Subject: [PATCH v2 4/9] mm/mmap: use hotplug_memory_notifier() directly Date: Tue, 20 Sep 2022 10:51:18 +0800 Message-ID: <20220920025123.2868953-5-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220920025123.2868953-1-liushixin2@huawei.com> References: <20220920025123.2868953-1-liushixin2@huawei.com> MIME-Version: 1.0 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663640275; a=rsa-sha256; cv=none; b=Q3vtRcQt4IuA46ISHq2UPPjdOdngTd8vsmXf8UpsWpKGXitagwAnpyv3dls0+nKBWhGmH2 4XhGjOAne7aDmFHM1rns5rDMAXzVZDFlAYDS4fD6zIqczrcB7nDXNt2y/1v3jjPE8BQzAT LkLyzk0mel+t6/K5feKLD7IJd4jNJv0= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf28.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663640275; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g/7tyIxPWbH568A0bzvf+Ck+EkbhJIax2c0xILqqTSE=; b=uZmEokRvmHIMpS2tRRMeWIOU3zMOPou4dzLVK6O4Q/mhIs9mmlKV8jre85b49gyCHI9UI3 oY/2onEq5a3352PkTrWZ0xrW3KyqL+Fu6fRCT786Kl0OH237rnhkwpi2GwYIp3vqPebKxn 8Rx7Pi/fFdvexHu7IDJc4pgaAOLliTg= Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf28.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: xab7ncq11kcrc85fwzpep6pnp4rhgjoy X-Rspamd-Queue-Id: C687FC0009 X-HE-Tag: 1663640274-355722 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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;