From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A191842E011 for ; Tue, 20 Jan 2026 13:33:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768916008; cv=none; b=nqLR/PhdSoqFYJeDvRKKpzMbvjFlQWuGCCF82eILfBUWkObJS07kSQUARcFMP/9/xiHScKI4cBsi6fhQ7Ay+B3KALGVtWzWRptHn1oVyAwGC9m/tdXBBaH7sPhmu14WzJMdAgOG3hgB7ykP0pq5SV+stTExpf43CCtEng/WMQ/Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768916008; c=relaxed/simple; bh=GIVLQonRnvNDAmphqJiHVZXAVdJFP0u7vX436lLj/YU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XjGOi4kHg2reUoDsmaIpcGK0A5cQJE06E+d5I7wcxq8jH6ikqHtpRbgqFmbLmGkQOASqQ+TbFcjTUnLDuWPBL/6rXCsJV3Y0yQHz06GExje+mIpjZJhfMtEF6tmo7KCMXDJ5rADA3y2WUkYQ62646FwZvYvPIAu6L5pOHVRaX5c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=fEExGwwQ; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fEExGwwQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768916006; x=1800452006; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=GIVLQonRnvNDAmphqJiHVZXAVdJFP0u7vX436lLj/YU=; b=fEExGwwQoNFFrhfEHExEjg3cyYiFEmqkqHVXtotcrY3HxQRMYfXQ1xuG sx4zdngiijnLflvdTwcjga0PO16UWGGk8pLk0K1Oi1zGxSWCfMkS85hXq qmAoB+/p2W5eAD0pabZagzaTtNIhmjipJ9/UGn3xdIyPBHi6tpAssn/E8 kS40esXxgJdVjH0xyVOJoSCVY8RZVT/r2QslhmPGj+1R3QAzu2QZMIDag 7hGU3ow1ZAnB4lNqRKHjhgTGHt3/sum6FpB7NyDPrlwHG8xTyZ74c8h5k V8hSk075aUba4n+aKh9yuh5lYdyyqUMOP5xKIfU4vVdtbrcFJsZIPpUFy Q==; X-CSE-ConnectionGUID: 51R89adDSK+u2kaTE1TQ/A== X-CSE-MsgGUID: BHXcEolZRDW1KYWxROFT3Q== X-IronPort-AV: E=McAfee;i="6800,10657,11676"; a="81494830" X-IronPort-AV: E=Sophos;i="6.21,240,1763452800"; d="scan'208";a="81494830" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2026 05:33:26 -0800 X-CSE-ConnectionGUID: 4zREZ3QUT3yfk3tYQQGl9A== X-CSE-MsgGUID: Ke/QbYWMRKme+ihAlIqVpw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,240,1763452800"; d="scan'208";a="210271999" Received: from linux-pnp-server-27.sh.intel.com ([10.239.147.41]) by orviesa003.jf.intel.com with ESMTP; 20 Jan 2026 05:33:22 -0800 From: Tianyou Li To: David Hildenbrand , Oscar Salvador , Mike Rapoport , Wei Yang , Michal Hocko Cc: linux-mm@kvack.org, Yong Hu , Nanhai Zou , Yuan Liu , Tim Chen , Qiuxu Zhuo , Yu C Chen , Pan Deng , Tianyou Li , Chen Zhang , linux-kernel@vger.kernel.org Subject: [PATCH v8 0/3] Optimize zone->contiguous update and issue fix Date: Tue, 20 Jan 2026 22:33:43 +0800 Message-ID: <20260120143346.1427837-1-tianyou.li@intel.com> X-Mailer: git-send-email 2.47.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series contains 3 patches. The first one fix an issue when check the zone->contiguous during zone grows. The second one encapsulate the mhp_init_memmap_on_memory() and online_pages() into online_memory_block_pages(), the mhp_deinit_memmap_on_memory() and offline_pages() into offline_memory_block_pages(). The last one add a fast path to check the zone->contiguous. The issue fixed by the first patch can be found in the original code path. Changes History =============== v2 changes: Add check_zone_contiguous_fast function to check zone contiguity for new memory PFN ranges. v3 changes: Add zone contiguity check for empty zones. v4 changes: 1. Improve coding style. 2. Add fast path for zone contiguity check in memory unplugged cases, and update test results. 3. Refactor set_zone_contiguous: the new set_zone_contiguous updates zone contiguity based on the fast path results. v5 changes: 1. Improve coding style. 2. Fix a issue in which zone->contiguous was always false when adding new memory, leveraging the fast path optimization. v6 changes: 1. Improve coding style. 2. Add comments. v7 changes: 1. Rebased to 6.19-rc1 2. Reorder the patches so that the fix will be the first in the series. v8 changes: 1. Rebased to 6.19-rc6 2. Add online_memory_block_pages() and offline_memory_block_pages() Tianyou Li (2): mm/memory hotplug/unplug: Add online_memory_block_pages() and offline_memory_block_pages() mm/memory hotplug/unplug: Optimize zone->contiguous update when changes pfn range Yuan Liu (1): mm/memory hotplug: Fix zone->contiguous always false when hotplug drivers/base/memory.c | 53 +++---------- include/linux/memory_hotplug.h | 18 ++--- mm/internal.h | 8 +- mm/memory_hotplug.c | 136 +++++++++++++++++++++++++++++++-- mm/mm_init.c | 15 +++- 5 files changed, 167 insertions(+), 63 deletions(-) -- 2.47.1