From patchwork Fri Sep 6 03:07:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Ying" X-Patchwork-Id: 13793166 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 85758CE7AA5 for ; Fri, 6 Sep 2024 03:09:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 179316B0085; Thu, 5 Sep 2024 23:09:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 129976B0088; Thu, 5 Sep 2024 23:09:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F32316B0089; Thu, 5 Sep 2024 23:09:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D4D876B0085 for ; Thu, 5 Sep 2024 23:09:21 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 83989C0D36 for ; Fri, 6 Sep 2024 03:09:21 +0000 (UTC) X-FDA: 82532832522.16.60EF029 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by imf26.hostedemail.com (Postfix) with ESMTP id 2E94414001D for ; Fri, 6 Sep 2024 03:09:17 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=nbyNc5UA; spf=pass (imf26.hostedemail.com: domain of ying.huang@intel.com designates 198.175.65.15 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725592060; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=0sVtJBxsPV1OZ0q0qftZGjsZJebEMkWF9/FK4H2U4gE=; b=StCmLdKIGzc9n/bBPWhwLbmg6ql561n6KNXyKSMxI8InwOVLXdOEEa+y8P2WifQyzWY2u2 uypGh04VZ1s/mmMBXzD0iwEK7++9UzXQ/8k3F8Z31/BN8JqkYn3P+pgt/qAMKVGk6/8SKB mCu91LTZPizC6ZDhYdPik71UZ1NXuaU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725592060; a=rsa-sha256; cv=none; b=WG0EX19gYZKqetQ+xjBpTbbSZBLTXoTkI4CkwsLeAWCzfZpdJ2jk3w5K3+ynF4dvQOE2i0 tbc2818gkHFYCMTHuNdYf3SdX28HFpISMp4krehZuAWZK93pv8/sHo56Ggdfimwel9hpdK 13vM5p41l9ynhjcEClI/QTi/I9aufoI= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=nbyNc5UA; spf=pass (imf26.hostedemail.com: domain of ying.huang@intel.com designates 198.175.65.15 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725592158; x=1757128158; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=o18ZWAutwQsr0SHaXGrMBCAo0m0ovYiksuGFL+bbRs0=; b=nbyNc5UAFkWmXPf+XMWTqRyRojNqs74P1v1XD/Itxw63IhAhSUdND5Di 8/Td1a+mpkq3+Yz91amE/1WQusCQpV2luefWKUz33HHR6Ka3a1rw0s2cg WC5zNpk3yIRPrWkOX9H9odATYBmHfiW3Z2KMgMF6l0qp2fIF4vElq+tKv BZCuIttCJl5HkAU0eNqc8WB0Gd+1W86LZaro30mK9EMulROCJNA6CUIde gNQc/8M2BPgVxhapB50eAONM+DV43cRSpwyQ7hcvbkgO2Sa+/EXxjGAWO qhNe8+WDop1Iw6ko0OQBYGEBphm+Y+wHNTOuxDF8v+oo2Gmpxm/AGDglt w==; X-CSE-ConnectionGUID: A44MRNgCSsGU2yLKiqFhjQ== X-CSE-MsgGUID: bv85KWHoQxKwoMtlamLgUg== X-IronPort-AV: E=McAfee;i="6700,10204,11186"; a="28089445" X-IronPort-AV: E=Sophos;i="6.10,206,1719903600"; d="scan'208";a="28089445" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2024 20:09:16 -0700 X-CSE-ConnectionGUID: qxUN/gzqTU+WWFJtixe5Fg== X-CSE-MsgGUID: A2kE5qfbQpmswl9Cyd+CrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,206,1719903600"; d="scan'208";a="66364336" Received: from unknown (HELO yhuang6-mobl2.ccr.corp.intel.com) ([10.245.242.189]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2024 20:09:13 -0700 From: Huang Ying To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, "Huang, Ying" , Dan Williams , David Hildenbrand , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Alistair Popple , Andy Shevchenko , Bjorn Helgaas , Baoquan He Subject: [PATCH -v3 0/3] resource: Fix region_intersects() vs add_memory_driver_managed() Date: Fri, 6 Sep 2024 11:07:10 +0800 Message-Id: <20240906030713.204292-1-ying.huang@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Stat-Signature: 8nbehzq1qkjyozfnu3f3qr5i9nk74y4w X-Rspamd-Queue-Id: 2E94414001D X-Rspam-User: X-R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GL0/hUV+GYekmXWEbhK1YDPw1VKWgMWqZEDFDVC0NW3PrPrswCayCMvWJfnTLrTHem93OK2bqHhpzBCU2NRy85NfzjHAzlW3DH0V8BBa4imgUHCXo9HKqkWbyhgFN+lFAcPrKaI0oFHviyTjtpIRHL539sQOwqO0uS4NqmUfWoPqrsSaPDLn5kQpAQ9saOybNrLy9G+vgs10myRbwFF4AShuJnt3R/Sv/YJkQtBLYP/l16OZQ== 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: List-Subscribe: List-Unsubscribe: The patchset fixes a bug of region_intersects() for systems with CXL memory. The details of the bug can be found in [1/3]. To avoid similar bugs in the future. A kunit test case for region_intersects() is added in [3/3]. [2/3] is a preparation patch for [3/3]. Changelogs: v3: - Revise the patch subject, description and comments, Thanks Bjorn, Andy, David, and Dan! - Added a kunit test case. - Fixed several coding style issues, Thanks Andy! - Link to v2: https://lore.kernel.org/linux-mm/20240819023413.1109779-1-ying.huang@intel.com/ v2: - Fix a bug which occurs when descendant of a matched resource matches. - Revise the patch description and comments to make the algorithm clearer. Thanks Dan and David's comments! - Link to v1: https://lore.kernel.org/linux-mm/20240816020723.771196-1-ying.huang@intel.com/ Best Regards, Huang, Ying