From patchwork Mon Jul 11 12:24:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Chen X-Patchwork-Id: 12913467 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F043C43334 for ; Mon, 11 Jul 2022 12:29:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MUTa+8dTl099ohjdonvoLmVBbHQWkZ6MhURxpBYXQ0c=; b=g8D9J6PNgzH/21 43fsIYchWSRwaDzUC3049dm9E2NJFyHWsnS/Rv3kI+TUeV65ik4IWa+0jaCEcdIxvVxgUFdPTC3RB Bhi3XEw9RWKcNjgZf+L7Qj7wrV49xJi0SGv48VWYTiw63n6pIei0XaFbf5SFBYL2ym4nu/Du/qokf 0chJdlmK6FzEwcPhVLZ8JTMaBu7KcYivMCONCgJ0UmjzRWSQ+/VTOUYlxh6xkwvEuoJ41eXcv0IZi +B68q6zjvwNlb/JDOQjFAdeVxAjxKzBjUnc72CZqaF00Ae0+FpNvetQjSZqpVnVi+mphbAM6BOptY RiohXCjtPZ5N7bX3Mgqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAsWe-001PtE-CS; Mon, 11 Jul 2022 12:28:32 +0000 Received: from sender4-op-o14.zoho.com ([136.143.188.14]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAsWT-001PnN-Lr for linux-arm-kernel@lists.infradead.org; Mon, 11 Jul 2022 12:28:22 +0000 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 X-ZohoMailClient: External X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220711_052821_783451_7049D0FF X-CRM114-Status: GOOD ( 10.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Reported-by: kernel test robot --- 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,