From mboxrd@z Thu Jan 1 00:00:00 1970 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 47674C6FA8B for ; Fri, 23 Sep 2022 03:00:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6F8378000B; Thu, 22 Sep 2022 23:00:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5ACF880007; Thu, 22 Sep 2022 23:00:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 400BB80007; Thu, 22 Sep 2022 23:00:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 21AF280007 for ; Thu, 22 Sep 2022 23:00:16 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E7A63C0371 for ; Fri, 23 Sep 2022 03:00:15 +0000 (UTC) X-FDA: 79941846390.05.142D3ED Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf29.hostedemail.com (Postfix) with ESMTP id 67C48120012 for ; Fri, 23 Sep 2022 03:00:15 +0000 (UTC) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MYcJG4sk1zpVcD; Fri, 23 Sep 2022 10:57:18 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500023.china.huawei.com (7.185.36.83) 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 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:08 +0800 From: Liu Shixin To: Andrew Morton , David Hildenbrand , Waiman Long , Zefan Li , Christoph Lameter CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH v4 0/8] mm: Use hotplug_memory_notifier() instead of register_hotmemory_notifier() Date: Fri, 23 Sep 2022 11:33:39 +0800 Message-ID: <20220923033347.3935160-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663902015; 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: references; bh=2tJ7sLiAq6LSwq4teIxaAjnNE0eSiuE6eV7bLVREmMA=; b=vHuNuI1tUlay1220oPdyBb2RDqkJmnNOvYdjB63JHcC+dDhf6SlTwVN/lPbLzJTT/yNkWt 20G1C3JKcc6kZErweCEjQbN1dqhNtrHY8pKlavNwrUt91lRsPVgBXbOiTqURujVddkXUX/ Dui1AhMuCv026qyzMCOvcgJBQDOkZF4= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf29.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663902015; a=rsa-sha256; cv=none; b=Y5zHLfWqVbdgmwnuFyLXrXcjiH+0pYyPexP5J13hvoO3KaFaHqz4Zm0haaOoO+XkDgzujG AIUkKK8zStlMqWRYTYhi6G0ko3T14lht+MO94xmEGgYUAMvS3+w9aogrHxmCr5elhYKicl CGJTNC+GtwGWAQ3FWZZ0/n1RjtG1mKk= X-Stat-Signature: paqgs5qeo6tfonji74acpi4wa3h1xjht X-Rspamd-Queue-Id: 67C48120012 X-Rspam-User: Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf29.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com X-Rspamd-Server: rspam03 X-HE-Tag: 1663902015-547322 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: Patch f02c69680088 introduced register_hotmemory_notifier() to avoid a compile problem with gcc-4.4.4: When CONFIG_MEMORY_HOTPLUG=n, we don't want the memory-hotplug notifier handlers to be included in the .o files, for space reasons. The existing hotplug_memory_notifier() tries to handle this but testing with gcc-4.4.4 shows that it doesn't work - the hotplug functions are still present in the .o files. 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(). In the last patch, we move all hotplug memory notifier priority to same file for easy sorting. Patch [1-6] replace register_hotmemory_notifier() with hotplug_memory_notifier() for every caller. Patch [7] remove unused register_hotmemory_notifier(). Patch [8] move all priority of hotplug memory callback into include/linux/memory.h for easy sorting. v3->v4: Add back the missed Reviewed-by from v2 according to David's reminder. v2->v3: fold last two patches, change MM_BATCH_CALLBACK_PRI to MM_COMPUTE_BATCH_PRI and rewrite the commit log. v1->v2: fix compile error of patch [4,5]. Liu Shixin (8): cgroup/cpuset: use hotplug_memory_notifier() directly fs/proc/kcore.c: use hotplug_memory_notifier() directly mm/slub.c: use hotplug_memory_notifier() directly mm/mmap: use hotplug_memory_notifier() directly mm/mm_init.c: use hotplug_memory_notifier() directly ACPI: HMAT: use hotplug_memory_notifier() directly memory: remove unused register_hotmemory_notifier() memory: move hotplug memory notifier priority to same file for easy sorting drivers/acpi/numa/hmat.c | 7 +------ fs/proc/kcore.c | 7 +------ include/linux/memory-tiers.h | 1 - include/linux/memory.h | 15 +++++++-------- kernel/cgroup/cpuset.c | 7 +------ mm/kasan/shadow.c | 2 +- mm/ksm.c | 2 +- mm/memory-tiers.c | 2 +- mm/mm_init.c | 8 +------- mm/mmap.c | 6 +----- mm/page_ext.c | 2 +- mm/slub.c | 7 +------ 12 files changed, 17 insertions(+), 49 deletions(-) -- 2.25.1