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=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 2D84CC433DF for ; Mon, 29 Jun 2020 18:33:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E7C82255D8 for ; Mon, 29 Jun 2020 18:33:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="IheCnqGz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7C82255D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 70A038D0009; Mon, 29 Jun 2020 14:33:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6BC838D0005; Mon, 29 Jun 2020 14:33:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D0768D0009; Mon, 29 Jun 2020 14:33:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 440AE8D0005 for ; Mon, 29 Jun 2020 14:33:01 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D31A12DFC for ; Mon, 29 Jun 2020 18:33:00 +0000 (UTC) X-FDA: 76983096120.21.juice95_3e12f8226e71 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id C72E7180445F4 for ; Mon, 29 Jun 2020 18:32:39 +0000 (UTC) X-HE-Tag: juice95_3e12f8226e71 X-Filterd-Recvd-Size: 3829 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Mon, 29 Jun 2020 18:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=y0krb9teudPRh5wBThYONBp+1hvAAJWXWz0XE5GFT9Y=; b=IheCnqGzszyfBG86ok2ZvWBYOt uQMOPI4vVNjzvMifEYAB/3bKNeFPOnGr4lq2DU6UYO93BrtWmTfWpHVMQ5fermTIFfIJBzve4te3Z CCYIgLLFDNKyIbFD2Q6yRGzLYXBSMYV8CHkazRz2u/8gPL2s24+jUqmL9VXC4ZREJsA7gHJHB2eMF ro9hbMP1BAllUkZ0JMXqlHO0kHR5ws2pt1fX1OZHbPU6NcexDlrLCliadfQCbkfoPBcjMVx674xUa KAkhH5j55dtucl4ktjQlkGEB7pxQ03xTKZb1Kpv13gkP6o6W5SYd/8MdcOS4p6U2T7zGH7i4i4vdf 5mC+lQBw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpyZw-0006St-Dm; Mon, 29 Jun 2020 18:32:28 +0000 Date: Mon, 29 Jun 2020 19:32:28 +0100 From: Matthew Wilcox To: Mike Kravetz Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH 5/7] mm: Replace hpage_nr_pages with thp_nr_pages Message-ID: <20200629183228.GH25523@casper.infradead.org> References: <20200629151959.15779-1-willy@infradead.org> <20200629151959.15779-6-willy@infradead.org> <8bf5ae79-eace-5345-1a77-69d9e2e083b3@oracle.com> <20200629181440.GG25523@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200629181440.GG25523@casper.infradead.org> X-Rspamd-Queue-Id: C72E7180445F4 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: On Mon, Jun 29, 2020 at 07:14:40PM +0100, Matthew Wilcox wrote: > Thank you! Clearly I wasn't thinking about this patch and just did a > mindless search-and-replace! I should evaluate the other places where > I did this and see if any of them are wrong too. add_page_to_lru_list() and friends -- safe. hugetlbfs doesn't use the LRU lists. find_subpage() -- safe. hugetlbfs has already returned by this point. readahead_page() and friends -- safe. hugetlbfs doesn't readahead. isolate_migratepages_block() -- probably safe. I don't think hugetlbfs pages are migratable, and it calls del_page_from_lru_list(), so I infer hugetlbfs doesn't reach this point. unaccount_page_cache_page() -- safe. hugetlbfs has already returned by this point. check_and_migrate_cma_pages() -- CMA pages aren't hugetlbfs pages. mlock_migrate_page() -- not used for hugetlbfs. mem_cgroup_move_account() mem_cgroup_charge() mem_cgroup_migrate() mem_cgroup_swapout() mem_cgroup_try_charge_swap() -- I don't think memory cgroups control hugetlbfs pages. do_migrate_range() -- explicitly not in the hugetlb arm of this if statement migrate_page_add() -- Assumes LRU putback_movable_pages() -- Also LRU expected_page_refs() migrate_page_move_mapping() copy_huge_page() unmap_and_move() add_page_for_migration() numamigrate_isolate_page() -- more page migration mlock.c: This is all related to being on the LRU list page_io.c: We don't swap out hugetlbfs pages pfn_is_match() -- Already returned from this function for hugetlbfs pages do_page_add_anon_rmap() page_add_new_anon_rmap() rmap_walk_anon() -- hugetlbfs pages aren't anon. rmap_walk_file() -- This one I'm unsure about. There's explicit support for hugetlbfs elsewhere in the file, and maybe this is never called for hugetlb pages. Help? swap.c, swap_state.c, swapfile.c: No swap for hugetlbfs pages. vmscan.c: hugetlbfs pages not on the LRUs workingset.c: hugetlbfs pages not on the LRUs So I think you found the only bug of this type, although I'm a little unsure about the rmap_walk_file().