From patchwork Wed Sep 13 12:51:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13382961 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 7FA1AEDEC4E for ; Wed, 13 Sep 2023 12:51:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DEA5A6B0181; Wed, 13 Sep 2023 08:51:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D735D6B0182; Wed, 13 Sep 2023 08:51:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C141E6B0184; Wed, 13 Sep 2023 08:51:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A3FB16B0181 for ; Wed, 13 Sep 2023 08:51:25 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7EC9640642 for ; Wed, 13 Sep 2023 12:51:25 +0000 (UTC) X-FDA: 81231560130.13.17A27EC Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf06.hostedemail.com (Postfix) with ESMTP id D49F918000A for ; Wed, 13 Sep 2023 12:51:23 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OI44+GwW; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf06.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=1694609483; 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=fcwyuEyPhUjibl+UPXTZ+YZfX1YncqC+LcRBkk4rhVQ=; b=287/Kev/NLNBv/KDzlzO+gftXZXjyHqwNb6dnPKiAyEyLHwvfqc5iPt7eceLJHmC506YmG WdF1yV1dhaeY7IgyezisH04shLVnzoGtQJt0uv1Kal3lo7lh8tNbJJu4urzhT1n+9Ophd/ 8EgwtpDzD4PjdDC6wenajYRtRNJoeVI= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OI44+GwW; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf06.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=1694609483; a=rsa-sha256; cv=none; b=3FXjyt6LLapaByKY0f8x0LRbfN5z73nQcUtocIHKaT8gZF9aPHbJ3yh7eH5Jkixe07L9Mi aciavhcPSIDC+IaEn9VQtX9PD57NEVaXijEiZ/2GSojl87CJdrxonjKro8DESawCk0oHcJ 7Bi6shXLvcXo5JotUY4ywoXVGZZvLgw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694609483; 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=fcwyuEyPhUjibl+UPXTZ+YZfX1YncqC+LcRBkk4rhVQ=; b=OI44+GwW42BRP21Kz5zKlTFCEY65VufyoAUEm5ENXOY9znlgEIbkeG9BcUyjnJ57pitClC 8s7PI7sZt+RgN8ru/TS7SoFIipEikVnv5T/3dgLAVp3RJsFi8bj9smfT5XfCbcLzg0iOAE 7CgoPpw6gf1fq8qZnRLf1BJjySGYvek= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-664-skkLD7dfNDCSC0zIh01gyA-1; Wed, 13 Sep 2023 08:51:19 -0400 X-MC-Unique: skkLD7dfNDCSC0zIh01gyA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3CA79857A9A; Wed, 13 Sep 2023 12:51:19 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.193.225]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FF2D2156721; Wed, 13 Sep 2023 12:51:17 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Mike Kravetz , Muchun Song Subject: [PATCH v1 1/6] mm/rmap: drop stale comment in page_add_anon_rmap and hugepage_add_anon_rmap() Date: Wed, 13 Sep 2023 14:51:08 +0200 Message-ID: <20230913125113.313322-2-david@redhat.com> In-Reply-To: <20230913125113.313322-1-david@redhat.com> References: <20230913125113.313322-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Rspamd-Queue-Id: D49F918000A X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: bdt1asocc973nkkro95dygpjx69gd89r X-HE-Tag: 1694609483-248354 X-HE-Meta: U2FsdGVkX18tgq/x4+LnOnhy7v4j8PMQ8i3NL4tIPWDuPN+zaZAs8VL0n+w54TSIrUbGpBw85CiDGW6j3EQx7xPuN7k6gmPFO3d0yVf1f3jqNbxWnCSNKN+DTeQXysV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8Q== 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: That comment was added in commit 5dbe0af47f8a ("mm: fix kernel BUG at mm/rmap.c:1017!") to document why we can see vma->vm_end getting adjusted concurrently due to a VMA split. However, the optimized locking code was changed again in bf181b9f9d8 ("mm anon rmap: replace same_anon_vma linked list with an interval tree."). ... and later, the comment was changed in commit 0503ea8f5ba7 ("mm/mmap: remove __vma_adjust()") to talk about "vma_merge" although the original issue was with VMA splitting. Let's just remove that comment. Nowadays, it's outdated, imprecise and confusing. Signed-off-by: David Hildenbrand --- mm/rmap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/rmap.c b/mm/rmap.c index ec7f8e6c9e48..ca2787c1fe05 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1245,7 +1245,6 @@ void page_add_anon_rmap(struct page *page, struct vm_area_struct *vma, __lruvec_stat_mod_folio(folio, NR_ANON_MAPPED, nr); if (likely(!folio_test_ksm(folio))) { - /* address might be in next vma when migration races vma_merge */ if (first) __page_set_anon_rmap(folio, page, vma, address, !!(flags & RMAP_EXCLUSIVE)); @@ -2536,7 +2535,6 @@ void hugepage_add_anon_rmap(struct page *page, struct vm_area_struct *vma, BUG_ON(!folio_test_locked(folio)); BUG_ON(!anon_vma); - /* address might be in next vma when migration races vma_merge */ first = atomic_inc_and_test(&folio->_entire_mapcount); VM_BUG_ON_PAGE(!first && (flags & RMAP_EXCLUSIVE), page); VM_BUG_ON_PAGE(!first && PageAnonExclusive(page), page);