Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp382276rwb; Thu, 22 Sep 2022 20:22:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6JiWPmVeZbl6zzghrVS8V6yWqPPwGsVSoCeBFUdoDClCav95U4PD73d24g0vv1fQDK7Pu6 X-Received: by 2002:a17:902:b104:b0:179:b7fe:1960 with SMTP id q4-20020a170902b10400b00179b7fe1960mr5228661plr.42.1663903329558; Thu, 22 Sep 2022 20:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663903329; cv=none; d=google.com; s=arc-20160816; b=ykik/IHEqv/9dO57Fhr2vRorRdLTJ3MekOtEtDc/1WZeNfP0KshpxsjT+Qq4lSY++9 T5MpDI+htrtKo1Owmy/b3yTXSHppEepaWegVD3ft5dQwfZAG69Bdxm67vGzyFYyA+EQW aOAJ7tO964JddmhTob1Dr+bEtROh1Gilv0mqGyPFlgOU0j+b0kTCukLYy3ABTp3nmTTH ad1etoKL5pQ/IOazeURSM86hdq752Td90PM6TKeSzMwIopOquRXbSDaW9seDq2JuqNfv +xQ8uZwALWJ/uMNMxhPpa/Mbsri3+t4u2t408jdWfq9KaXynAlyuGfUI1hPHhOwa4IsX rbcg== 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 :message-id:date:subject:cc:to:from; bh=2tJ7sLiAq6LSwq4teIxaAjnNE0eSiuE6eV7bLVREmMA=; b=rPmpky7n99e3Mksk6WPi6yDKYkzt04c62kH9j1wtDRiBGDOCb4ndbPBEMkFmuCBGqq gWVNaoieLo7xJlFBYJkgAJLunD15VZjNDIrS2FZz7V6alqoDEd5D/V8a1KKCBEcOilvj yB3OwOKnvAj4x9n4LH/18DM6OaM0WJwNexnxTfemNWeeqb1apQK3vc10lF2lk+UIVpca z09yRAuaXXtCPJN6yelwyemiN/3w0Ls0mfcx79giOqQ4G/lX1LHP8TUrfF8HuAYLaK5M xeG2fKGUhEIhfjzZ9/wjyQ6OtxCD4C1uABiCy39+XFzszH/nyqpdUo02TD34SZvxe7yz qrFg== 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 d6-20020a17090abf8600b0020388f845e9si1465536pjs.52.2022.09.22.20.21.56; Thu, 22 Sep 2022 20:22:09 -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 S231474AbiIWDAS (ORCPT + 99 others); Thu, 22 Sep 2022 23:00:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230054AbiIWDAQ (ORCPT ); Thu, 22 Sep 2022 23:00:16 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18A68647CC for ; Thu, 22 Sep 2022 20:00:11 -0700 (PDT) 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: 7BIT Content-Type: text/plain; charset=US-ASCII 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 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,HEXHASH_WORD, 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 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