From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.6 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10877C07E95 for ; Wed, 7 Jul 2021 20:06:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA24461CC2 for ; Wed, 7 Jul 2021 20:06:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233100AbhGGUJU (ORCPT ); Wed, 7 Jul 2021 16:09:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230296AbhGGUJS (ORCPT ); Wed, 7 Jul 2021 16:09:18 -0400 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C268C061574 for ; Wed, 7 Jul 2021 13:06:36 -0700 (PDT) Received: by mail-oo1-xc29.google.com with SMTP id 128-20020a4a11860000b029024b19a4d98eso801926ooc.5 for ; Wed, 07 Jul 2021 13:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version; bh=6qeso0vnhBwFs3iCYpWzxPK0i6KQqKKfr8ULWEkbKXE=; b=E4XHqX1GTIF3abK36LazO2Q/rAwhiw0uDpwxHRBjNPI0ptyVYh43DYr17icgNSzNtB 0/l/8Pqy8JjsnqgavgUC69qzF0JNtN+UGO1Hb1cDGMQOkF2hSSx6+RbyIHdblu2e26dB 3ObW5x1VTMLukGemHCj8VN/+JPYeOwwkBEnNJZKDlQPpkB+2g4uHfB+yRj19WmejuxrQ C1NyxojgX1ducwOiw4uUespqSgx8+tGJSDH8u5fhcG1l/EcTS3AudTXMYxx3bgpMmFZq WlTEGxCDfxB9UXGyu0goYz33hEhKhJYCWR04ludzqgYKCiID6ohesXIVBi22LvODtxZU 6woQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version; bh=6qeso0vnhBwFs3iCYpWzxPK0i6KQqKKfr8ULWEkbKXE=; b=R+4hRt8RZbRIc9+IfkSXBqOVuGK+8NYrAq58ZZyqDJDJpmfD/Mn2tt8nFJR7frxJGT +MyBstMRcNkbbRqktt5D+yhPuuIcU94O95sWKTW9KVqjkunDqI/gmXpr/6KIIobON/WF LYEL2J4AdYPh5HyLaSonfN+A07zEJNw6PwagExXieQAwhSOyyAkb/sCHT9tpBgdONGAE k8XxNYjoZpvHrg8QD/my5urY+wb4YihfZaskZXZcDmb5RHsBSwwKX+uIc7buXmMrJfKl cXMbkm+IFXyrzaahDhE4UYr+JXjgMgifIQLNP+jUVuEVx6gimxybXRkpwQVRFjM6N4lV yGng== X-Gm-Message-State: AOAM530mfgJ1g/zuD8GtWBA+JgWDym+MUOEv1HWTpi4aIuYf3uvxpqKW Pkx9soLffSaZwZgtxt6815phXQ== X-Google-Smtp-Source: ABdhPJyi4Lm5LdstNhafbuakxVCafg4zCdocLCQA6UnRmid6Qr2q0/4YqFwgBUmok/SVzq5TKaqulg== X-Received: by 2002:a4a:9e02:: with SMTP id t2mr19518865ook.73.1625688395773; Wed, 07 Jul 2021 13:06:35 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id x29sm3635856ooj.10.2021.07.07.13.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 13:06:35 -0700 (PDT) Date: Wed, 7 Jul 2021 13:06:17 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Andrew Morton cc: Hugh Dickins , Alistair Popple , Jason Gunthorpe , Ralph Campbell , Christoph Hellwig , Yang Shi , "Kirill A. Shutemov" , Shakeel Butt , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/4] mm/rmap: fix comments left over from recent changes Message-ID: <563ce5b2-7a44-5b4d-1dfd-59a0e65932a9@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Parallel developments in mm/rmap.c have left behind some out-of-date comments: try_to_migrate_one() also accepts TTU_SYNC (already commented in try_to_migrate() itself), and try_to_migrate() returns nothing at all. TTU_SPLIT_FREEZE has just been deleted, so reword the comment about it in mm/huge_memory.c; and TTU_IGNORE_ACCESS was removed in 5.11, so delete the "recently referenced" comment from try_to_unmap_one() (once upon a time the comment was near the removed codeblock, but they drifted apart). Signed-off-by: Hugh Dickins --- mm/huge_memory.c | 2 +- mm/rmap.c | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 8b731d53e9f4..afff3ac87067 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2331,7 +2331,7 @@ static void remap_page(struct page *page, unsigned int nr) { int i; - /* If TTU_SPLIT_FREEZE is ever extended to file, remove this check */ + /* If unmap_page() uses try_to_migrate() on file, remove this check */ if (!PageAnon(page)) return; if (PageTransHuge(page)) { diff --git a/mm/rmap.c b/mm/rmap.c index 37c24672125c..746013e282c3 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1439,8 +1439,6 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma, while (page_vma_mapped_walk(&pvmw)) { /* * If the page is mlock()d, we cannot swap it out. - * If it's recently referenced (perhaps page_referenced - * skipped over this mm) then we should reactivate it. */ if (!(flags & TTU_IGNORE_MLOCK)) { if (vma->vm_flags & VM_LOCKED) { @@ -1687,8 +1685,7 @@ void try_to_unmap(struct page *page, enum ttu_flags flags) * @arg: enum ttu_flags will be passed to this argument. * * If TTU_SPLIT_HUGE_PMD is specified any PMD mappings will be split into PTEs - * containing migration entries. This and TTU_RMAP_LOCKED are the only supported - * flags. + * containing migration entries. */ static bool try_to_migrate_one(struct page *page, struct vm_area_struct *vma, unsigned long address, void *arg) @@ -1928,8 +1925,6 @@ static bool try_to_migrate_one(struct page *page, struct vm_area_struct *vma, * * Tries to remove all the page table entries which are mapping this page and * replace them with special swap entries. Caller must hold the page lock. - * - * If is successful, return true. Otherwise, false. */ void try_to_migrate(struct page *page, enum ttu_flags flags) { -- 2.26.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.6 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1317CC07E95 for ; Wed, 7 Jul 2021 20:06:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8A25561CC2 for ; Wed, 7 Jul 2021 20:06:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A25561CC2 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0CD9A6B0011; Wed, 7 Jul 2021 16:06:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 07DDB6B005D; Wed, 7 Jul 2021 16:06:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E38CE6B006C; Wed, 7 Jul 2021 16:06:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id B60B76B0011 for ; Wed, 7 Jul 2021 16:06:37 -0400 (EDT) Received: from smtpin37.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1BEC623116 for ; Wed, 7 Jul 2021 20:06:37 +0000 (UTC) X-FDA: 78336874434.37.086CA16 Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) by imf18.hostedemail.com (Postfix) with ESMTP id B2362400208B for ; Wed, 7 Jul 2021 20:06:36 +0000 (UTC) Received: by mail-oo1-f50.google.com with SMTP id h8-20020a4ad0080000b029025b08dc951fso348045oor.9 for ; Wed, 07 Jul 2021 13:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version; bh=6qeso0vnhBwFs3iCYpWzxPK0i6KQqKKfr8ULWEkbKXE=; b=E4XHqX1GTIF3abK36LazO2Q/rAwhiw0uDpwxHRBjNPI0ptyVYh43DYr17icgNSzNtB 0/l/8Pqy8JjsnqgavgUC69qzF0JNtN+UGO1Hb1cDGMQOkF2hSSx6+RbyIHdblu2e26dB 3ObW5x1VTMLukGemHCj8VN/+JPYeOwwkBEnNJZKDlQPpkB+2g4uHfB+yRj19WmejuxrQ C1NyxojgX1ducwOiw4uUespqSgx8+tGJSDH8u5fhcG1l/EcTS3AudTXMYxx3bgpMmFZq WlTEGxCDfxB9UXGyu0goYz33hEhKhJYCWR04ludzqgYKCiID6ohesXIVBi22LvODtxZU 6woQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version; bh=6qeso0vnhBwFs3iCYpWzxPK0i6KQqKKfr8ULWEkbKXE=; b=CLJjaczonZTjxmUQeUN2++J6KCo8jswrgX6ER7PUlecmMmFmEmprEYDHheCpkNxw9f 5O6aWXxRYMEu2QBtvXW9pQQrK5GkZhxuB+whYNJbLXA2f28FYFwaPzRelnlGNl5wVRpw Z0Eoh8IEhkOP0qdqfvw1RGzdbAtDCGqWANbSPCBnINK+GhwT4Ak3zp/4t+ALeLatAOf0 I76HaAERt5kjmBe7SFuQYtofu4AaowJBJIF1SNKNeWHfpU7ewWTTbpxhqZQhnw4y6Xn1 jdBEVzh1mVopsVX7jiFXgsdp7/NJl6OPWSxAKORQNQlVQBBMP/9dXWKy58NvGBHAKnih ZJZQ== X-Gm-Message-State: AOAM53098S/9vKEJI5p8HuW+N8A6QJH+gcqlu85EL6kWwimIIaXrR3rm HIVAXcB47jezDLhQq1zBJkPZEA== X-Google-Smtp-Source: ABdhPJyi4Lm5LdstNhafbuakxVCafg4zCdocLCQA6UnRmid6Qr2q0/4YqFwgBUmok/SVzq5TKaqulg== X-Received: by 2002:a4a:9e02:: with SMTP id t2mr19518865ook.73.1625688395773; Wed, 07 Jul 2021 13:06:35 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id x29sm3635856ooj.10.2021.07.07.13.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 13:06:35 -0700 (PDT) Date: Wed, 7 Jul 2021 13:06:17 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Andrew Morton cc: Hugh Dickins , Alistair Popple , Jason Gunthorpe , Ralph Campbell , Christoph Hellwig , Yang Shi , "Kirill A. Shutemov" , Shakeel Butt , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/4] mm/rmap: fix comments left over from recent changes Message-ID: <563ce5b2-7a44-5b4d-1dfd-59a0e65932a9@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspam-User: nil Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=E4XHqX1G; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf18.hostedemail.com: domain of hughd@google.com designates 209.85.161.50 as permitted sender) smtp.mailfrom=hughd@google.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B2362400208B X-Stat-Signature: 3eu5geke74gq7tfuhpzcqks8ksod9pj7 X-HE-Tag: 1625688396-346393 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: Parallel developments in mm/rmap.c have left behind some out-of-date comments: try_to_migrate_one() also accepts TTU_SYNC (already commented in try_to_migrate() itself), and try_to_migrate() returns nothing at all. TTU_SPLIT_FREEZE has just been deleted, so reword the comment about it in mm/huge_memory.c; and TTU_IGNORE_ACCESS was removed in 5.11, so delete the "recently referenced" comment from try_to_unmap_one() (once upon a time the comment was near the removed codeblock, but they drifted apart). Signed-off-by: Hugh Dickins --- mm/huge_memory.c | 2 +- mm/rmap.c | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 8b731d53e9f4..afff3ac87067 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2331,7 +2331,7 @@ static void remap_page(struct page *page, unsigned int nr) { int i; - /* If TTU_SPLIT_FREEZE is ever extended to file, remove this check */ + /* If unmap_page() uses try_to_migrate() on file, remove this check */ if (!PageAnon(page)) return; if (PageTransHuge(page)) { diff --git a/mm/rmap.c b/mm/rmap.c index 37c24672125c..746013e282c3 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1439,8 +1439,6 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma, while (page_vma_mapped_walk(&pvmw)) { /* * If the page is mlock()d, we cannot swap it out. - * If it's recently referenced (perhaps page_referenced - * skipped over this mm) then we should reactivate it. */ if (!(flags & TTU_IGNORE_MLOCK)) { if (vma->vm_flags & VM_LOCKED) { @@ -1687,8 +1685,7 @@ void try_to_unmap(struct page *page, enum ttu_flags flags) * @arg: enum ttu_flags will be passed to this argument. * * If TTU_SPLIT_HUGE_PMD is specified any PMD mappings will be split into PTEs - * containing migration entries. This and TTU_RMAP_LOCKED are the only supported - * flags. + * containing migration entries. */ static bool try_to_migrate_one(struct page *page, struct vm_area_struct *vma, unsigned long address, void *arg) @@ -1928,8 +1925,6 @@ static bool try_to_migrate_one(struct page *page, struct vm_area_struct *vma, * * Tries to remove all the page table entries which are mapping this page and * replace them with special swap entries. Caller must hold the page lock. - * - * If is successful, return true. Otherwise, false. */ void try_to_migrate(struct page *page, enum ttu_flags flags) { -- 2.26.2