From patchwork Thu Sep 22 14:19:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 12985137 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 85652C6FA82 for ; Thu, 22 Sep 2022 13:45:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DCAC18000A; Thu, 22 Sep 2022 09:45:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D9FAD6B0071; Thu, 22 Sep 2022 09:45:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA17E6B0074; Thu, 22 Sep 2022 09:45:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 80D0B940007 for ; Thu, 22 Sep 2022 09:45:23 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 5221EA0EB5 for ; Thu, 22 Sep 2022 13:45:23 +0000 (UTC) X-FDA: 79939843326.02.325EE59 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf12.hostedemail.com (Postfix) with ESMTP id B103740064 for ; Thu, 22 Sep 2022 13:45:22 +0000 (UTC) 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 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663854323; a=rsa-sha256; cv=none; b=6vzRhl341eiqqp+3vQYNwozoyQuIRp2cwhjOIpFgNvC+1KDb9nWrup3rNicCk1P1I/lhd8 /5Gg6tCjptE3gcE+U7LPuueo3iFA8l7tQuSHn0TYzmn6/91KYePg2Zp5LDUqWa0SFazGCy S//Ia6Ut09u18WL2DNvjyuhKxqQP6rE= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf12.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=1663854322; 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=0cWKVQ6JYuazL044Kezqytok/tdjctVluPhIUk7zJztXxoj9M/8BWXkY8ijRDSwMPHW2i4 EZGOxSkfVmTJzU/IUAl6A/fCZWf1dniaby6S2JYw9ian0ddoTP8PBJ++uDS5i9HE4i/pTf PoAcDJWTpO4Zwjybbill/D2FlNbUuME= X-Rspam-User: X-Stat-Signature: dsfpgey1esxht43kz5e86mo5wb6fmuft X-Rspamd-Queue-Id: B103740064 Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf12.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com X-Rspamd-Server: rspam07 X-HE-Tag: 1663854322-482515 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 --- 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;