From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 0A94E29AAF8 for ; Mon, 22 Dec 2025 13:59:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766411981; cv=none; b=lRts1evB1CjDJnguaVdLHrr36e/tRMrHbC7I7JttY+BC31aNIQvn49dWRcrAuJ5pFzz4Lm2mOpIjKd8shYDo1+h5KDANuYrY4T6BQ2vA8mP3Ehh5ib3IT+Rk+GWUvz6q9Xb71zCKh2OD1r0Vu6491ZEbkwROS/2kQgngqY+DiCs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766411981; c=relaxed/simple; bh=ttnN8DnjS7+7l4nt/Oo/8W2L/gNpnNAqaQsDPJ3baxs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rgdjBOerXo4mhkxiby+fMzCaqD7p3NBlCNBS//DDNwnoOwHrADHP84ng2ervgKp/UFMr7D9el6uC2Oi54bzpQpQ3daAimRi+9axvGr4o16TlwzuPl4R9RwGd72Bjndk1gfpme+/Y3ElSNOBIpjRoODGKihpWXehQonR/72dvais= 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=LeJHbD0n; arc=none smtp.client-ip=198.175.65.17 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="LeJHbD0n" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1766411980; x=1797947980; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ttnN8DnjS7+7l4nt/Oo/8W2L/gNpnNAqaQsDPJ3baxs=; b=LeJHbD0njShakshKhmcZ73477dKI/Das902vOmrQ0hD8XeodB/7Qu03s OKMJzmTJSLmZ9RcltW+gznKe35ssB9UTS5FFDTK8eKZr/R1UkDe4MjDBC 1tvTigyXZPtoNjxlc8688I1GTYZxG/fGFosm2QV9YiveaEkASO6nXLUVA gVSYw88DUfq29l6xA8nyZ65lacYC8qQGUsIy4RIUgTNUND86Hf5dV7uJv 6SOLUNWaiA0bISjgFwZkB7sQp/Rf6EZz2oa59O7xELf70y+g/B+S+G4RZ zpdcm4+NitBh63XhzoYpGt8GuJ1VMMwaE8xJkgvEFVno9B78gwOe1l1XM Q==; X-CSE-ConnectionGUID: sj+OGF6kRPq1hLRlUkUWxw== X-CSE-MsgGUID: 6UQqneoJQiqv/cqBpoKI4g== X-IronPort-AV: E=McAfee;i="6800,10657,11650"; a="68248499" X-IronPort-AV: E=Sophos;i="6.21,168,1763452800"; d="scan'208";a="68248499" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2025 05:59:40 -0800 X-CSE-ConnectionGUID: GbB7OL2ERy+gGAte1jW/Rg== X-CSE-MsgGUID: PhkXS6MJSe638PA73GlRTw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,168,1763452800"; d="scan'208";a="230189533" Received: from linux-pnp-server-27.sh.intel.com ([10.239.147.41]) by orviesa002.jf.intel.com with ESMTP; 22 Dec 2025 05:59:36 -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 v7 0/2] Optimize zone->contiguous update and issue fix Date: Mon, 22 Dec 2025 22:58:05 +0800 Message-ID: <20251222145807.11351-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 fix an issue when check the zone->contiguous during zone grows, the second 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 without the second patch. Yuan Liu (1): mm/memory hotplug: fix zone->contiguous always false when hotplug Tianyou Li (1): mm/memory hotplug/unplug: Optimize zone->contiguous update when changes pfn range 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. Tianyou Li (2): mm/memory hotplug: fix zone->contiguous always false when hotplug mm/memory hotplug/unplug: Optimize zone->contiguous update when changes pfn range mm/internal.h | 8 ++++- mm/memory_hotplug.c | 75 +++++++++++++++++++++++++++++++++++++++++++-- mm/mm_init.c | 12 ++++++-- 3 files changed, 89 insertions(+), 6 deletions(-) -- 2.47.1