From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 DF0512874F8 for ; Mon, 15 Dec 2025 12:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765800440; cv=none; b=U5ndDujAI9fURR4UuQL5r4gNEW2UTKTM2Zwh13omPS2i2XWOC7LICwD3sOkjup66ZPn9GhCy52LiJnt2dqPSPLRgsvT86xe6BJNiOzvvRD3fgWI/K+BuQZ3Ga0xBFwIdR2tjxF/U+ygbbnASnEM/F9rQbOBlKlO7PAzIDrnm2x4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765800440; c=relaxed/simple; bh=VZbaSHeMrFD10tCnogVmCMF1KNI1nTBo4rCtGSYN72M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Yy/KpQ3yBROMd8t4kQGDGxcNHTPgYTWtLXAB9v1qHwAs6sX6jM5wMUChdx70xxBuugb0WKpBJTpL5klmD49iWw/vFqGLm8nFD17z3URLSKBJiyZZ6MirE+wle3AvWmSedb4XiHG26yFF47g7s2L8sTu6A9W5YbUjwnK4G0Br5lM= 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=eNgMKZQR; arc=none smtp.client-ip=198.175.65.12 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="eNgMKZQR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1765800439; x=1797336439; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=VZbaSHeMrFD10tCnogVmCMF1KNI1nTBo4rCtGSYN72M=; b=eNgMKZQRmiy1YPzer7VyNjYMRhj6PmUgvdynYff7obXW5UditgogFZkJ bhhP+mmanFLHICT7ZX27wIaN+pL2O6tCzKKYSfhDAJVEN6QPOyPp3zEQu 2kgQ0gB5gyfyYOv9Cfqs/hpKqso0GJaDeGebgY+tZ4P9iIrdggriaEVex FanBRCrip9aVcMf7Y7+dyH5zqtVHJbzUqJN0jruoR4OM7/oJRWgApmN+q +LMHsGVJ+Fq0JC+MEvsaRPZq3v9gt8KvRwxn9vH0uwCe8wc5oublRayAd yfWtlXedW30/ykWpqQ7zGk3zMTDI+pX1CvQxJQbdz9tL5S9GDxMmCcYit g==; X-CSE-ConnectionGUID: 8SoTcX6ZTYm7pVV1yh0Kcw== X-CSE-MsgGUID: HnxueI2tQFOQGdlyHcYxPQ== X-IronPort-AV: E=McAfee;i="6800,10657,11642"; a="79154735" X-IronPort-AV: E=Sophos;i="6.21,150,1763452800"; d="scan'208";a="79154735" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2025 04:07:18 -0800 X-CSE-ConnectionGUID: xRGi983IS2e1MpYlMRTCtg== X-CSE-MsgGUID: cuyf0ADfQ/uuWvEA7J0WZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,150,1763452800"; d="scan'208";a="228357211" Received: from linux-pnp-server-27.sh.intel.com ([10.239.147.41]) by orviesa002.jf.intel.com with ESMTP; 15 Dec 2025 04:07:14 -0800 From: Tianyou Li To: David Hildenbrand , Oscar Salvador , Mike Rapoport , Wei Yang 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 v6 0/2] Optimize zone->contiguous update and issue fix Date: Mon, 15 Dec 2025 21:04:35 +0800 Message-ID: <20251215130437.3914342-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 2 patches, the first one add a fast path to check the zone->contiguous, the second one fix an issue when check the zone->contiguous at the slow path during zone grows. The issue fixed by the second patch can be found in the original code path without the first patch. Tianyou Li (1): 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 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. mm/internal.h | 8 ++++- mm/memory_hotplug.c | 75 +++++++++++++++++++++++++++++++++++++++++++-- mm/mm_init.c | 12 ++++++-- 3 files changed, 89 insertions(+), 6 deletions(-) -- 2.47.1