From patchwork Wed Nov 16 02:10:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 20657 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3048654wru; Tue, 15 Nov 2022 18:11:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf7wWrgMFfLLszyD01EbzL6wMzFjCX6JV5OI7gSh8KD/Tj1aUTg8D9GriSlyaDlNzKtLyQsh X-Received: by 2002:a17:90b:4cd0:b0:213:ff:1cda with SMTP id nd16-20020a17090b4cd000b0021300ff1cdamr1308421pjb.86.1668564678351; Tue, 15 Nov 2022 18:11:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668564678; cv=none; d=google.com; s=arc-20160816; b=bmdqZ3kndI/kv3fyjc4C4AWWEfbrMc/HcG1+rD/bZsFGGEA/KgXP5MWXPEuXa6LRsV nK66xV7oCsV4IhybOYaWvCwv0FIMKljtxikArmlpq4M3peHMOj80zoiRSQjXUOX3STV8 dUPXaqSK1FF5nGJCU4RTA9Teill7vlI8xcLiDnq2PGoI4kGhadRPbEzHW2mOmTuiEE6o uXLzIoqflUrkY8qrzgtVxsLuV8b8TJ5i1Mr7xxz5VtbaQ92bOlohhVbLFgzGrJVUx4NA o21hR08/LrWjXobea7YwIcYsCgvI4XLnBFL5NwN2wXDHmft2w15kwjt8g17Z7kVMUpxn bE3g== 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=edTd/8en+S7nFCs7bvchEE9GA5NqYTbaAgFkDH59CPw=; b=oZytrQ9eQ8x9D2YSG2KGGULh8W+f7KVkqnUTLXyWSiYDHYDwsfSk3pJgYyjzgPXNLC gmu8rNL/H7F5OJkQT4/8tvcdOR6iLnuT7iAnkjMHmXhnUTLnFhX/VKSwCyBMGMbBjx2s Mfa03+CKSK2xMV1zq+AuY6E1Bp1CDguzFIoSdr6UCRfFAsGudpmzoiQzeofTnuMFZDzP 0ZuqLGHFdmCOrL4uJ+/5Q/7RFa4TT2ClfUMD6qWGI8+kQzx3HO8FU3i8mkATfm5dZWeD rnTc81ldgc2HXDVUCeOqv7Yxjh/vy7tDv3A2bF3fNuWPUwVVKu7AQGCctF+j02jee8Kn jQ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cD9MV49W; 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 q187-20020a632ac4000000b0046ef23ae9a6si12559167pgq.848.2022.11.15.18.11.05; Tue, 15 Nov 2022 18:11:18 -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=cD9MV49W; 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 S231797AbiKPCKW (ORCPT + 99 others); Tue, 15 Nov 2022 21:10:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbiKPCKS (ORCPT ); Tue, 15 Nov 2022 21:10:18 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B613317DF; Tue, 15 Nov 2022 18:10:17 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id h193so15312803pgc.10; Tue, 15 Nov 2022 18:10:17 -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=edTd/8en+S7nFCs7bvchEE9GA5NqYTbaAgFkDH59CPw=; b=cD9MV49WEAUYWQxdD69ZABkZwcvH/Sy01d2BEoajQL/UB3FK0pJWmFL16ABBRlMdah YI96fzjPXUi96FFTetnaBW5znWFlL0hqj6nYo65uDMWqTjqxd+FU0tJvx/WKZHKNBVPz yBGhVi1oAiGAZIwI6v1p6pWA3yzks5gxKvXJVHsQKni6IVm7qViZ6TuRA5kXqnwEHiAF lNGyejgS/WqIY2zJiA+MqV2vFEkR5GqyoMQALz1appaBZrLtRHUJm6XxkEALy7fkGieB +UhLTAtIOBGsBOdnXKz2nZC5qEj2bo4iNFeHe9GcwwmJuhZB65Aq2rUTjRGcDMw70j+5 zvWQ== 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=edTd/8en+S7nFCs7bvchEE9GA5NqYTbaAgFkDH59CPw=; b=3IBz9GTPbDg9+BfJ0M9L9gUl4DvNe0JUYNvDTVx84gisKy2NLEjiugAAkz8CmQ99+y yR+aubVqv5thjyhH5slP8YmHA2hClqSos0a/ORfu+vqzwhzKyvRsSrRCrl1m5zsae1YJ NGv+v2WtiZYjemkrt1EHvJ9lgaQq0lFh9jnWpLqkS9jncyaVE1y4uy/Uve43/QalW4SD 7hhBn3JRJfHF4LNChMVq/FhrHRKfiDGUUxFEO+NeNvmHaXCkTcm62N1h6eduhhl9HG7B I7bgt+J4OmfXjd4wzG3+wVkumdcCRrb0RLvTEOliA10ZftBLPEaGw4Urt/mGCkgYoe6i ARFw== X-Gm-Message-State: ANoB5plsAT/58m+BlVeDAd68668RXc7ak0s8rghCPWM1Lxm7vcZJ9/py uhiPgE0xJV8uQgLxZncmbyI= X-Received: by 2002:a63:f53:0:b0:456:d859:2143 with SMTP id 19-20020a630f53000000b00456d8592143mr18731335pgp.396.1668564616706; Tue, 15 Nov 2022 18:10:16 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id e18-20020a17090301d200b0018691ce1696sm10782926plh.131.2022.11.15.18.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 18:10:16 -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 1/4] ext4: Convert move_extent_per_page() to use folios Date: Tue, 15 Nov 2022 18:10:08 -0800 Message-Id: <20221116021011.54164-2-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116021011.54164-1-vishal.moola@gmail.com> References: <20221116021011.54164-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?1749616876198063454?= X-GMAIL-MSGID: =?utf-8?q?1749616876198063454?= 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 | 47 ++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index 044e34cd835c..0c680d4a2929 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,8 @@ 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]); 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 +334,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 +347,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 +374,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 +390,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 +400,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 +435,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 Wed Nov 16 02:10:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 20658 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3048695wru; Tue, 15 Nov 2022 18:11:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf7jVgrf3k2UN7aO9KP1LjTm5y9hbtPFnHRUd3XyBy349nZ3d3tq0PQeCMXAN8DK7jV7+qbX X-Received: by 2002:a17:90a:1f87:b0:213:7d3d:a769 with SMTP id x7-20020a17090a1f8700b002137d3da769mr1364585pja.22.1668564686024; Tue, 15 Nov 2022 18:11:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668564686; cv=none; d=google.com; s=arc-20160816; b=DTo/Z3UQ8apZu2K/o/ajiCZI1MrQKMsaFqJFxyuUNeGPx8TOuGGxcaHietFwfXS76J dEARvp+t6GYv/Yq4HX5/IWcilOSAjs9dYHGmbosFwIfZ6iy5eXbfZI4tQ7+l3G8PqFfd dH1FYAG5hrGon94VTa/5nnir4hZg5YUnqDQYpVp7/yOQsB6rgDAgoTOj8j8zSEE11NPt 4m42cRbhP9Q1H3PQOONQGuQCPMhHmqBcFK/qWVW5BdM5HMdwAmSrS4Lh4RUdhGa5+3Ed 2WDLLoH7nQLHBHoMTnZ+BJUm47ATJTzKs2m5OauDAhgvxzbXNqXLGF7QhgiBtRtoI1wk CEPQ== 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=P/5A5J+KKKHVZX/gurYoIsyO9QOn+pSU2CWkkzW32qUYvR5D3zeQJ6rTZbixnamlEp 3VZPrsR2fHqfhLMBexOpu9EHpr+YOJV5MLSrKOfOrlhq/cQhXvDUPpWJlvZnSbwnmyOy smTrWw8n++T1tP0FlQVjOK0etWBI/Ep2np4T7BQ3EM6H32Zuc9e3jmE56bMPrC4Nj0DB 7E4R8RMmXXLyc83tLEl05XrubLPfqmsk2ZH+6sdqQmpGfCDw4p25xpffqb8gOYfu0Pza gPnpBayF0jKVoOQXAuQBA8c3EsJgsA2lv/EbBQ6oZpF5xEr+MNlWvl9CwvSDsjdm4lau 9vDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KUWjlw9w; 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 q189-20020a632ac6000000b004403cd15ccesi13768724pgq.849.2022.11.15.18.11.12; Tue, 15 Nov 2022 18:11: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=KUWjlw9w; 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 S229862AbiKPCKZ (ORCPT + 99 others); Tue, 15 Nov 2022 21:10:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231341AbiKPCKT (ORCPT ); Tue, 15 Nov 2022 21:10:19 -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 D6F6631DC2; Tue, 15 Nov 2022 18:10:18 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id r61-20020a17090a43c300b00212f4e9cccdso894065pjg.5; Tue, 15 Nov 2022 18:10:18 -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=KUWjlw9wAvu8gqDJAwg6cHtHVqa2W7DdXEB14CWlGXOWQBL05awe9s9dxYdOmOMil7 RyOWv3MuMr+ShlBwAHzlInZpf9WXU4IuK1fknZkWVuLUhQ8t3qI15l9MkRSO5n+vHcVT 0G/GLoFUHkDLpMMPVn8nqBWlDH6Pk7924RR3Nv4EkBqE4naN+P+eE3gMl2w3L5JfiBO9 uLiInO8eB3pLYu1bfB9Et5ttZNn5/mdao/zMfopzKv6CaouWP5zWjCj25OIgmti1dk+O nFEpT78cOIq9/Ga/a+rQlgFiHnQYnpeeq5IQMaBWKdhVLtzfU4MlOuZxq9iWJZ0LgthU 2gzg== 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=0HjtuypNrqWhH+TLyWbucaZWeevOkgJvxMr1JFBVOJlsIj8B8RVqsHh1Q7s1xfsu1P zos2soldcB9HUaV+tKllCsETu5G+DkOIQNB6VSVg6tzh3brU+m7MJJIhDlEsG/4gXcuP nT/Y8Db+q6yowUUuxZymd4BQyKoyAUMHxToSruROREEZ24ViW8jfhF3J1YS04CiDeUzP Rlgcwh9ys1c++0GiOdsxWPc+JtYzOhUIt1GOJKcl1C2qGxeZN3RcQ9U79ifWH2P/yMb9 bcWF6fYgnvUpMXCjTs1945rGVoRIJnik8iR4k22vA1fFEQK0wRtMjkoK0H/M8fVc5x4L oXfw== X-Gm-Message-State: ANoB5pmuqnuCBH6b/7jEfQu+M68gyWxIvwoDTJr8/UA0+adbmEUmiILQ 0Xp+8zf01vvhFuTJAF2LLuY= X-Received: by 2002:a17:90a:c7c1:b0:213:1f29:2d0a with SMTP id gf1-20020a17090ac7c100b002131f292d0amr1334082pjb.154.1668564618296; Tue, 15 Nov 2022 18:10:18 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id e18-20020a17090301d200b0018691ce1696sm10782926plh.131.2022.11.15.18.10.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 18:10:17 -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 2/4] khugepage: Replace try_to_release_page() with filemap_release_folio() Date: Tue, 15 Nov 2022 18:10:09 -0800 Message-Id: <20221116021011.54164-3-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116021011.54164-1-vishal.moola@gmail.com> References: <20221116021011.54164-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?1749616884401591820?= X-GMAIL-MSGID: =?utf-8?q?1749616884401591820?= 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 Wed Nov 16 02:10:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 20659 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3048724wru; Tue, 15 Nov 2022 18:11:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf6TJJpc11dUtFgePd211xwFJQJUhgqfldyNFk3urogjTy4EGkROIwCdegnJecNmHepnMe0T X-Received: by 2002:a17:902:d54c:b0:187:31da:a27e with SMTP id z12-20020a170902d54c00b0018731daa27emr6774190plf.111.1668564691919; Tue, 15 Nov 2022 18:11:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668564691; cv=none; d=google.com; s=arc-20160816; b=JC4dIFq5RWIYG7AxFVfL5/fQ1Pt9DlkNwiNz0KBgIy+077M5DXHHFGEnxn8wxy7CoD 1ckeHBaJEg0TgyaoLJizKGLnHJhtSoCxdnf7mPYGUWb4Bwzwg+L2j2qylpD18Ygci+gl +ihGf3XVK+NI7hLPNXAbAvPdhDYNm6Rtu/ErcG/2J4eqxgb4z3kN9DPglhB3al0sVqVP di8OlfjRn7aMroDfcwwLCu6lBgRaV7wzgn7lXdIvcqe9FVODH3TyUpyGMlNbsPbokywq Zb/y7d7Swzg1nsH6UjygkDEun7Ecwpvw/DD3Q0GNHTRAoo2/i//9qaEv1GIPWq5Ni8jQ mcUg== 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=4nup6up+46eyh1lCBQu3VG6VwxyWmfFVyQ2yC43shVo=; b=rmDNkEZxFT5DRDOpCBaCnrxNFsEFOHevyqD/ZmXmyuCXIvb8yrYw3Tcn8PtqjPyo9l t0APE60M5e3p7YQJouBUtlVel95sXrCBkUiJFzKuNnRw9/pb0POzd2YQWerPv8ZBkYn1 XiQqheaNu/FrrPr8M+djSXBoo0ZqPjZMiIZfEuYtH7QDruqH1zUya5WZvjkS0G460aL7 HdNRXFQlmlrtAeCDvstDHTC09QGps2ptvYEYr/4GOSdB1x3Dmrn1nEyksG9pG/5x7PVn pG0WGPsibiGGOobWbD6o3Xkpz5I5pNzKD1sf6rIdzj3MZL/UjZSEshvZ7sz0NYDD4Ptp 4jFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kzTno0E7; 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 bx16-20020a056a00429000b0056da577869asi13548426pfb.356.2022.11.15.18.11.18; Tue, 15 Nov 2022 18:11:31 -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=kzTno0E7; 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 S231869AbiKPCKb (ORCPT + 99 others); Tue, 15 Nov 2022 21:10:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231398AbiKPCKU (ORCPT ); Tue, 15 Nov 2022 21:10:20 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2042331DCB; Tue, 15 Nov 2022 18:10:20 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id k5so15222053pjo.5; Tue, 15 Nov 2022 18:10:20 -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=4nup6up+46eyh1lCBQu3VG6VwxyWmfFVyQ2yC43shVo=; b=kzTno0E757BuQUewd/lzW9JzWZhTRKoWJpj5TsOZemkW3irgjFx+JTcamrVEFZ+ZuK rd94aHMDRRsnMe5IjRTrRR0X2yA4oKZyt8VeJm0zlT3nKQE3H4iVnQ9nwf6cjVbIeRnN 9aAx+D1+N0y89hD+TmOP1QgFYR1ib5eKb91rk3P4CI2m5AyK49XRDYlA5AZv6+WkkBJ0 gu7a7WBBV/sVvJ43ubRL7RoJ8O18IT4nq/OSq62+8P+2AfbMzGGbzIWRDOwUmxcM/7kJ lr0+qQniPM4W/zw/ITl7D7XfrPmKiYARVg0tRSbciDRzhm5g/69Fs85CE+WQq0kwhja4 NOMg== 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=4nup6up+46eyh1lCBQu3VG6VwxyWmfFVyQ2yC43shVo=; b=Ed44bPwZMGmBYPiQ5i2Zzmy+DCs0XUDqdQYTCML+WT3GN2Q5abso3kxWOC/mWCYkg0 o7ayfE478rJSfVYraQeyc74YagY3NmmOit/kOZ4Rruuhoys23NVtpsi2qmQPiilJz7eJ r0qE5NAu1X182cFD1AI6fgEoOzwDk4lgrYddS0XYM/I7+BQ2z9ZOXa4RETBH99aBasIR Zs4dZTPXKRh7rtkI3lPyqSopPjqR48eBgTXkqtDp0y36LG2O4b0NN/T5gAPfSmexEK94 kGSZ6/UKXbM/nagIurqLjhSoiGSnOll7Bl2o3btcLlhVy8tuL0h3uDEeD/rrQwS3pKaH 9bMg== X-Gm-Message-State: ANoB5plBfJ2peSDoHNsm5x1qBKx6DbTkhw0AY7QaZLUNRdgK+OeE1HCn BKyVDYxmyyvQCIZqy6mtCtY= X-Received: by 2002:a17:90a:b392:b0:212:de1a:355b with SMTP id e18-20020a17090ab39200b00212de1a355bmr1406088pjr.1.1668564619604; Tue, 15 Nov 2022 18:10:19 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id e18-20020a17090301d200b0018691ce1696sm10782926plh.131.2022.11.15.18.10.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 18:10:19 -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 3/4] memory-failure: Convert truncate_error_page() to use folio Date: Tue, 15 Nov 2022 18:10:10 -0800 Message-Id: <20221116021011.54164-4-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116021011.54164-1-vishal.moola@gmail.com> References: <20221116021011.54164-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?1749616890314355442?= X-GMAIL-MSGID: =?utf-8?q?1749616890314355442?= 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 Wed Nov 16 02:10:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 20660 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3048782wru; Tue, 15 Nov 2022 18:11:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf5sv+/FCQYJwXD/5dg0WZZP0Z1I8j9gGfo2lrTuYztTzLiXX/dfn/zvmzyYyxh7cMPsPThg X-Received: by 2002:a17:902:8a83:b0:17e:3f0f:5ad0 with SMTP id p3-20020a1709028a8300b0017e3f0f5ad0mr6853723plo.162.1668564701992; Tue, 15 Nov 2022 18:11:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668564701; cv=none; d=google.com; s=arc-20160816; b=mMkyYmgKXWkqKTRSK9tz8Kb6kctQdGUQ4FekY46EPotAykcj9ADZr4gqaqk4Yf6EfG tR70T7pkeDgEGP6zOYjW9NE0Y1BV5ZkulEevBim4whDkHB2Pxac6bMaHyI/XMckXYuxd qvoKCtvqIRfYP3SQdsvq16Lu6wKt5yw1wUVcEnY7hO/IesI4yeYHOFxW+x7gY+czODL/ XWQMqxi7gustBvKolJhFKspzSQvrG6+qBb/QeSb3z+E/7SVdyynmV9Pse29e0g0DrgdS rFAv1dWei+oBLfTvaao6VrbFZ3CuvDqqsufvwVIKpU+3WN+NyCxgqs4zw4DA7/9MbMZd efiw== 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=zUjRm7OBUV/32QGDf+rHECtjXIrsxw8m2iJI9uU+UCSLXTfsILbSkXzfvehS3Qzze5 ZmMkevpLdAM2k+ngWh8mYkp6Hl0o3HWYZTxJrs5UQ8XPokVijSjIgmHx3l5eVDu0Xlz3 zco6C29B02re26R9+CPjcZrMmu1PKfVfk9B0T1jtkBQ8eVEDhR8PmilXEKbOn8ZlNlR2 4r+T3bUVR39d9iSWWQlsZcbPLcb2Q2EKgPHPP18f0fJsME4z/eM51WICJtrsfXHn1MBj ZjbzD5LHIm9LhnSSc0EzlymuJzi7OQ7nRo10GA7K3zHqf6KUbEEKLmoZEiMU6vT+qhcv fG6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="G/lcM5Pw"; 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 u35-20020a634723000000b0045a048683desi14865056pga.647.2022.11.15.18.11.28; Tue, 15 Nov 2022 18:11:41 -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="G/lcM5Pw"; 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 S231398AbiKPCKf (ORCPT + 99 others); Tue, 15 Nov 2022 21:10:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231794AbiKPCKW (ORCPT ); Tue, 15 Nov 2022 21:10:22 -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 780BA31DC8; Tue, 15 Nov 2022 18:10:21 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id d13-20020a17090a3b0d00b00213519dfe4aso993037pjc.2; Tue, 15 Nov 2022 18:10:21 -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=G/lcM5PwZ0+Ib/Xb9y7OrQjWRddNdmXLywgQSv385sHaURx8IljbeuN/Sbp+vTAI7e J+GBm0Oio9YIM/KXtdA9WGU19Y/4E+/6K1dfkB7Q3+K3PrsXhvC3Z6tROjHkkEaa7Y7v cZgHG2WtjhEhsZnB6nySPb+qXRk4Yo8a+pM/vwOZlgkcecKcsrnbJXxVv0J7htNHaMoK x52qgRJ/chHlnbyPgH/sb7ZdIZLoT/4WnOh6fHNX17pWc93N/x9YWGB0IbnlYTfH/VMa oN/sDsoKLLnSaAfbWJ9CAluV8Ep3aJdG0byCQ7rm3WvDxsWsS/GnsDEmjhs66e7EF9dH Ur7w== 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=D2GGuQJiRh/I/Ef/yEuokcMEA6ycNlQfY1sWbNtNJXHl3sidBvt1S4/8DYSXlF6l/3 b0jSfiGMUdyK861+xakg5RdtMxg3r9ycGSShr1eALudyUMJnyuswUNBrkFFT12qssWg7 s2o1s3vsXfFECBRrynpbfli9W51Zv7gpE/47zjPYMnE8duZifUCft+pcvhGMk8sHUk4p etoh/a+WvQOEiqYux6xRM+6oHloDIp9BwdEfeVUtkKlRX0vmjBIyoau1qYLTe61LhDlz Qw/NAZMPP160K7tE4xL66dkzlR8QAYdhAJM+k0NW97st3mqUXfAGEjYhiA5stNNr8FXJ 1cxQ== X-Gm-Message-State: ANoB5pkl2YYh+zFytzxjXypdgWy8WmTCiTf0+TuChZbhYB4+nRDFphCE aFVs36FkEA3HPWxpusk6VwE= X-Received: by 2002:a17:90a:1a12:b0:20a:6ffc:f0c6 with SMTP id 18-20020a17090a1a1200b0020a6ffcf0c6mr1371340pjk.49.1668564620886; Tue, 15 Nov 2022 18:10:20 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id e18-20020a17090301d200b0018691ce1696sm10782926plh.131.2022.11.15.18.10.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 18:10:20 -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 4/4] folio-compat: Remove try_to_release_page() Date: Tue, 15 Nov 2022 18:10:11 -0800 Message-Id: <20221116021011.54164-5-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116021011.54164-1-vishal.moola@gmail.com> References: <20221116021011.54164-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?1749616900908705488?= X-GMAIL-MSGID: =?utf-8?q?1749616900908705488?= 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"))