From patchwork Fri Nov 18 02:14:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 22063 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp735507wrr; Thu, 17 Nov 2022 18:16:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf4cPnbU1HQsdiEK4B0HZjh8W3C059N/HT3huroJ0LQ3mkZchF4pekWDGM30Z2RyRl5Ei9BR X-Received: by 2002:a62:be16:0:b0:56b:676e:1815 with SMTP id l22-20020a62be16000000b0056b676e1815mr5672907pff.66.1668737791459; Thu, 17 Nov 2022 18:16:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668737791; cv=none; d=google.com; s=arc-20160816; b=K8IVNcFlx666FFCKnBQJcZpDpni48KOWx3L/vcS+VsYWrlExQK5JaYOupQO3y1WcmT ltIy/LuBE9tRM+VU63lOF2tw5agomrQa8m0OS+hpZkFCKxwBDxLzi2D9wwiZL4I4yLGk MOrM+ORKa7DlgriZY9QaLln8aQywVqfYVxL117PnnhSBTSgaFmcHEXsZ3kQ8STfRk5z4 MD3mHN+fbBnjj11/1V7kgEyqqURuEhWGP/w0NYNCIT8j3lTQdp1kneHR7OCdZ4a9/YKk KjojXBlT6o8/rhLgDGS5l4jYELBDHIqHPCHA5Ki72AXYlFmn8HrXxHi7z8Qx1iKvQiwv c//Q== 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=GVrcoUJXUK5/CKXbx6RN1zNp+2tpY9S51Tzzec48Gqs=; b=AgUa4aJDB+06GzDcWyIOYGkwU3QCPiNDNG/ha3TrvtrZylJS1dvZw/tW8KGa0L1uJG 2l4dMZUSqW0eba1xnM07bDkEJAlkDP0oFglFxC/c5FsSWQDn4TrotpQmwIJ4DUR4Naou sbGGAv1Igbeh5t4rikAAtGcno1SMFLNyM71mZFR0hiGG+oypjYbUdAIjwQwbSkOZD6Hb 7gCIFZ6mm5rbFcWe8RUkglxT4CGA1orGPoTCafSvyM/Xd7PWM7u2nNcYKWEI2vDOhR4T ydL1MaOo4DUhydJAXd0FqtIRIIExIyMY+mv2JzK/f55+7N1Ubto/DXOEpZ5XL3Hp4elh Qanw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=n+Zt6yJQ; 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 mw6-20020a17090b4d0600b0021860d5ca8csi5893455pjb.52.2022.11.17.18.16.18; Thu, 17 Nov 2022 18:16: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=n+Zt6yJQ; 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 S240898AbiKRCO1 (ORCPT + 99 others); Thu, 17 Nov 2022 21:14:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235045AbiKRCOS (ORCPT ); Thu, 17 Nov 2022 21:14: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 20296716F6; Thu, 17 Nov 2022 18:14:18 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id n17so3767879pgh.9; Thu, 17 Nov 2022 18:14: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=GVrcoUJXUK5/CKXbx6RN1zNp+2tpY9S51Tzzec48Gqs=; b=n+Zt6yJQR92KB0fxPR6JDUPzt9F3OC7xN7d8TnHtDCtwQLEicxkN8AsPcz0XtVoJa4 31sCY92jqlh5RBzjlzyVg5uS6DpdFBKpL3omU61y59YOI39fVFqerM6mVELkA3Xgv4gy 7dApw1AZp9Slmg5yw8FQBVK1RvQMmiKb/vL1R/XTtdUCYoccS7C4/wZwnCBlKNX2rPYR m38H8Vz1NqMXZQ6ZW2ZT03fEuOEposzfd8sraCtZnNiF3Jq/L3MJr9Hh42zEIJ32Jt6N PX3faosRjh6ClTura9m0asWyYaN8wAXgIsaDlBON0BEKQdRvqBZPBe/n3JKHZgGm8uRu Pycw== 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=GVrcoUJXUK5/CKXbx6RN1zNp+2tpY9S51Tzzec48Gqs=; b=Tdj8iwnbaZFpYiMHrwgqCbfo/aIA7lXM0tg5W9DnNZxVF9xEaQMig+UF5mpljfbS0R nI0sijLznpov9Q/PbKSIIzXadTri32bQjFKA9E4KH+3mSxwJTz5sIoEmwLicP/QlUeaU /7ki1sEcyQjp82LX+ZJCQBiyzbqm9nJQNr5HUbCTJTWtngGABYfH/Cepo8grSGoPgkQH Dj/EZLfzvUVuigGJkLgeTMT8ZmvaMwIKOtQFVXACpgV4r94Y61caSW6JDf0iEsrTbwly Q2NTO4s7yrSJDAGIjPDP0hx6nd4Xe3NngxAUlPc5geie2OEsuOE0V+sEGMHqyU87r68a CcXg== X-Gm-Message-State: ANoB5pmULhc7mtb1JX1E93hft0Hz4MpLJVpxccENeDSZ2GDFo/a60BLJ rt0xJiHIbiYN7GeeoU0+910= X-Received: by 2002:a63:d513:0:b0:438:c64b:a384 with SMTP id c19-20020a63d513000000b00438c64ba384mr4720773pgg.575.1668737657564; Thu, 17 Nov 2022 18:14:17 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id ip13-20020a17090b314d00b00212cf2fe8c3sm10678445pjb.1.2022.11.17.18.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 18:14: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 v2 1/4] ext4: Convert move_extent_per_page() to use folios Date: Thu, 17 Nov 2022 18:14:07 -0800 Message-Id: <20221118021410.24420-2-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118021410.24420-1-vishal.moola@gmail.com> References: <20221118021410.24420-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?1749798398435915866?= X-GMAIL-MSGID: =?utf-8?q?1749798398435915866?= 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..aa67eb240ca6 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 02:14: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: 22064 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp735563wrr; Thu, 17 Nov 2022 18:16:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf4/WoBTHE4yslG9lqBV5XviMjrFdtsXe4KAOxFS8NqH/ZH/VhfJZk6JQGuK+7pFThB8iZnI X-Received: by 2002:a63:1054:0:b0:42b:9219:d14e with SMTP id 20-20020a631054000000b0042b9219d14emr4714802pgq.176.1668737801342; Thu, 17 Nov 2022 18:16:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668737801; cv=none; d=google.com; s=arc-20160816; b=N0EUpwJgeKCpcpuZjDx4xzMng5Bc5lPJEeMM8vfpj67TCnfwiPgZCT1QOKaPTkg4VO 2NtMuKAGcnQ5eA4z4w95hmVyNyfnliYjeU3vu24bD6JoCa+PlIVmybHgwjlyKVd3YhYJ IzHtVWk8uvvR/Mf4RnahVfIWzzUmBeZfYDUXVl6Dk4tw+ynBZcs9LOtAhffJkyJAYPCf QfO3H8ymr/TmDcShdX1n9WiPhRrdoua3gnnqCYQMj95ryqZDJ1HNtGh17HSUKpEK7Uf4 nrTyOE83D3CFO+CHPC4jkuBYfG/wt9ljob2yObWnI8iUhW3VNx+WPcYkH7o2kdj0uNZ1 Z7JQ== 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=KUb4GwZJEabpPHRUrHKWl1c3xSIFXlcqg0DrOKJ2OsWaBzqQ3scvVRktHzxFKN+lcQ oPhRY/S5Gno/zxzleBRNtyAbooENnK3Ivv+5KsRgxRcO3XM4X7RCijOilQIvw14Owjvn 2Ec3NPtjgZiUaTN55KMOv4kqaZRYcgJ6bm2z/l84gzb36wkgaeDjsX7t5+CL2au6/yFh B0dLIO9xYQBWXlo4TzWfCErH3IEQXbf3GjJpIe47tNUK00x/G8LlNDq5e0ydAg1bB39g va+/L3uUxhObUoyEOSL1NdxcmLlKc830e8M3idtgrnYnzz8au6N5AilT31Ob2AbD47Wp z6Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WIhEVv40; 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 e2-20020aa78242000000b005633766252asi2245545pfn.313.2022.11.17.18.16.28; Thu, 17 Nov 2022 18:16: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=WIhEVv40; 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 S240934AbiKRCOa (ORCPT + 99 others); Thu, 17 Nov 2022 21:14:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240832AbiKRCOU (ORCPT ); Thu, 17 Nov 2022 21:14:20 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7257087575; Thu, 17 Nov 2022 18:14:19 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id b11so3286932pjp.2; Thu, 17 Nov 2022 18:14:19 -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=WIhEVv40bO8pPOe0T4T4maV1rYV4pai+d0aHe5h0r42FibWzau6xqjlbhDYj7fVP+/ YVbz1QBIEi5smOOlTRsnqvFnOSv1Un3EXZls7avo8RWt8GuSdf13vWB1vX+nyGT9q/EA T4uFXOL3nEQg/604IZpT78KAD+oBUy2DhDfpQmyGPPQ90V+476q3TDhM8JO5/eefRo39 Kc6oAfVStZxNFPpjkSEaVmtKQ/MwyY+KaTUq/ui8Z+wJ5NVT0RpHdPebMV2bUg0O0Yfb SscM0FktFuryyy6iQ7l4iU39d7doVgLL5n+BXTp0RKjfosJtcvVKIK7EIBdl3j/ynnVZ 8T3w== 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=KEiqHuji93hYmtLxhnOQ/w031eOtW+zGmvz7m1egWJ2Xw9j9diccgnBCrC6SQ558iM fuFAGq+31f+kj8zch1tSJFez7UuM6fvxNpyePsyiQXDURnKQk88vYRCLXDtQxPWEzDlU 75F5fHfJdR4Y3LYwOfNQrGk6eW0F6P2U533wyPdyXRwiMUSqykNMcf2PlIxcRFkkBy8U M0nRVCOXhZYA/FvVqtjyb91phLOCYI3mw3NS8B0TTk6/zVb0OgOgKYHG7fvTMfc7a+uc F5mxR6JzK1a6ZZ/oR3RDsCQxPdIB6HpRlICil+ZBSTNM9hzkqg+2eN7BybQ5KO+gKErt +KtQ== X-Gm-Message-State: ANoB5pn7Gn0dxJzr0FTgN4KBlqR2MQIp3Xd2MuSVYKLYeWZjm1eB1XMy 5MiKJp8GsKfatURN1vh6QxVGaIUj3KL7Dg== X-Received: by 2002:a17:90b:117:b0:212:f2be:bc38 with SMTP id p23-20020a17090b011700b00212f2bebc38mr11372286pjz.175.1668737658849; Thu, 17 Nov 2022 18:14:18 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id ip13-20020a17090b314d00b00212cf2fe8c3sm10678445pjb.1.2022.11.17.18.14.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 18:14:18 -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 v2 2/4] khugepage: Replace try_to_release_page() with filemap_release_folio() Date: Thu, 17 Nov 2022 18:14:08 -0800 Message-Id: <20221118021410.24420-3-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118021410.24420-1-vishal.moola@gmail.com> References: <20221118021410.24420-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?1749798408664015812?= X-GMAIL-MSGID: =?utf-8?q?1749798408664015812?= 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 02:14: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: 22065 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp735725wrr; Thu, 17 Nov 2022 18:17:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf7fakCPVs2TcubRCova4UAht3dYE/MZbFXiU4C1m3t6/1gugodmwKnvWPSxj2I7FlwNq3v+ X-Received: by 2002:a17:902:b40b:b0:186:c589:9ed3 with SMTP id x11-20020a170902b40b00b00186c5899ed3mr5667971plr.52.1668737827644; Thu, 17 Nov 2022 18:17:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668737827; cv=none; d=google.com; s=arc-20160816; b=nBKUTmFKGg/6cayR6S/B9SU002gOqMZ3EPS+qlkzbcNwv7/JDg2fP5JVnAZFhhtDNS /JKQY0hSAsNpMVypStDe1KmDg2/DQ1hDTh9PvQFyYEWXCAFVCOt0RL+QapRp72WZki/O K5wm77YIlcP+wZ7xAdeQ+9KZ3e4T9tHpnWdJTFyxNXEJAafqgLaGgI4TP+qiKRY3HOKQ 2GA/nhdJrw/xNRc7hBW9LFVfStTsuVLHgUUc2u1YZSrb9ukCFFW995NSH8qQbJ5PIFXK JUkUaiFNiApW57HEgsQtL3odM17pNOscxMtnSRQWgjQ9MD3gxw2/dKQjFiHnJw10nVEz Ob3g== 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=rV2TVU6r9FwCtbr8lP+vu0vAOsOSDOJuzy3ivGnsoIz1LYx5uDbL/0VwZWU8eLvJRM W7yP6BY6F8koSw27Cg5Je4NJwcIY718nLaIN+0eo2EPpBWVfsxWCK3gZXQ+uDfkKYqN7 cQO9vKZc4o1ki7/duN2wW6ginsx8rFRS1VxfJGnxkBlwddJBkAn8LQ+9br86mCdEOdda CjTlyOyprlRdGoIKC/VaX4GJHDSUEjArCxLUGjsI/7TIQGGKbAMkDtucvrZY0GmUBr3X qdtcXi7Y4ew3SC+1YuoWKrwEV93zYfgO+hCew/CPp+ukH56EhTan9V7gOVPO+hTL2TcF ZT9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BHAg7M5s; 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 s36-20020a056a0017a400b0053652e1c0b6si2902556pfg.12.2022.11.17.18.16.53; Thu, 17 Nov 2022 18:17:07 -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=BHAg7M5s; 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 S240905AbiKRCOd (ORCPT + 99 others); Thu, 17 Nov 2022 21:14:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240848AbiKRCOV (ORCPT ); Thu, 17 Nov 2022 21:14:21 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F190898DF; Thu, 17 Nov 2022 18:14:20 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id m14so3308671pji.0; Thu, 17 Nov 2022 18:14: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=Wss4l8+ki3bcqZpf4pXWKdXS9Ah4/Shxx0wHVdp0ynM=; b=BHAg7M5s8r6Zk3gNga8DlzxghZsFB0+gDqhWzAobQ0NDSCnRl+jsxSvoCauCt5pDlV FDsWr0LWtE3+ZTY7CQ3LTNxeN3cKijwiRiaNvETjKpEgeeIjaGefYqxrpk0elzNuWxJs ZXKMKa/5Iju31VyTJHHA2LNGmdzJjmeLdNHvAI5Fpr2KdzXb90/1Yd/rS/2cqR0oRiiX Qk+aUBMrANKZjsd0FyKxxEMA7BhVE+Ewy6TrW4vdV7QCkzGSUwFyFzgsMEX2rjxIgUFR Q1A/dW1R3WyV8pkB70F3ahkg7sda6EOcxLWMlweeAzvu72bbCTJs57pkgTpCtPxu7pY6 T4Gw== 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=V22Kd81Gc/IKotRtKEFQBL3Og6kSx5OopPpd36cd3riKQ58A9ZghjoGU1IIBiQ5o9t rBQb+1XABITRM+m1FRLn8mh1dAWQkn6bZIbkNxG2iJ5aXZWce2le1B/CruCz6UeUwC5O TceAgQC//jGWLatn1CW3bRsLc9gczTKsAPeg1lXCvHEyxKQXJPE7qBKJjX33aIfp6rRL T2Pi7RlhqqYfiVBu3EBC4a90eu6V3K9Qr8XCU86Ypnf5fw20b1mdxMfHuoev8Y7qSSVK eJB7yDT5YCrw4rmb9WnOo0YJ5GySZ62DiFPkawy6VNW8Xm3RzVh2TzbMXNgs7I3/U5Z/ t+nA== X-Gm-Message-State: ANoB5pmc3eZFnFNSYnDGjiv2hJvincIWTYgXPNmxdW8NwjKW/qdIyKsk bos3FYO75g8e/SS8LW1iJlw= X-Received: by 2002:a17:90b:2542:b0:1fb:e7a:79b with SMTP id nw2-20020a17090b254200b001fb0e7a079bmr11745002pjb.93.1668737660142; Thu, 17 Nov 2022 18:14:20 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id ip13-20020a17090b314d00b00212cf2fe8c3sm10678445pjb.1.2022.11.17.18.14.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 18:14: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 v2 3/4] memory-failure: Convert truncate_error_page() to use folio Date: Thu, 17 Nov 2022 18:14:09 -0800 Message-Id: <20221118021410.24420-4-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118021410.24420-1-vishal.moola@gmail.com> References: <20221118021410.24420-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?1749798436442185814?= X-GMAIL-MSGID: =?utf-8?q?1749798436442185814?= 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 02:14: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: 22066 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp736241wrr; Thu, 17 Nov 2022 18:18:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf4sm7ywGbNaqOB8F3n9jEy9luxSy8z7nT90TteIJRBHwtgU2EHy0GzhSudLthnxtyNaS2Bf X-Received: by 2002:a62:b402:0:b0:56e:8f96:6b2e with SMTP id h2-20020a62b402000000b0056e8f966b2emr5689581pfn.18.1668737932789; Thu, 17 Nov 2022 18:18:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668737932; cv=none; d=google.com; s=arc-20160816; b=n4BY+dkl2dsT+3UhyOkqG9vBDczTSpzLqVcNT6zGpB6MO5mMfWCTrFHMBVv6Xxn5DD PGiwcrKyf8tLyV4kqGMxpvxhj1JIGRh8Yi/G0b5HdzuLS2A+a0iIh1Qjmi+CBtQua02W W5DFFghGcB42H8G0byB8iDm/+y/esovh0yX3T9pYMLqsaZANBy2f1mADmM7pkX+u68CI AoDbf0ONPZerL5n4V6gnZOMbcBHjTWxm1Zh+ZpJLYO/Rw9FxulWf5XVOm+RKxzs1p54x 1JG87/JxirUH3rKjjN7rJ097eDTVTZXBnmgc+JZchaVPU8MsrZE8fr7T/U/mPVYJ2K8P fl4Q== 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=Ubtp9HgHofC4b1dRdPIA8+1BtdnvfTbSxMguvKW6iYYpx0bPdq2Kb1xuVxajwHoWJa hCKlkHr90jfmZuLc6635Qw7giGITQfPtpr9W1LpegOZ47N6HUpWV8XCP7b/5LknPJXpN Q7sie677M5w3by7zF71U2XyIDopX2bOITa06YlXx8HKD9r32tZMz4unFLg0Qji99xqHz sbIt3DpHRmaXfpoY2H/5h9BgcpZktIYQzXDKAX0cObC3IQzR/oQ/EqsNGk2xOcz3Ess2 1x37l62e/TU7jCXEagoefpOJ+uZb3XE/dhlmZci75ldJLsErxO86HlMzrUnvRuPOx8HH DpnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=b82Ya60E; 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 b1-20020a17090a800100b00205f49b70fdsi2078078pjn.127.2022.11.17.18.18.40; Thu, 17 Nov 2022 18:18:52 -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=b82Ya60E; 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 S240928AbiKRCOh (ORCPT + 99 others); Thu, 17 Nov 2022 21:14:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240865AbiKRCOW (ORCPT ); Thu, 17 Nov 2022 21:14:22 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20516716F6; Thu, 17 Nov 2022 18:14:22 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id y203so3564590pfb.4; Thu, 17 Nov 2022 18:14:22 -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=b82Ya60EgEzBmglfPyBteCPU9obmCFXipeevVnQGfYhF7131nPzLpFPp43Ttx1rvn2 aK+X7i1nofdutJEjCXfng2R3bMAfiY8qfs7ydF8u46qloqksHIzzoixx409rSQ45wRef UDiKfwPyx0xH1yEaX3rdOhR/9wlEjtKQAlEI+0dEwWXnjA3UuV60+YQD+MbBUTZk70p8 NJgnsSHd7EoDzmnJH74gRQmfqrFDd0q9Lq0Pn82ss0Y3nD2dH4kG97VKWRdmHzft0eDc 3oapbuXhA7sOvAUDp7vWMjpLtAN5ZvHjjq20fwg/DQ8LUe1NzbQuiv448aHx0g7t5Exo F+wg== 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=R2Hqlml+ah6gzp/3q9mZDb5qJnu8grWOuhPc6jvIgoFJOYD4qgqTxTTUVgBqbNErJh KAvw3Szl/KMlUGQ/Qm1CQz7rLF8DPTge7cImG8easvCc24LZUS3Js/lAiidZ5+WxsFOS xCOEHlFCKnVGIsLEExQsBmECkkSfRvqmgh4AEQoMkkfMCrcmR+EcUNLOQcgJPvrZMn9a W4CbfsgKVg70d/H3cnPk1rLWFkoCkQGPkjfKfomJTccFwPGlf7JJsyUJ40ibdnURk2UB H4icVP8yeVBKWjPBT5c+6uk0iixmXveD2WcHKuHr8VdP8Ag6AMcLuOC2lmfUDpjV6GQb JsCg== X-Gm-Message-State: ANoB5pkdPjkf1qNS2tM0J6Wd7GSIxwbOb2TB9eOLPecsNyIx25i/zjKU xfF3EOcYc+2hfKchkzU5XsU= X-Received: by 2002:a05:6a00:21c2:b0:56b:bba4:650a with SMTP id t2-20020a056a0021c200b0056bbba4650amr5861219pfj.4.1668737661580; Thu, 17 Nov 2022 18:14:21 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id ip13-20020a17090b314d00b00212cf2fe8c3sm10678445pjb.1.2022.11.17.18.14.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 18:14:21 -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 v2 4/4] folio-compat: Remove try_to_release_page() Date: Thu, 17 Nov 2022 18:14:10 -0800 Message-Id: <20221118021410.24420-5-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118021410.24420-1-vishal.moola@gmail.com> References: <20221118021410.24420-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?1749798546095812945?= X-GMAIL-MSGID: =?utf-8?q?1749798546095812945?= 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"))