Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp80348iof; Sun, 5 Jun 2022 21:44:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpYrQNdg7pohmhL66KSKO9SMK4asJqmHb9r//AZaX/7Ou+CmhmKAE3fNtenhYcv75O+mxK X-Received: by 2002:a63:4a4b:0:b0:3fa:8a72:b2 with SMTP id j11-20020a634a4b000000b003fa8a7200b2mr19697725pgl.544.1654490695155; Sun, 05 Jun 2022 21:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654490695; cv=none; d=google.com; s=arc-20160816; b=YieHplsOeNwwqP/BvIKHBh28KakYwcatq4mhkMesrPOit9bMXaATLl7Oi+RfGaDDle rPOVDW8dMzWH8puCBqr/pe2uA8DElbiWGTW4XfYChF8ikiXMuOOe+q+jrjngQfPOb6nx dV5C8d5Jozs3is1il/69n9+LLtGR6x9FDUXAXz1QquJssF2PqyGe8fV1bfqkccmbC5b+ VXvPPlPlYWNTyyQt4m6glB6gUx+YbPIkuzaygMHpQ318kl9DxKD7hjc/noy5KYtV3ztJ NcBAiGjVn3tRUVE9nRQPIk0cfOHKVyGjFTS3QJGZUCeVpersh2WJ6tr4FVSvo3PwlQZ6 Ipyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nZd7FdfhHHpfkPZj2gtn0+UCb6ZHZaprTIaRzyl1jXk=; b=jxjl/MgFChMldBSu97ig3bhYffS4TInfkTCMG1VSrLi11BzV+yaVlxOADTXRfY3Jgn 7qfqBHi1HUq10QiekqZA1YX51DiDesj/Oa3I8W2oJt1FMuaecsWS1TvMliyW23ouyiwc Fpi+PyeqwECIDB/wi9bWwEoe/biD1JBprOBdtnT3VaEZljoU5uqmIqViS0MYlKw/puva s3AER9Z1nTWK/tklzsh2WntALQxDihvStVRx2Fa2hXu1gcUb/adMP4ch4J3Bm8LcXdPy vGyFakNDC1s5ElABcr4P03oPxLOi61tzeAEAEr7tH7vRVQ8vb0OfaW5+aLCwf7udEPx6 GvhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uFlx6IYC; spf=softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p13-20020a170902b08d00b00161da9616edsi17015424plr.153.2022.06.05.21.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:44:55 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uFlx6IYC; spf=softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C0D9713FA3; Sun, 5 Jun 2022 21:03:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348585AbiFETjU (ORCPT + 99 others); Sun, 5 Jun 2022 15:39:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351592AbiFETjS (ORCPT ); Sun, 5 Jun 2022 15:39:18 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4882C4D62C; Sun, 5 Jun 2022 12:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=nZd7FdfhHHpfkPZj2gtn0+UCb6ZHZaprTIaRzyl1jXk=; b=uFlx6IYCw7cKUMv6UFQU0NiN2j iQ24sV1L+N0JJ+PYt+whKlcyMvxX397wDiXAeuW16ipXpv7uj75S+ifah7UED1rGBmJ6INgUn0EaP +9Vs3ySStr9qIgZ0zF6RDK7wq0A7Z8UrY0v2gbCiqtYZYhxFzeNL/2ggxHjmv6qm+147lvrX2dSYA KrGPUqo5c0kBsr1HE5k1I7rfjNq5kWWJNZbU41W0uuZJbmiuIPzLxEOUcBBG4y5IcjIH3D5ekaRwS R4P3XSnF1YkMw+gsOSK1a5dkmx/misM3DKGpZBhb7qWzj2lws1FAo2SU2BuaoFyWnchKohsh2xIzm dolxg0Dg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxw5R-009wsf-8D; Sun, 05 Jun 2022 19:38:57 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org, linux-nilfs@vger.kernel.org Subject: [PATCH 09/10] shmem: Convert shmem_unlock_mapping() to use filemap_get_folios() Date: Sun, 5 Jun 2022 20:38:53 +0100 Message-Id: <20220605193854.2371230-10-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220605193854.2371230-1-willy@infradead.org> References: <20220605193854.2371230-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,SUSPICIOUS_RECIPS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org This is a straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) --- mm/shmem.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 60fdfc0208fd..313ae7df59d8 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -867,18 +867,17 @@ unsigned long shmem_swap_usage(struct vm_area_struct *vma) */ void shmem_unlock_mapping(struct address_space *mapping) { - struct pagevec pvec; + struct folio_batch fbatch; pgoff_t index = 0; - pagevec_init(&pvec); + folio_batch_init(&fbatch); /* * Minor point, but we might as well stop if someone else SHM_LOCKs it. */ - while (!mapping_unevictable(mapping)) { - if (!pagevec_lookup(&pvec, mapping, &index)) - break; - check_move_unevictable_pages(&pvec); - pagevec_release(&pvec); + while (!mapping_unevictable(mapping) && + filemap_get_folios(mapping, &index, ~0UL, &fbatch)) { + check_move_unevictable_folios(&fbatch); + folio_batch_release(&fbatch); cond_resched(); } } -- 2.35.1