Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3290856imw; Mon, 11 Jul 2022 06:00:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ueC0acEiDBqk44HNDnFgTTMLBWz2ufLPwO1Nvrwnf6dMsFOzo1ZHcZwn74k0sgU+L6EV05 X-Received: by 2002:a17:902:d581:b0:16b:e6b8:4080 with SMTP id k1-20020a170902d58100b0016be6b84080mr18677903plh.146.1657544445813; Mon, 11 Jul 2022 06:00:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657544445; cv=pass; d=google.com; s=arc-20160816; b=i+HHcVPGy07aDlZy4mpY7503e/ILgfxNW7ILOd1xoI5MTmt6FPvJpSM9E+WatyPuEZ HXQiZ8TCSMz94ZxJZYxhBn7l2RxEwgSxBnT7wCyPW4UsON1xR3HGyeQgMYsjdvA7L2II ax+IyhVQDJ6sY5uYCzt/E8G8NDED0k9TaLV7ZJb6woDMtqhVGVmrcuX0c/ufYzTVcf3o 4nkSeh0JQlCmJPmxbKsXmCwJfKr46nff/BUBAGX9VmtbC1qBi5MVenRYe+kOZ0NgseEZ bhSIBIZKVvob3UN4k8WDY+DOgvoYkK4JtZ6Q0j/pbMLnM0Wagn0u33afhKfREHJf9mrS /0mw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nNMEZ/IULIqFkQZN/oBrcmZXnBPShQJWnrZceFIU7hk=; b=h6J7UHj2tljbrNGaB+0wi01YaXesxDH+q+o3mSxuYSj04Ai4DWFjfaV9KmsdpjJKkt VHtzQPst4lXoVhmOKQ56Z/jnqDmVMAFe1MrZaS8KXlxENS0EU5Drz75IJd+ADY2aI94h 0omYqZfhO8iv6Bj+Sbr2m093VMaV9Uwp7hN4BSkXbO17Hv9SjrvwRTLdDQFF9lpzpwND DJZ0ppiJs3gV8z6EPjjygWL98t8pJQDP0oJUDtUcKtCzuVUeD0Wa/+T9vWTsbHBoBGkg 36+m4bUk4Ddq0Z5iitOUW0s/TpU5jGX2NecFjFudVPzTSpSm+BAzq9ZunIO7r+7L89t3 BoJQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.beauty header.s=zmail header.b=KrYo66Fv; arc=pass (i=1 spf=pass spfdomain=linux.beauty dkim=pass dkdomain=linux.beauty dmarc=pass fromdomain=linux.beauty>); 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rj1-20020a17090b3e8100b001f02523a22csi8902472pjb.134.2022.07.11.06.00.31; Mon, 11 Jul 2022 06:00:45 -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; dkim=pass header.i=@linux.beauty header.s=zmail header.b=KrYo66Fv; arc=pass (i=1 spf=pass spfdomain=linux.beauty dkim=pass dkdomain=linux.beauty dmarc=pass fromdomain=linux.beauty>); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231856AbiGKMnl (ORCPT + 99 others); Mon, 11 Jul 2022 08:43:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231743AbiGKMna (ORCPT ); Mon, 11 Jul 2022 08:43:30 -0400 Received: from sender4-op-o14.zoho.com (sender4-op-o14.zoho.com [136.143.188.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 275243C8DE for ; Mon, 11 Jul 2022 05:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657542496; cv=none; d=zohomail.com; s=zohoarc; b=d9jlwf2JduepAUH0sP5MVHxLsoRxqYD2zVBYKAyqOCrDGaIgIww8ZN60Ke5MlhVsrzfUaQ2eIIxKEk12xqZvw3+xwABssGIZS/XbfnFQt4TCJGWGWYbNNkvPYn0wolsnVKnqygo1CZ2KUFr1gNUmsVBoGII4AGDGQ7h/iH/HwbU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657542496; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=nNMEZ/IULIqFkQZN/oBrcmZXnBPShQJWnrZceFIU7hk=; b=gA37RdDjMuGem70uRtqv1PDGFxctWfJodDZlIWpRWTJeFO9OkNhb3Gd4PeYqTdNUSlZ3q/f2uuIwvijb1BbEQekeqU1iLVnrKg67QDYGqop69TywVMtKVzqDyIMWmzcEFlntGgG8RXJEhitDFlYg53IVFY3bNn8ap2PUJuucakc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=linux.beauty; spf=pass smtp.mailfrom=me@linux.beauty; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1657542496; s=zmail; d=linux.beauty; i=me@linux.beauty; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=nNMEZ/IULIqFkQZN/oBrcmZXnBPShQJWnrZceFIU7hk=; b=KrYo66Fvw84KWCAXvugb8MTWVK3cvnzI/YA9ujEKbC98ESaZwaOvHO0GXEbOMRiA BpF3GRKM/9dGBv3L14VlJ6NOF4KdgKbBkWVC8OvJdNV1wvSH1XcuuAicOHqR8lK8TlG PCzKIOnsOEY45R6iD7bsj0wBT8ORA5vXRpvmRxNA= Received: from sh-lchen.ambarella.net (180.169.129.130 [180.169.129.130]) by mx.zohomail.com with SMTPS id 1657542495481198.279413668139; Mon, 11 Jul 2022 05:28:15 -0700 (PDT) From: Li Chen To: Catalin Marinas , Will Deacon , Rob Herring , Frank Rowand , Andrew Morton Cc: Li Chen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/4] mm/sparse: skip no-map memblock check when fill_subsection_map Date: Mon, 11 Jul 2022 20:24:52 +0800 Message-Id: <20220711122459.13773-3-me@linux.beauty> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220711122459.13773-1-me@linux.beauty> References: <20220711122459.13773-1-me@linux.beauty> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Li Chen When mhp use sparse_add_section, don't check no-map region, so that to allow no-map reserved memory to get struct page support. Signed-off-by: Li Chen Change-Id: I0d2673cec1b66adf695251037a00c240976b226f --- mm/sparse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/sparse.c b/mm/sparse.c index 120bc8ea5293..a29cd1e7014f 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -690,7 +690,9 @@ static int fill_subsection_map(unsigned long pfn, unsigned long nr_pages) if (bitmap_empty(map, SUBSECTIONS_PER_SECTION)) rc = -EINVAL; - else if (bitmap_intersects(map, subsection_map, SUBSECTIONS_PER_SECTION)) + else if (memblock_is_map_memory(PFN_PHYS(pfn)) && + bitmap_intersects(map, subsection_map, + SUBSECTIONS_PER_SECTION)) rc = -EEXIST; else bitmap_or(subsection_map, map, subsection_map, -- 2.25.1