From patchwork Fri Nov 18 07:30:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 22157 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp45887wrr; Thu, 17 Nov 2022 23:32:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf7hIOF71RU6SaPsZWLRA3mpnh4o5K/UhEDQuiKgEypeOaLL/hUHRhMRQV57IfrfRrx2ADR5 X-Received: by 2002:a63:d751:0:b0:46f:f87c:fb1a with SMTP id w17-20020a63d751000000b0046ff87cfb1amr5619391pgi.214.1668756720311; Thu, 17 Nov 2022 23:32:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668756720; cv=none; d=google.com; s=arc-20160816; b=ZMab/1J992B3r/y00GDyoI5hz6l08tXyz1KG4CHxc/aU48iOxnFkuHOhG85ysnZH+f DSPHqsbqlamG/fSAzuxIH+aQP7dlhO+D/O1dB+p6L82MPFuVg1h2Eh/Xv4+WGTOsRO8M X4GkSF7R95K1HgrXS+SvbbhWDDDMDF8Bhxdgu5lvY6Onx9SAOQa8HbNjKtKRlaAe52Lf 34esFN/cpNPcMfeiam3RL/3DqjBpVnS5dgK5R5+ZgV7YvcVytZ/P/IsXBYE60kShBuQW kN0pdp43cJFmmlBbfp+dZLWTJ0gGyQvyUs/lJORDXoUd0tHXCkEiKoCUvuh9fEuubEh3 0VCw== 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=Re0/IOxZf5Hx6BeFa9inJCF0a6cGKdlu1k/P2sxW8QU=; b=FGvFF8daiWn9v+B8SeW4UCWrwsmaUyN3i/2WTSQkvO44TugATKnkLWLNeS7pqZjNXN OF5eOupWij4+hi71bwraQPCb84Dg9c50dTnB8ffDpOxo3lYgEVbGlLL84y2RFclL6YRH Jm9c6IrhyT3oHDtD0lLj6D+woObP1n4EGb6oRurRi3Fffxl71SjlVXmWL1e5yGBmOmFQ htjKI+ZqI0Gy0hy2EHWn+UzYK9l7mq/CmLEYGVms3pHRPjfG1bvFZu01zDf3xnik7y7S bJAS3DEx804cM1J8G/8GpN0R98AZH9XRih50Kykaf11lecYPjDdR/65WOP+Alpw9IvJ9 57yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JbqHqUy5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id om14-20020a17090b3a8e00b0020bbfb294a1si7595560pjb.174.2022.11.17.23.31.47; Thu, 17 Nov 2022 23:32:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JbqHqUy5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241217AbiKRHbN (ORCPT + 99 others); Fri, 18 Nov 2022 02:31:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241118AbiKRHbC (ORCPT ); Fri, 18 Nov 2022 02:31:02 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA0BD205EF; Thu, 17 Nov 2022 23:31:00 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id 6so4298036pgm.6; Thu, 17 Nov 2022 23:31:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Re0/IOxZf5Hx6BeFa9inJCF0a6cGKdlu1k/P2sxW8QU=; b=JbqHqUy5gwXZXXmeVcz1VjkFSML8VbgCJWNNoIeSydHy4Efkp/nj8IFLHy4/PRyQHV ZD3+lwCTNEDhNf9veaDSLhz7j3rTE4dSA4jeOiZEUCQyws3Y+MXRKm5Dx6naoty++WGj mgSMypdnxVTv66L8q6FElC2UoiRdmhg+l5LTbN2Cc3AqtbTaJnJbry0nqqNvt41WohIs ztjkEsGC3JY6Tb7yMLuQkZ4ruAJGVqCUBWYkGv/ejG/TxtUngfWOAkENVYlHfIHeipzE 4EaQZm6twldEsxve4TG9hLLt2BHQD5Wol13hE8LCOU9klaLw9axg+PJfCy1uLkMcLHnC TDyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Re0/IOxZf5Hx6BeFa9inJCF0a6cGKdlu1k/P2sxW8QU=; b=Ssipmmnta0bunipCbxktQBOE47EAyjYu+/r9/xdaWlKIeLIzCqiwiLisJUvIS0Xc8N 3hJ2RVDMDHtBR67pBuI7TMvShOSzqTViLxI2F7LbjGSzs+rctjvSb6UegdNB34cVVAF/ SUIqnku2xMDSj+s58iJZOXDQSoE/OWnCsHL0sDcTshnUupX1P0YqJ6zK7UYm7Dr8eHYP xptpf5/thfGXSy4+Pd9lUce5KQ1bRg0GKNzY8C5q1VoTXz3CyaeqetfN0ohA9f+HHabA HJHth5VXySsLH9pzpCV4g2cKZOhbjlQSwQb7s3PPA+1z0Skq5s94T89cLLRT9S+fEd/n qGIA== X-Gm-Message-State: ANoB5pm5zyiwE8LghfEr3TAiLyTUQoEFVL1+zQvckmQo6v4SKzqKKZMk Bb2SkXBKW0ZUj6PnInIBOagaK/EVj/QzBw== X-Received: by 2002:a63:2117:0:b0:474:f7bd:9462 with SMTP id h23-20020a632117000000b00474f7bd9462mr5417655pgh.189.1668756660244; Thu, 17 Nov 2022 23:31:00 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id f7-20020a625107000000b0056b818142a2sm2424325pfb.109.2022.11.17.23.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 23:30:59 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, akpm@linux-foundation.org, willy@infradead.org, naoya.horiguchi@nec.com, tytso@mit.edu, "Vishal Moola (Oracle)" Subject: [PATCH v3 1/4] ext4: Convert move_extent_per_page() to use folios Date: Thu, 17 Nov 2022 23:30:52 -0800 Message-Id: <20221118073055.55694-2-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118073055.55694-1-vishal.moola@gmail.com> References: <20221118073055.55694-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749818246910298532?= X-GMAIL-MSGID: =?utf-8?q?1749818246910298532?= Converts move_extent_per_page() to use folios. This change removes 5 calls to compound_head() and is in preparation for the removal of the try_to_release_page() wrapper. Signed-off-by: Vishal Moola (Oracle) --- fs/ext4/move_extent.c | 52 ++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index 044e34cd835c..8dbb87edf24c 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c @@ -253,6 +253,7 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode, { struct inode *orig_inode = file_inode(o_filp); struct page *pagep[2] = {NULL, NULL}; + struct folio *folio[2] = {NULL, NULL}; handle_t *handle; ext4_lblk_t orig_blk_offset, donor_blk_offset; unsigned long blocksize = orig_inode->i_sb->s_blocksize; @@ -313,6 +314,13 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode, * hold page's lock, if it is still the case data copy is not * necessary, just swap data blocks between orig and donor. */ + folio[0] = page_folio(pagep[0]); + folio[1] = page_folio(pagep[1]); + + VM_BUG_ON_FOLIO(folio_test_large(folio[0]), folio[0]); + VM_BUG_ON_FOLIO(folio_test_large(folio[1]), folio[1]); + VM_BUG_ON_FOLIO(folio_nr_pages(folio[0]) != folio_nr_pages(folio[1]), folio[1]); + if (unwritten) { ext4_double_down_write_data_sem(orig_inode, donor_inode); /* If any of extents in range became initialized we have to @@ -331,10 +339,10 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode, ext4_double_up_write_data_sem(orig_inode, donor_inode); goto data_copy; } - if ((page_has_private(pagep[0]) && - !try_to_release_page(pagep[0], 0)) || - (page_has_private(pagep[1]) && - !try_to_release_page(pagep[1], 0))) { + if ((folio_has_private(folio[0]) && + !filemap_release_folio(folio[0], 0)) || + (folio_has_private(folio[1]) && + !filemap_release_folio(folio[1], 0))) { *err = -EBUSY; goto drop_data_sem; } @@ -344,19 +352,21 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode, block_len_in_page, 1, err); drop_data_sem: ext4_double_up_write_data_sem(orig_inode, donor_inode); - goto unlock_pages; + goto unlock_folios; } data_copy: - *err = mext_page_mkuptodate(pagep[0], from, from + replaced_size); + *err = mext_page_mkuptodate(&folio[0]->page, from, from + replaced_size); if (*err) - goto unlock_pages; + goto unlock_folios; /* At this point all buffers in range are uptodate, old mapping layout * is no longer required, try to drop it now. */ - if ((page_has_private(pagep[0]) && !try_to_release_page(pagep[0], 0)) || - (page_has_private(pagep[1]) && !try_to_release_page(pagep[1], 0))) { + if ((folio_has_private(folio[0]) && + !filemap_release_folio(folio[0], 0)) || + (folio_has_private(folio[1]) && + !filemap_release_folio(folio[1], 0))) { *err = -EBUSY; - goto unlock_pages; + goto unlock_folios; } ext4_double_down_write_data_sem(orig_inode, donor_inode); replaced_count = ext4_swap_extents(handle, orig_inode, donor_inode, @@ -369,13 +379,13 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode, replaced_size = block_len_in_page << orig_inode->i_blkbits; } else - goto unlock_pages; + goto unlock_folios; } /* Perform all necessary steps similar write_begin()/write_end() * but keeping in mind that i_size will not change */ - if (!page_has_buffers(pagep[0])) - create_empty_buffers(pagep[0], 1 << orig_inode->i_blkbits, 0); - bh = page_buffers(pagep[0]); + if (!folio_buffers(folio[0])) + create_empty_buffers(&folio[0]->page, 1 << orig_inode->i_blkbits, 0); + bh = folio_buffers(folio[0]); for (i = 0; i < data_offset_in_page; i++) bh = bh->b_this_page; for (i = 0; i < block_len_in_page; i++) { @@ -385,7 +395,7 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode, bh = bh->b_this_page; } if (!*err) - *err = block_commit_write(pagep[0], from, from + replaced_size); + *err = block_commit_write(&folio[0]->page, from, from + replaced_size); if (unlikely(*err < 0)) goto repair_branches; @@ -395,11 +405,11 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode, *err = ext4_jbd2_inode_add_write(handle, orig_inode, (loff_t)orig_page_offset << PAGE_SHIFT, replaced_size); -unlock_pages: - unlock_page(pagep[0]); - put_page(pagep[0]); - unlock_page(pagep[1]); - put_page(pagep[1]); +unlock_folios: + folio_unlock(folio[0]); + folio_put(folio[0]); + folio_unlock(folio[1]); + folio_put(folio[1]); stop_journal: ext4_journal_stop(handle); if (*err == -ENOSPC && @@ -430,7 +440,7 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode, *err = -EIO; } replaced_count = 0; - goto unlock_pages; + goto unlock_folios; } /** From patchwork Fri Nov 18 07:30:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 22158 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp45999wrr; Thu, 17 Nov 2022 23:32:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf4aedfZfjofp4DgnUDbIrtVnllJHp6K3uyIDiBlpyGppFhj/YXa3xRTj8LbG1OUW2P+BhRY X-Received: by 2002:a63:f5a:0:b0:43c:428d:1701 with SMTP id 26-20020a630f5a000000b0043c428d1701mr5444200pgp.307.1668756746555; Thu, 17 Nov 2022 23:32:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668756746; cv=none; d=google.com; s=arc-20160816; b=bnQz8ctrdw2YVg4eYiFRwtgZROjJ85IMweWIR3nwshd6pXdu5VuRaogHRvr3aJGpN2 +uDxDw1sgPg5AIJMbEMLUDfQOdV2Kj/uFRAiOb/mPlHEIyNjbG9VNzy01C7m7kv6BNk7 h7bOJZUhmedG95jSh6aqOYvRBKxqy+47iqlibCSsQ0hlcH8sokGkuG47bhX1MJDwYAoE BIxaV3hwXfIIcFDzrK6IO8cPSom9lqGwFZHZ2tL+eRxTB0gZ8YrsE/JyJsy6lsbR1rOR Skn2hZydgrwC2aRd/aiXpGDnI3n5p9xdhgcK2R5z+J6YdiAiRM07jyRjPwOwfNZFqQAw E53Q== 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=3YDT/XAgh5QSXlyod86SZaadrvntYw6ff/cmVDaxdzo=; b=DPnR1nsTcfJHgxRihVaqlyx514FcGR7AV8iQKNgqs8kTBmVREb0aDgF5GJ/2XcZwv5 wRDx7Pl3lgnDgcdJnt4xYXoa3VrBjxVJgz3VlhcD/xUCLGmO5eB9P63pauBnqLiylvO9 hEzSg7dJ/DCR7UaqJzkWWx7zHC6BRRWxshjxkoauyxEn1sPG9p1PGnqeG/DvMfxNBIa6 QxbSYJ27Q3ftxCTAkpNcepcfR7tEF50LfkHzCg1ZTvr7zIGoO+HU/mpOvmdwfG1Qwpwt SEGmwr2fZ5Vy4JBlakLUaOIy+9E6K8PPRJG94Y8HotMjNK14mmOkk14Mc6d2MDoMJAUU oxTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="hj4sZ/oW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w2-20020a170902e88200b0017f77922b11si3415865plg.84.2022.11.17.23.32.12; Thu, 17 Nov 2022 23:32:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="hj4sZ/oW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240852AbiKRHbS (ORCPT + 99 others); Fri, 18 Nov 2022 02:31:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241180AbiKRHbC (ORCPT ); Fri, 18 Nov 2022 02:31:02 -0500 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28F4E7EBCD; Thu, 17 Nov 2022 23:31:02 -0800 (PST) Received: by mail-pf1-x430.google.com with SMTP id g62so4111161pfb.10; Thu, 17 Nov 2022 23:31:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3YDT/XAgh5QSXlyod86SZaadrvntYw6ff/cmVDaxdzo=; b=hj4sZ/oWS0i8ScGh0vbYAIusnjEYl4+v/V1w1lie+penPK+3QNfEw3e9lA2YvJY2vR 6U/s2favaWtrdVTN7ZxQYN3TNv3Gzmpp604WxQwf07cMv2V49N2eaV7INf9Mr/Fka3YI xDOXnWXwgetOrVE/PlHzDoVG1SMMD4hoFkHh/oQNMdcDaEpRuTgXjAO9bddr37OTQA9S ktOJf5nHzqLSna/GQtVnkHo4D6L/QgA1XlGFW6vtKLEvNOd3QZJfPnrf0ZJ6H9hrmP42 2o4Oyky8msMLDuOQ8ogXe9MjRO0eSJ3lurHDvLvpnWxaXJlo2L20CeupZWrVkRx6b2tf oYKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3YDT/XAgh5QSXlyod86SZaadrvntYw6ff/cmVDaxdzo=; b=NSkxy0zpHpj8XCqSBDQ8eSGvSCt8q1QUxAqk3Yo4TYPe7C2lp4QoeiHf0CgmWbhJ1K 3MamBtCrYV7LKZJud0GXw2OPqewHhLhSu78kOUXTI11zo6da6nbsV7ZD09pEE92O+tjN ifcbGWaNXP+ubbSJGeJOoTc70j/G3d6187Osx1E0H0idrjVEcupbRbUzZl8R1dtatdhF 0puz2olOmbbWtLwxjd8DnuHDhiiS1wx2yr3ycoCdWk/XJbwag29ya+KyydseotnSl9Jq MNS24gwhyHxS5fjQZg88HoxsOZF+tF0p174uA2HJOwbaru4k5FEPNacY5wx0RE704V/9 E2Aw== X-Gm-Message-State: ANoB5pnsIkBO0aJ3IWESFTGgZz32mST/X7Kb5oYTMiyJjAKOs3kaRUtN 9OBDDQeYM1Kqh9UEiDEsuAANe32IzzBCyw== X-Received: by 2002:a63:1c66:0:b0:476:c782:e5d1 with SMTP id c38-20020a631c66000000b00476c782e5d1mr5496113pgm.261.1668756661587; Thu, 17 Nov 2022 23:31:01 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id f7-20020a625107000000b0056b818142a2sm2424325pfb.109.2022.11.17.23.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 23:31:01 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, akpm@linux-foundation.org, willy@infradead.org, naoya.horiguchi@nec.com, tytso@mit.edu, "Vishal Moola (Oracle)" Subject: [PATCH v3 2/4] khugepage: Replace try_to_release_page() with filemap_release_folio() Date: Thu, 17 Nov 2022 23:30:53 -0800 Message-Id: <20221118073055.55694-3-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118073055.55694-1-vishal.moola@gmail.com> References: <20221118073055.55694-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749818274381713137?= X-GMAIL-MSGID: =?utf-8?q?1749818274381713137?= Replaces some calls with their folio equivalents. This change removes 4 calls to compound_head() and is in preparation for the removal of the try_to_release_page() wrapper. Signed-off-by: Vishal Moola (Oracle) --- mm/khugepaged.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 4734315f7940..3f21c010d2bd 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1747,6 +1747,7 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr, xas_set(&xas, start); for (index = start; index < end; index++) { struct page *page = xas_next(&xas); + struct folio *folio; VM_BUG_ON(index != xas.xa_index); if (is_shmem) { @@ -1773,8 +1774,6 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr, } if (xa_is_value(page) || !PageUptodate(page)) { - struct folio *folio; - xas_unlock_irq(&xas); /* swap in or instantiate fallocated page */ if (shmem_get_folio(mapping->host, index, @@ -1862,13 +1861,15 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr, goto out_unlock; } - if (page_mapping(page) != mapping) { + folio = page_folio(page); + + if (folio_mapping(folio) != mapping) { result = SCAN_TRUNCATED; goto out_unlock; } - if (!is_shmem && (PageDirty(page) || - PageWriteback(page))) { + if (!is_shmem && (folio_test_dirty(folio) || + folio_test_writeback(folio))) { /* * khugepaged only works on read-only fd, so this * page is dirty because it hasn't been flushed @@ -1878,20 +1879,20 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr, goto out_unlock; } - if (isolate_lru_page(page)) { + if (folio_isolate_lru(folio)) { result = SCAN_DEL_PAGE_LRU; goto out_unlock; } - if (page_has_private(page) && - !try_to_release_page(page, GFP_KERNEL)) { + if (folio_has_private(folio) && + !filemap_release_folio(folio, GFP_KERNEL)) { result = SCAN_PAGE_HAS_PRIVATE; - putback_lru_page(page); + folio_putback_lru(folio); goto out_unlock; } - if (page_mapped(page)) - try_to_unmap(page_folio(page), + if (folio_mapped(folio)) + try_to_unmap(folio, TTU_IGNORE_MLOCK | TTU_BATCH_FLUSH); xas_lock_irq(&xas); From patchwork Fri Nov 18 07:30:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 22159 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp46063wrr; Thu, 17 Nov 2022 23:32:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ukPk2HwYKXpR9es3oBYclE5B3PdyCS4w2XQ4CchZLn0n9h3lxJXFP813p3vRg13nHaeVo X-Received: by 2002:a05:6a00:99b:b0:56d:3de3:c401 with SMTP id u27-20020a056a00099b00b0056d3de3c401mr6752376pfg.6.1668756756596; Thu, 17 Nov 2022 23:32:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668756756; cv=none; d=google.com; s=arc-20160816; b=lo/8k3XnyAIHf2j+fbmddq9k/vXN1GDezVz14eUzNkYHYg7ObOZyZMoyJWtIExw0Jz n52UTJbLqlevwo6+VPtij8C7GxljIj+7x+mZdlx86mx8Ws0GXVwSUfnaXeZKaqHae6me +PaFOI1FBa3AtVkcZS9WdYztgfUvkfYXBwHbJ1JWfn3y5zw2HBj2oBdISdx58KcNGA7q wzyGbJXxqJF+2wU35YsjCVoqUnZHgVyG+XcZEo9CJnsEfcpcaGgyjU0SDbshhwmDsatV wVLzrOlOlwAG2obBXcce2Rk4nKlwJ5NyR8HRod3sOXEdIyQX/yF4FWr263GaqWxdJcVW h+Xw== 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=Wss4l8+ki3bcqZpf4pXWKdXS9Ah4/Shxx0wHVdp0ynM=; b=mlBG/quVyzpA6N+opIsywaxlSGLtWYlLTRhu8krIppZTSaAiN9K7zI6fcMCFEzUL4M GyrTsuWjNPjTI3W1sVcmuJyrFIJ1I7R2xIm2Ln+9EVVGIHcm3H6T+zd7xhAVOm4t5Uu3 V2+uKOcgM1ZRtxr0RmPdlTB/eWgOTjJJqPzFyOSSwm33MHKYZPsVdq9CudfwD+fNPiD1 /jv96/by0RRQVLgUOFX+6GBl5Xdh3Os8IO8Ql/oXd+Pc8G7fV0AHfh6urlbSWkg62tYo KnYqqPxZ7Qwjlz+1HbqSHDpj+1OJrEmn+kqV/H8C+wRSPMnf4MZmY5dblve2YHHknM+O wKAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ckE22BdR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b2-20020a056a00114200b00557eeeb099csi3247086pfm.339.2022.11.17.23.32.24; Thu, 17 Nov 2022 23:32:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ckE22BdR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241184AbiKRHbV (ORCPT + 99 others); Fri, 18 Nov 2022 02:31:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbiKRHbD (ORCPT ); Fri, 18 Nov 2022 02:31:03 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63AB47D525; Thu, 17 Nov 2022 23:31:03 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id g10so3833774plo.11; Thu, 17 Nov 2022 23:31:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Wss4l8+ki3bcqZpf4pXWKdXS9Ah4/Shxx0wHVdp0ynM=; b=ckE22BdRtTbcTpcAczDBDx142TEzFlzwaz45MGFZZgwWkx2w7J9ONyEK1YVTBtjfR6 RqbV2slZHKwdlqMT3lnVqoWGcRGASMPNbRG0a2ZrIDEaqZNX3aw9GppTxZWNyx6UaYyq /ZXWxeUL/0Ezt57Yz21sJQrooj599j6KBMdv/q/RYuFFdCIM4Yqt2Xr0oLGb5vXXsPOg r6eaZJ/pKRNO2dyZ4Bd5ISXKU7nzL84AoEDMUBU7Gw51pMl98qYM2mFUepjU9gkvOFX3 XxF7OVdMMEoAcAvgYU0CPiRt9xKcZFhO4Bnpn6/jj0RbAutl40YuQiuwkUsz0eBDueq8 YxHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wss4l8+ki3bcqZpf4pXWKdXS9Ah4/Shxx0wHVdp0ynM=; b=ePkV4Lnc4v6UkaPIVXehfr2h0Gf+rFdKEe+dTL8hfKyJJ4BILKb9uW4Yj7IcuO2z5c fIWHmb2VqHclN4yjKRcEoNR8XGHFqyrFtdqIi2MW15/zVFqm1zVOZnTyDsPyTAo8fYi3 0BOdN0nQmyIP8OJo1alMpfnqOgeDQOzyPp0z13+zx3qyr1oT7FHFO6F+AFcYVrPm8oSZ biHxN21C3waXyePjPf645PX+cXNBFkMIi2T/HmOUobOKQiJY0gPGOZj2yNn6bGeiLU8H KbH2kj/o0v7SWPIiVhxrv8muAKb3p8CawLlwZluR+6HFHKPPHKPrnoknqq2Y9oqmAxpG jn5g== X-Gm-Message-State: ANoB5pneVgBtJ3Gwv8cXn3utorB+8aWjUVkZbQ1b3GMH5oH0uN7TCY5B 5rP6mqP1sSG1T+eBZvdJdSw= X-Received: by 2002:a17:902:c141:b0:186:c958:64f with SMTP id 1-20020a170902c14100b00186c958064fmr6370295plj.33.1668756662876; Thu, 17 Nov 2022 23:31:02 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id f7-20020a625107000000b0056b818142a2sm2424325pfb.109.2022.11.17.23.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 23:31:02 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, akpm@linux-foundation.org, willy@infradead.org, naoya.horiguchi@nec.com, tytso@mit.edu, "Vishal Moola (Oracle)" Subject: [PATCH v3 3/4] memory-failure: Convert truncate_error_page() to use folio Date: Thu, 17 Nov 2022 23:30:54 -0800 Message-Id: <20221118073055.55694-4-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118073055.55694-1-vishal.moola@gmail.com> References: <20221118073055.55694-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749818285166578072?= X-GMAIL-MSGID: =?utf-8?q?1749818285166578072?= Replaces try_to_release_page() with filemap_release_folio(). This change is in preparation for the removal of the try_to_release_page() wrapper. Signed-off-by: Vishal Moola (Oracle) Acked-by: Naoya Horiguchi --- mm/memory-failure.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 145bb561ddb3..92ec9b0e58a3 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -827,12 +827,13 @@ static int truncate_error_page(struct page *p, unsigned long pfn, int ret = MF_FAILED; if (mapping->a_ops->error_remove_page) { + struct folio *folio = page_folio(p); int err = mapping->a_ops->error_remove_page(mapping, p); if (err != 0) { pr_info("%#lx: Failed to punch page: %d\n", pfn, err); - } else if (page_has_private(p) && - !try_to_release_page(p, GFP_NOIO)) { + } else if (folio_has_private(folio) && + !filemap_release_folio(folio, GFP_NOIO)) { pr_info("%#lx: failed to release buffers\n", pfn); } else { ret = MF_RECOVERED; From patchwork Fri Nov 18 07:30:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 22160 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp46164wrr; Thu, 17 Nov 2022 23:32:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf5/QxG4vE+/YKHdMf71+H1hvwFBbWXVbEZkWS4gQv14Gf4y+EDlyZGWfyQpaEjjA5CtzHRh X-Received: by 2002:a17:903:2149:b0:188:5698:5beb with SMTP id s9-20020a170903214900b0018856985bebmr6268274ple.150.1668756773116; Thu, 17 Nov 2022 23:32:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668756773; cv=none; d=google.com; s=arc-20160816; b=cCZI6uxQqBaovEItv+ch/RHHRgvxcUWPDWkMDYoTGWuyldGarHE77I0s2d4wFl+sNT +zMJE/XCezGp1/mgV8ZcCCe1cBEJabcklqAdQ8m/qFeTHr/g/T8ZqQP0OpbQ3aIMjacq KkrZZ/Q1J0XnSjDj8vPZcsUvqM8nUSAISrFZaZYY+tiRibKLDyMNo6uHpIxBL/Yd6cU/ cMxNajZQt8J5dG7IM3NegwuuwD1b2iuCETggljyoE2OJQKx6Lu/Vnoh3vJP2114rDmOY nfwR0ful9MnjXwFwZ46GS/ylMlllSBzStWg1pwYHDRjt0C/I6HRQn3LhzyKSzutcd5v2 ruCw== 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=CejbmJMt8knLZkp2jnt3nSDaW2/iqvwuj8SHKIZ6DVU=; b=dBH9e/3XTAgIBNqP00pTzOxQGtoqxQENoD4pM6gZPSpiJflnHQPeOIH1qcv8KmpQQH 1hxhcPZW5xRA+m4QLfkHhiGsshLEVpXyZwcU8xK3FnYVe6aIqHKMBYvVplkk7sfYEtFI PAfP1CtehMAHfSL6uP0oxml5dqyjD7/atG3Xktt1NKrdmZEU+7hA0O+bu3FD4jLM2aHi YoMBKOAHozdnoKIPKHI/pX99Zw8TvlqOX9NbJpZkRPdB4z6MCHrQIy4zIBClPaqR9BB0 jpgKE5V6mzkxVafLL7E9IdzmZqoofYykWqf6Hz8TSF1DgSbM+vXGdHxE2AJ9jyYpXqFa 9GBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e28sylLl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z198-20020a6333cf000000b0043f06af773dsi3289677pgz.33.2022.11.17.23.32.39; Thu, 17 Nov 2022 23:32:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e28sylLl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241222AbiKRHb0 (ORCPT + 99 others); Fri, 18 Nov 2022 02:31:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241063AbiKRHbK (ORCPT ); Fri, 18 Nov 2022 02:31:10 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A76D57DEDD; Thu, 17 Nov 2022 23:31:04 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id u6-20020a17090a5e4600b0021881a8d264so1948148pji.4; Thu, 17 Nov 2022 23:31:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CejbmJMt8knLZkp2jnt3nSDaW2/iqvwuj8SHKIZ6DVU=; b=e28sylLlQZUiBvoVF9tPYbPyjfnV4i6SeO/H+EXMvftssRjI+reFA4qMGgM5yDcDPw iuHW6cApXuI55771oVrwJmic63Uelq3yaeLZ7tQHhypfuc99pqDHg5C1hqlTZ14qKTQd 2D9MC/BqCBLie09z4RZ/9ewSv68efJQc0B8gSz0Nnz4BvLtr4LIXj8aeoZO7fOc5jSQC G/3ZLlmqFGfU2VlFaXy+wKBwsMDO+r3CwnrqryV45PVQ26JdwVg3r+I9Ta6QVvi6F7oi pkPax989JPanp1uEe3vWC5ZAANTFOsyggZLQKbgOVlz7G0KJzrCiNnodIUbMl2Oy5DZ8 Qvhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CejbmJMt8knLZkp2jnt3nSDaW2/iqvwuj8SHKIZ6DVU=; b=b3MZ7ka37bP6rf3rOlw7Ot4Ys1HNeUMi+t5Xz4nrfnHngXcFToZmsWyZEEyCZmhA+C SHH5j5SlfbYVdE9w78D0RzUlVMk9hk/CyZ24MUu1qG/rjR7NauE1fpLv+0YrjBoecC2W REwQwufVEUD0O4uED2/VGckkAHBFIL71CAycIEW/VJTWKP2DD0c8RuYa2NjbyC2HKisI /VtcB3ndG5+XhZYIKuBatqFC8r0E4eHJjLQDKmSOTNAIP67VuCIAssGBL2n+Sg2/Hx2U lHMLP/K5B+m2YQuj26nQOhwulbjsYmbuyh//mTF6nmlONdT+dcM6BH/LJEGLcQleLvz0 ys+g== X-Gm-Message-State: ANoB5pkN6hBr0tQzibRCVtEhGMlXd5UlVcUndnZ2gTTgxYeSojs15uKs 8onO03slfdSkguKlpDno+Ew= X-Received: by 2002:a17:90a:d3d5:b0:218:845f:36a1 with SMTP id d21-20020a17090ad3d500b00218845f36a1mr2283406pjw.117.1668756664181; Thu, 17 Nov 2022 23:31:04 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id f7-20020a625107000000b0056b818142a2sm2424325pfb.109.2022.11.17.23.31.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 23:31:03 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, akpm@linux-foundation.org, willy@infradead.org, naoya.horiguchi@nec.com, tytso@mit.edu, "Vishal Moola (Oracle)" Subject: [PATCH v3 4/4] folio-compat: Remove try_to_release_page() Date: Thu, 17 Nov 2022 23:30:55 -0800 Message-Id: <20221118073055.55694-5-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118073055.55694-1-vishal.moola@gmail.com> References: <20221118073055.55694-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749818302037444002?= X-GMAIL-MSGID: =?utf-8?q?1749818302037444002?= There are no more callers of try_to_release_page(), so remove it. This saves 149 bytes of kernel text. Signed-off-by: Vishal Moola (Oracle) --- include/linux/pagemap.h | 1 - mm/folio-compat.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index bbccb4044222..daf5e1a1d313 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -1107,7 +1107,6 @@ void __filemap_remove_folio(struct folio *folio, void *shadow); void replace_page_cache_page(struct page *old, struct page *new); void delete_from_page_cache_batch(struct address_space *mapping, struct folio_batch *fbatch); -int try_to_release_page(struct page *page, gfp_t gfp); bool filemap_release_folio(struct folio *folio, gfp_t gfp); loff_t mapping_seek_hole_data(struct address_space *, loff_t start, loff_t end, int whence); diff --git a/mm/folio-compat.c b/mm/folio-compat.c index e1e23b4947d7..9318a0bd9155 100644 --- a/mm/folio-compat.c +++ b/mm/folio-compat.c @@ -129,12 +129,6 @@ void delete_from_page_cache(struct page *page) return filemap_remove_folio(page_folio(page)); } -int try_to_release_page(struct page *page, gfp_t gfp) -{ - return filemap_release_folio(page_folio(page), gfp); -} -EXPORT_SYMBOL(try_to_release_page); - int isolate_lru_page(struct page *page) { if (WARN_RATELIMIT(PageTail(page), "trying to isolate tail page"))