Message ID | 20231124132626.235350-16-david@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 78059C61D97 for <linux-mm@archiver.kernel.org>; Fri, 24 Nov 2023 13:27:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 104178D0085; Fri, 24 Nov 2023 08:27:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 08CBC8D0084; Fri, 24 Nov 2023 08:27:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E54778D0085; Fri, 24 Nov 2023 08:27:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C952D8D006E for <linux-mm@kvack.org>; Fri, 24 Nov 2023 08:27:39 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 8FC991CBC09 for <linux-mm@kvack.org>; Fri, 24 Nov 2023 13:27:39 +0000 (UTC) X-FDA: 81492925038.16.8BA4D2E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 8FBBE20016 for <linux-mm@kvack.org>; Fri, 24 Nov 2023 13:27:37 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dQWeGBfK; spf=pass (imf03.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700832457; a=rsa-sha256; cv=none; b=LrNyyFL8YDIzImqamUqeyRG+S2z5qEqpRg/ws9Un+nxi3yHN45KCiRJKMkLhXitb/kmOmk 1seSykXfFsHr+yVk3i3/O/i/bFu8+7U23szwOTOa5XvkIkcc//CzT9crfPq6OkGUT/l+V7 QrTCvuKXTSu0124LJ6Hr3OdPYoUN8RE= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dQWeGBfK; spf=pass (imf03.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700832457; 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:in-reply-to:references:references:dkim-signature; bh=qX2dA3aqMotkmkgBnT9s/2Q/bW+jQxPjHk8bIRl2TXE=; b=c4gSpZzkww3Pr5egrIGKYadrHI+24GGdBSwMPpXLZdWlpazG7/IDzhsIQKoTpEHD2BV3QC 9QJGiRrJRFWP3IF5sdAVXNgFJcm/ggFU/7ieIFm8o4hIOzD3gGSQbcOoU/Ps+dmktZSHoQ Y5Em6R5MZPHXAMRYS4a4QQrRLWz7Fc8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700832456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qX2dA3aqMotkmkgBnT9s/2Q/bW+jQxPjHk8bIRl2TXE=; b=dQWeGBfKXMPea9Kj/9qHdaRFhs6cbWq9G+QHWZkqxUminddsyiLqg5ILBCnQ+Wo/rkcETm zXzv++mcKEnuIMWkojOJbWVHLodNAEnCEXh1dke6pZ4PN0lLN3o9uK0a0GvPYKHe2/G6SM 4Lpjtx7snDBxf0B4qa2on9d+IaitCvM= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-198-yyv_70-8PeWkL3Q6JW939Q-1; Fri, 24 Nov 2023 08:27:26 -0500 X-MC-Unique: yyv_70-8PeWkL3Q6JW939Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CD8A52806053; Fri, 24 Nov 2023 13:27:25 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.194.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE44C2166B2B; Fri, 24 Nov 2023 13:27:22 +0000 (UTC) From: David Hildenbrand <david@redhat.com> To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand <david@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, Linus Torvalds <torvalds@linux-foundation.org>, Ryan Roberts <ryan.roberts@arm.com>, Matthew Wilcox <willy@infradead.org>, Hugh Dickins <hughd@google.com>, Yin Fengwei <fengwei.yin@intel.com>, Yang Shi <shy828301@gmail.com>, Ying Huang <ying.huang@intel.com>, Zi Yan <ziy@nvidia.com>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>, Waiman Long <longman@redhat.com>, "Paul E. McKenney" <paulmck@kernel.org> Subject: [PATCH WIP v1 15/20] mm/rmap_id: verify precalculated subids with CONFIG_DEBUG_VM Date: Fri, 24 Nov 2023 14:26:20 +0100 Message-ID: <20231124132626.235350-16-david@redhat.com> In-Reply-To: <20231124132626.235350-1-david@redhat.com> References: <20231124132626.235350-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 8FBBE20016 X-Stat-Signature: txwjf15a31mkgeesxzie6kja6y8anmkh X-Rspam-User: X-HE-Tag: 1700832457-917296 X-HE-Meta: U2FsdGVkX181jlwCNJ9Nix1p/7CxduG5JeF7eAmcQlT0UxCk32mVgdLyd5i0igdCouct8PvVO41wz8VOWjyDidqZcYyKOTGppgDiwyhR+f+Ym2fDpNRb1Cc3LGXKcinLe/7SqRZA5sqGBUa/Gg9TwqekSPewojktTeXbIaMtsASHCa5Zyb6BoMba3Q4gQYWRbF8kbXbdjuIe7KoFqCPlJOdsQkPHIjjpuazluGQcUzoZjTZ940DX85U4Q639/AYlry0hjDGykblLj9ASodGqrednFK5+BWuThvsOqNBdgMyhMHDqOs7KiDKwRBqsD5wNHqucDFfBShWHFa+AparS59ctWkSUR4qJWEMJn5ODxmPA8cI+wTuyZmSt07XUeDNqpmy8w3VPkzvS8Dhbe9FxO/YCeiXZudM8yWOwQKe6hWF/GgqKEQyhsuKCBlSX9RaHiTp5ZIrKGxBiBaqKeUMIVHso93cF10yTT6nzUbM7Fci7uLKALVXsXw8SbHhnb9Ly3rTNdKQDgIIwHuHDQYVS1NsOEnDUxWmlCVC0chCsQMy8lyE2z0Eq6vFN/HkwNuc4+EwnBAkSAgBM0jFGKApoQ5XlYqDlzHCN3k4OawH2Y3F/K4xrgOC5a7ExfwaDnKJ6M/s6zwKyWhg8n/mNKJf0h2whEn5wX/DtwXTfECUFOP8Hpf1K1UCm5G2HWmHI9R3X8fuscDdbleKMPfvoZ+cvzGO4GgBtNYIK2ObRXMH/D81L5XVf1rUP6T9Jd1tAKzvRWxXEvEyROePCICRxV9rFxQoEjunqV5oJmNhdKxU6R1xYfBG5f5fG9l6d1foPtBW5hbiUwfEbhZ6AYXUgav2wbq2a/SQwGdYecs2E9xvwwfukuwfsSE1Octgn2nK8lmnlH5S8SVOOYV1pf0+aDs3AF6nZ9NG8u9yLP/ZtMrxxDawtwf4FekICnfHHenNhaiv+UjxXIJ+T7lPW0VY1Jdj 2ylUcaCR cuNW4U45Z1gWWmIjoOEhY8JZZNpy8/qFYDl/l9DH58Xpxzv78RcyTwN7QS1uUWknbyVRcZNduXoVVP/i/1EP9591pE9aOo1Jhb2iWCWjWTyEZCzuIoZkHkalhE8A4y1Yiz5oQ17GyA2XuOamNje/pdCe2w7xxbyrbjIE3CFiHQjdFpGV22XFbqC3gAo67kgNVT1DW3TpXpucxWi5Tyf2usNaHAw== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: precise "mapped shared" vs. "mapped exclusively" detection for PTE-mapped THP / partially-mappable folios
|
expand
|
diff --git a/mm/rmap_id.c b/mm/rmap_id.c index 6c3187547741..421d8d2b646c 100644 --- a/mm/rmap_id.c +++ b/mm/rmap_id.c @@ -481,3 +481,29 @@ void free_rmap_id(int id) ida_free(&rmap_ida, id); spin_unlock(&rmap_id_lock); } + +#ifdef CONFIG_DEBUG_VM +static int __init rmap_id_init(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(rmap_subids_4); i++) + WARN_ON_ONCE(calc_rmap_subid(1u << RMAP_SUBID_4_MAX_ORDER, i) != + rmap_subids_4[i]); + +#if MAX_ORDER >= RMAP_SUBID_5_MIN_ORDER + for (i = 0; i < ARRAY_SIZE(rmap_subids_5); i++) + WARN_ON_ONCE(calc_rmap_subid(1u << RMAP_SUBID_5_MAX_ORDER, i) != + rmap_subids_5[i]); +#endif + +#if MAX_ORDER >= RMAP_SUBID_6_MIN_ORDER + for (i = 0; i < ARRAY_SIZE(rmap_subids_6); i++) + WARN_ON_ONCE(calc_rmap_subid(1u << RMAP_SUBID_6_MAX_ORDER, i) != + rmap_subids_6[i]); +#endif + + return 0; +} +module_init(rmap_id_init) +#endif /* CONFIG_DEBUG_VM */
Let's verify the precalculated subids for 4/5/6 values. Signed-off-by: David Hildenbrand <david@redhat.com> --- mm/rmap_id.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)