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 D7B9AC6FA82 for ; Thu, 22 Sep 2022 13:45:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7422480009; Thu, 22 Sep 2022 09:45:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C27980007; Thu, 22 Sep 2022 09:45:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49D556B0074; Thu, 22 Sep 2022 09:45:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0123680007 for ; Thu, 22 Sep 2022 09:45:23 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id BFD1EA14D3 for ; Thu, 22 Sep 2022 13:45:23 +0000 (UTC) X-FDA: 79939843326.15.E326BE3 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf25.hostedemail.com (Postfix) with ESMTP id 620A7A001B for ; Thu, 22 Sep 2022 13:45:21 +0000 (UTC) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MYGdr6dvBzWgpL; Thu, 22 Sep 2022 21:41: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; 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:17 +0800 From: Liu Shixin To: Andrew Morton , David Hildenbrand , Waiman Long , Zefan Li , Christoph Lameter CC: , , Liu Shixin , Kefeng Wang Subject: [PATCH v3 0/8] mm: Use hotplug_memory_notifier() instead of register_hotmemory_notifier() Date: Thu, 22 Sep 2022 22:18:56 +0800 Message-ID: <20220922141904.3245505-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: 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=1663854322; a=rsa-sha256; cv=none; b=upva15RCy01Mf30TUbxkmIj4XjqrB0DLZF1IT9lKjR921rhions5vAPf+oBc1M+0NqV8AX GZE7svNLiZFSSxiP92diwc5HT8zBGj4HFdA3Sx9T/vfSFAnABnL5mH+LKCkul+xjxpgxKX yN9l3Bo935IKyX+q2Q8lPOAkf4edIQA= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf25.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 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: references; bh=q2LpAkTkgfOt3ju266LH5gHkGx8I+v9cG9A8oGYX1TA=; b=OYUSKz6B+sxPoDGkIZUvZc12bd7z62iad6nob3h2hoUL03bV9VMLsHqQgptAKtq1E2zM7O 5BiWQ001BrFk6mYM0VXAbWMma4d5E9IShTjuY8RWlPDejxOydzZB/Z7po2H0wo7lFqjvgB /xTxaSJ4wqjc4tcnn75lrprakfREdcw= X-Stat-Signature: epzsdm56pcfmta9pgzb1kd8c6bwdp56x X-Rspamd-Queue-Id: 620A7A001B Authentication-Results: imf25.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf25.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1663854321-850861 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 [9] move all priority of hotplug memory callback into include/linux/memory.h for easy sorting. 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