From patchwork Wed Dec 20 22:44:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13500634 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 3E5C1C3DA6E for ; Wed, 20 Dec 2023 22:46:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C3A9A8D0017; Wed, 20 Dec 2023 17:46:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BEAED8D000D; Wed, 20 Dec 2023 17:46:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3BE68D0017; Wed, 20 Dec 2023 17:46:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8F8B38D000D for ; Wed, 20 Dec 2023 17:46:12 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6447FC060F for ; Wed, 20 Dec 2023 22:46:11 +0000 (UTC) X-FDA: 81588681342.23.A41B027 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id A8B981C002F for ; Wed, 20 Dec 2023 22:46:09 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BQs0h7FH; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1703112369; a=rsa-sha256; cv=none; b=wmgw1OIBwS6wGP4888DdVaNL9onGttIxicOiQdCz5T2CNvXOahof2czdpSs4LFkiJuxbYJ KvUEOc/Ft+Y0hfpdCqJhdYI4sM4AvPq3soMSFQuuwwbYGZsGTPsxVodtdcLSSKA3tPaejn E5oOLOjJVTPtPj1EttfKkyY7ZNePl58= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BQs0h7FH; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1703112369; 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=H6kyFjjwWNovISb45JpAxGunVS8pf5Q0izk9V4kCoBM=; b=g86Hw0YnLAUgyzbPyLGrsL1OEnk7UWbnY0AJTqCEhfqR/TkME5ccqqLWwhZpL1w4uIuzfP cHGH1bWx7Ywct5QzuDnfrP8NBWsxRCel8i/lGsrTNlrHp2tJSj4ddQiseoRVXUoeHlEdEo hWWSfjZDNfDy/DYDzxJhOiGJM84/1ls= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703112369; 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=H6kyFjjwWNovISb45JpAxGunVS8pf5Q0izk9V4kCoBM=; b=BQs0h7FHPEtRwOHfiZyDBykD3sGV2U2FuCjkcULe9ALy5u6qbBhud46omYfbx9WSSwksar 1lTFgfx/RYO80e/DkitT9njFFxPMFaxQqUZHGcIkfwCq4cJUQ+baOWZ3pQlVmC/FN4hOif aPGNMztUwXMwGQqX/kXwZidqBROU4iU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-564-BPRXZUsgNgykeRsAk0KDlQ-1; Wed, 20 Dec 2023 17:46:05 -0500 X-MC-Unique: BPRXZUsgNgykeRsAk0KDlQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 09319101A5DC; Wed, 20 Dec 2023 22:46:05 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.192.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90EFA40C6EB9; Wed, 20 Dec 2023 22:46:02 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , "Matthew Wilcox (Oracle)" , Hugh Dickins , Ryan Roberts , Yin Fengwei , Mike Kravetz , Muchun Song , Peter Xu Subject: [PATCH v2 22/40] mm/rmap: remove RMAP_COMPOUND Date: Wed, 20 Dec 2023 23:44:46 +0100 Message-ID: <20231220224504.646757-23-david@redhat.com> In-Reply-To: <20231220224504.646757-1-david@redhat.com> References: <20231220224504.646757-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A8B981C002F X-Stat-Signature: hpsyk6gfnwuos6zdrcuxkep3f4w4n7zj X-HE-Tag: 1703112369-688819 X-HE-Meta: U2FsdGVkX19oR9AJkJwL3cafSwzC0PCucNl6CMLzVgxkfFraPOjugBE2vmxDym7NfBGL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w2uUH2foPpTPEwbFRU4LDLqsxHifYLyCE1PRIRACV+6FK4wLgQFduuDfGGMYhQ5ju3egmgucY023A== 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: No longer used, let's remove it and clarify RMAP_NONE/RMAP_EXCLUSIVE a bit. Signed-off-by: David Hildenbrand --- include/linux/rmap.h | 12 +++--------- mm/rmap.c | 2 -- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/include/linux/rmap.h b/include/linux/rmap.h index fe7b5a8b0e75b..bf6cb79aa7a0a 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -177,20 +177,14 @@ struct anon_vma *folio_get_anon_vma(struct folio *folio); typedef int __bitwise rmap_t; /* - * No special request: if the page is a subpage of a compound page, it is - * mapped via a PTE. The mapped (sub)page is possibly shared between processes. + * No special request: A mapped anonymous (sub)page is possibly shared between + * processes. */ #define RMAP_NONE ((__force rmap_t)0) -/* The (sub)page is exclusive to a single process. */ +/* The anonymous (sub)page is exclusive to a single process. */ #define RMAP_EXCLUSIVE ((__force rmap_t)BIT(0)) -/* - * The compound page is not mapped via PTEs, but instead via a single PMD and - * should be accounted accordingly. - */ -#define RMAP_COMPOUND ((__force rmap_t)BIT(1)) - /* * Internally, we're using an enum to specify the granularity. We make the * compiler emit specialized code for each granularity. diff --git a/mm/rmap.c b/mm/rmap.c index 87415bbf24022..2b386b9f6791c 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -2662,8 +2662,6 @@ void rmap_walk_locked(struct folio *folio, struct rmap_walk_control *rwc) * The following two functions are for anonymous (private mapped) hugepages. * Unlike common anonymous pages, anonymous hugepages have no accounting code * and no lru code, because we handle hugepages differently from common pages. - * - * RMAP_COMPOUND is ignored. */ void hugetlb_add_anon_rmap(struct folio *folio, struct vm_area_struct *vma, unsigned long address, rmap_t flags)