From patchwork Tue Apr 23 22:55:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13640866 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D907AC4345F for ; Tue, 23 Apr 2024 22:56:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5FC106B018D; Tue, 23 Apr 2024 18:56:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 537376B018F; Tue, 23 Apr 2024 18:56:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44CF16B0190; Tue, 23 Apr 2024 18:56:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1ABDE6B018D for ; Tue, 23 Apr 2024 18:56:05 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8D762120F96 for ; Tue, 23 Apr 2024 22:56:04 +0000 (UTC) X-FDA: 82042306248.03.230AFE7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf24.hostedemail.com (Postfix) with ESMTP id B4A8418001D for ; Tue, 23 Apr 2024 22:56:02 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=NT2phuhB; spf=none (imf24.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713912962; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=INusEyB6dR3vgU5usJpWnfIw4VplmU4zwONWpNN/d/w=; b=DVCR174tbAWgAc//mIUHPelxnDZ64y9RQ8zkEAMse1JVGgEoYua+e8y1HL42qiWO7UlhE3 RhGBi+bxjQQIwerr7bAdB59tUEcgsLq349HUm2umulIKSF3Q8VUiiF5ZspLhA08MhIO7bd y6qBofoiAZNYczbXLXNXmJnWabRlldA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713912962; a=rsa-sha256; cv=none; b=KZ4rxJ3cFQZac7TZmi0ihj8sl8QyyysasWcDWOe70TyD7zxvS5fksOrThEBfRO2zwwmWOa pNfkS5kwnkhTIxe8GuJT9HFde61/lzMxKog0loRnk7zYBcOrSwu9w0Say2hn16tPsCy7Bg 8/llCTrcCAbQmkp4aO7rdMtmzbrDQ9M= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=NT2phuhB; spf=none (imf24.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=INusEyB6dR3vgU5usJpWnfIw4VplmU4zwONWpNN/d/w=; b=NT2phuhB9ilem0ZbyyRx5jBEPe JMbXTjlRG5reeWvDli1o699wO7DV0K1j8OXZXC8c8ksIm2T9sSZfzRhbwbbmtDaYai/OMJX/h/1JI 2Hn/U3vhEWzalCdjm77c4mqnQ+rH/OsTFTV8JaPtAvfgZwPAvz5UHlCvTC8+vsBdFMTjE3HcZXKYo DpCBiYu1SklMcCKYgHCwhIswIDNhKdBrOEFI9xxAiMPxg3s4gsElsBR9yY7M+djUeP8uizrw/2tDR YHfKURym5m/8DjC3/f6CiRiSoFIkd0ryFFDjaIS3EB+O0v+cFV4uZQo6kEfFJbQf6gmj6pJeYFn6Y S3L4opow==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzP3K-0000000HG6E-1Erv; Tue, 23 Apr 2024 22:55:54 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 1/6] fscrypt: Convert bh_get_inode_and_lblk_num to use a folio Date: Tue, 23 Apr 2024 23:55:32 +0100 Message-ID: <20240423225552.4113447-2-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240423225552.4113447-1-willy@infradead.org> References: <20240423225552.4113447-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B4A8418001D X-Rspam-User: X-Stat-Signature: i787hbothtxyuz1miezcfufxgpkf7c54 X-HE-Tag: 1713912962-145795 X-HE-Meta: U2FsdGVkX19DB2DxW1+OxAT1pz1VMOt/S78I05Fk6Nf5c0shYl7NPwc8WOTe+De+qhjuyzv62IWSDXg5Xwt+/4r38gMTFJBi7bBQuEShpWKm0Q8ChcqDAEcgolOBKs2GuuvuzAqPYfaUt34jU7G5icgsnH0oyQLpky5IiNt74XZKLSd3zYKOYOSGzBf0EJIaITdTMyGP+r5BYARpFt/EM8HSl8iZfbFEqxsjdcz6PiHk1JGFP/5AcfAz20SWdoh3IQqQv+mQzNT1D0/dagcdWvAelentQA2Ssc3W6iAZd89JrOkEJ2T6VWHfl5OPvxkWEa/PxML5m2qPjSpHWTUeq5Ehf1anmbGJyuPlO2xz8V138j8y7/apUS/jqsvTCfsqjSzrzYorSRap7zwaMzjp6Q7JOMkqzEJj+gFjWVUvS8XyShP4Kx1NrIOp1DWwmLyh332qZZmwo87F8xWr6Tkps6U1hfLnP3cOgSYQrK3sxoUtFf3at8gzkzszgk6+4vIFExbNLv5RFgyDFpIu9hmy0CoYrESX5yyv2kRZvMmNYAxWUMxoRFrwU0gr2qRM5ariizGqB222EP3dN7SBD7eQTfsmoefuf/xsDXYeFPSETLTSfvsk8Um/Bz4tVZucO7gV3syvqR3UNI2eKfMsuQLuMKVqwpnSi0pnXIbsVXyqTtJCboaiczOLUrT3yCZ0/uWcH0Zr0jaSKtqanKu60qxh+cKl9hsuX+aihMl/SuPOj6TOStkX5jUc83FZNYB2Y+R3bBhEu94a9JMpYBI89HEi6MrZhs9aON1bWktQqYZnqel6MZQ/RM8usSzMbneLe4VanN4UPRRAkIlEMGG0RWDlgrKdVo5dRbqOmXQf0u56cMNq4AeZTD6D2YOl7jtb+LazYfJTx+4NlQmHFneSLqk7J9+O2NmjEJTKd2wSt8/Ehp87zCVDfpm/RA2yF1k042ji0H/ZC8vBUN6VXggJ9a5 LRLrYWBD czHJTHAiiEvx1gYrsJuKsLm8snNf3n6syjD5QY/Cm5+oBtAPqSnOOkT4yIN/A05xmhPgTRTOKO6mdkKWnVt/+eeZ8SLEv2LtWXibXt6CooYQwSU0nBP5vwJ/pHnhyNDq/rkTMohD0ib5x0h10h4Nq7KS6Axeo+cVICRLI8q/KLH3wC0kM9YlOLEqo0pCsMILFBkwa8i02rBR3x/3GNA2WA6JQ+jSIAlys0Iga X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Remove uses of page->index, page_mapping() and b_page. Saves a call to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Eric Biggers --- fs/crypto/inline_crypt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/crypto/inline_crypt.c b/fs/crypto/inline_crypt.c index b4002aea7cdb..40de69860dcf 100644 --- a/fs/crypto/inline_crypt.c +++ b/fs/crypto/inline_crypt.c @@ -284,7 +284,7 @@ static bool bh_get_inode_and_lblk_num(const struct buffer_head *bh, const struct inode **inode_ret, u64 *lblk_num_ret) { - struct page *page = bh->b_page; + struct folio *folio = bh->b_folio; const struct address_space *mapping; const struct inode *inode; @@ -292,13 +292,13 @@ static bool bh_get_inode_and_lblk_num(const struct buffer_head *bh, * The ext4 journal (jbd2) can submit a buffer_head it directly created * for a non-pagecache page. fscrypt doesn't care about these. */ - mapping = page_mapping(page); + mapping = folio_mapping(folio); if (!mapping) return false; inode = mapping->host; *inode_ret = inode; - *lblk_num_ret = ((u64)page->index << (PAGE_SHIFT - inode->i_blkbits)) + + *lblk_num_ret = ((u64)folio->index << (PAGE_SHIFT - inode->i_blkbits)) + (bh_offset(bh) >> inode->i_blkbits); return true; } From patchwork Tue Apr 23 22:55:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13640867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87BD5C04FFE for ; Tue, 23 Apr 2024 22:56:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED3186B018F; Tue, 23 Apr 2024 18:56:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E83ED6B0191; Tue, 23 Apr 2024 18:56:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D729D6B0192; Tue, 23 Apr 2024 18:56:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id BA2D36B018F for ; Tue, 23 Apr 2024 18:56:07 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5641B40138 for ; Tue, 23 Apr 2024 22:56:07 +0000 (UTC) X-FDA: 82042306374.18.EB6F4D3 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf19.hostedemail.com (Postfix) with ESMTP id BB69E1A000B for ; Tue, 23 Apr 2024 22:56:05 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=VPD3YkPl; spf=none (imf19.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713912965; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KYDG6ZsjDj+2iBPQ3OajYlgseuthmwTxF2D+L3YSI+w=; b=SDUO8GEK0ZzqhTXrR2URKOmP/5zcZ/qI7jQ00Tf/eGrWYMRyWHLCyfDJ6X+UuSnzOx+69S P5GPMLaLAzwF4+7QYC16GeJ+bj+tkfhbWtkce97gjQSBf8rzsieyxunO6ey+zuvFbkBUx3 HtasN/nA7DnBKlLvbvyFaYj4xGFjEwo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=VPD3YkPl; spf=none (imf19.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713912965; a=rsa-sha256; cv=none; b=cHOvKsrLQhdQL6BuJFxwtu10UfLv2M7EW0wQRrE9Ery6r4PwsHW04vDOAWAq5p5UXgw2LK TTv48wx6WagH7a1zIWQPyFd6rWd9s3x5CFAPeqQwgGrMruVfcZ59kiZ2nFRxdtWS3WBmfz XNK0B1PSEfgAYVTuLvg4HE6V9z6pnLk= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=KYDG6ZsjDj+2iBPQ3OajYlgseuthmwTxF2D+L3YSI+w=; b=VPD3YkPlOZgK3F00x6rBjyB/qa 7iLvl71KcyySOFpXv6VNcIvJ4kLBFTS/SXC3ZzrjOZBGWVSosHva8VS0O89ku2EGoSb9qZG20yWz2 gsbxrWVoRLITZhb+GHv47Fr7Tcbg/hDcEGYqKicULJLqtr7/WQI/SbIVuXP87EClD4lburQZ8Bn0E 1sENDUkd5HyuQEQA7bd59fijov3p1eibLXaD65uZE4xl1bPmqZpVd8Bz2kpemDPimf7xp4wYx1Bts biZFYcGHus1s7W3aAtQd9JEgMLwAi1M2Q51JgD2jB+d0NH8QBSQz+8Dfe99630W60Xx6+tpx6+3jk Cq8mW83A==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzP3K-0000000HG6G-1bIa; Tue, 23 Apr 2024 22:55:54 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 2/6] f2fs: Convert f2fs_clear_page_cache_dirty_tag to use a folio Date: Tue, 23 Apr 2024 23:55:33 +0100 Message-ID: <20240423225552.4113447-3-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240423225552.4113447-1-willy@infradead.org> References: <20240423225552.4113447-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: eb8sgnt7y416eens5iy65y9drjaouid9 X-Rspamd-Queue-Id: BB69E1A000B X-Rspamd-Server: rspam02 X-Rspam-User: X-HE-Tag: 1713912965-246251 X-HE-Meta: U2FsdGVkX19pKBiZntNZXRTdmljY9025PBr8UUUyv2euWi1MpmkjBskNOkREJG2roUpI3tepPgMBe6GRiaMWmhRh+asHdgmjkjNj99Ug7h3YaWq9uhn4tI8MA0pWdjYo7w+WwQHChcEBEa9Biq/KN66nBqsEhCE+Xm6V+aB7mtkyUlVSKT3Y0Pqc519ybvEc9JaLHY4Wso5aUm17WuMLkVjGgbPLQA5v4wj5H/Q/OBgy0EX1OaNkVnXXpB1bvyKqkwIUwsdAC1iM2/GnrFOBVb6HV2lMzW/4kZUWbRYt5KaPZ6nLBVYFiivc4DPtyxz8Xs4dNfreBRi9S5YtVqRHLcIpQLByzpozhFGZ0rvPtRuaIXxKmXNDhPlEKlS98kscVDcRJbMmxjFIUMXRK56fVD6ISaX77bmaCdwoeLl964u28OJxaMV2HAjRW/zqlU+4QaOH2237XaONGd53SN5reoUa6NtvFp0HN9rauD2kHRzw9uN7P1W174bhl4jYL6dVbRtptNgWDkbeL/+95jVgvtczrSZlP7V8rrrD8VP/l3SEFc+V6sqoHmdO9RKlq9YlPgJIuK7b8oGeyChzYewvNIVwjqBFOXodJNnmggtGaij5DAu0RXUrLHD86ZYYIvak6uR8vq9BH8HRZsQKSA9vur4AUfPY50k8AsPOQjd1Dhy9NdYT0LQHD3q8IWI8hvSoIABaRMrHXAtlkUqzeenky2wurkdx0sjubEOaWzyO08qGft3MZm/B4XvumXOPsK1X4orB9A5AJf5Lyy6t7FDIIYrSKSs7382NYYXyZm9sFrVz3lp+eCQngXRQGUGs7NA6tn7HtEkyuO1c3L7j4ei4rySu7E+uAWxnj5xr58pfhm1mTVOSvX4rQr0q4AZxMbG9X2OnSOZJQ0MweKHtNLsk6WbJYxmdxg2Ze8k+c9MPFgYd6D5EFHfWaWD4AGp601NuEBlns42viAkaVMGtVgO dtxBC7ju WfZMpYRS5Wg4mtsqK2SzQ/Z3wyErpUp+PdJsHAxTjpeAId74DEv6M+ZjgPrHHmz3MQx4AaynYrJKT4htVo1u9sLiiJgIajfEJHKRqolT5AAABL/xYoYDuGq6YT3mrO+VPLiHzn3tXxF9b4rzRxE3yAXNV485GqUV2gktq6CvUSYNVVm94Ihn7DvzdYLI5Q6YbpmHGEi9CZ5mOjHmvFXHjK8laFHoA5E+MoJJZ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Removes uses of page_mapping() and page_index(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand --- fs/f2fs/data.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 5d641fac02ba..9f74c867d790 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -4100,11 +4100,12 @@ const struct address_space_operations f2fs_dblock_aops = { void f2fs_clear_page_cache_dirty_tag(struct page *page) { - struct address_space *mapping = page_mapping(page); + struct folio *folio = page_folio(page); + struct address_space *mapping = folio->mapping; unsigned long flags; xa_lock_irqsave(&mapping->i_pages, flags); - __xa_clear_mark(&mapping->i_pages, page_index(page), + __xa_clear_mark(&mapping->i_pages, folio->index, PAGECACHE_TAG_DIRTY); xa_unlock_irqrestore(&mapping->i_pages, flags); } From patchwork Tue Apr 23 22:55:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13640865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFC50C10F15 for ; Tue, 23 Apr 2024 22:56:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 473026B018B; Tue, 23 Apr 2024 18:56:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3FC256B018D; Tue, 23 Apr 2024 18:56:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29CBA6B018E; Tue, 23 Apr 2024 18:56:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 0AA8E6B018B for ; Tue, 23 Apr 2024 18:56:02 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id AA0C31A013E for ; Tue, 23 Apr 2024 22:56:01 +0000 (UTC) X-FDA: 82042306122.11.DACB5D7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf28.hostedemail.com (Postfix) with ESMTP id 1C247C000D for ; Tue, 23 Apr 2024 22:55:59 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=FXyig58g; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713912960; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1UBrmnaxgdYln7b2mU/BBhde5q/G6uvD2LkDa5Pux+I=; b=bYOArB3m7r3YNLvj7fwf42NIvdNl7YKKGfMvuzX12YZ+YhKwOSk+TTEjOJrJh3Duh/Fqky avW2N51CwGvE+fPl2ehZnXYHL0BBoME26IFswVu011i5ePtD+GtN3bVC5EfclEECRqnzXj MDRwba3wxqBruztCKiBgzbQ6jfH0bhE= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=FXyig58g; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713912960; a=rsa-sha256; cv=none; b=XOyag6mBdeiTfrt+x0DwjwuYc3LA+c9frZfpGUObg2dETxAp1+iio/v4BWYSNRg0QvV2io wbmx1bHYwCrcQT/+jSxS2gXdBOOPNnmphem0tl9U/vmfZMV8HIDGPYaX52CwCG9oSllXzp g/Z+7hAL1KMDchDE4KbcH5iK7I3q7mk= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=1UBrmnaxgdYln7b2mU/BBhde5q/G6uvD2LkDa5Pux+I=; b=FXyig58gEqE0F6D2bAAxl1bEFd TbFp9s4R4fwTdL3FoSptQkFN5bTLYpT2jK+iDm6A9Vd2xto13SwNEaT1EwGTWmHY1vfbQefgEJuOR b/BHY7oS1QcrvdIAreAEC6wH3j+qFshjaaKAPEK3+Po/R/mODKCCYi59tgvKXJci0zKzuL66k1o8i 4eYUH1+6nTLEPJc8Yut2z5NOHLc3JqxriqRcbP7ZBOS06YHw0F5qkjuzColyWuGAuOyZbByJWdqHu eN0FPCovV+XhG6nor35qADfuyXqAP339rkydvrF9oaJrG+/FwSONIFwhfZ9uaTxpLs0ZwZSOumrKM mX1TZc+Q==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzP3K-0000000HG6I-1wTt; Tue, 23 Apr 2024 22:55:54 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 3/6] memory-failure: Remove calls to page_mapping() Date: Tue, 23 Apr 2024 23:55:34 +0100 Message-ID: <20240423225552.4113447-4-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240423225552.4113447-1-willy@infradead.org> References: <20240423225552.4113447-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: mk4h3bncudjneb8dnhgtxweww3ehmiae X-Rspamd-Queue-Id: 1C247C000D X-Rspamd-Server: rspam02 X-Rspam-User: X-HE-Tag: 1713912959-118325 X-HE-Meta: U2FsdGVkX1+WDgAtQYcxMeXcpI3ojcE1v3prTV6JdzLDbYpZu7NU/QV47hmg/zsjrMlrGWA0y7VF/ow+m9NPaGHUSXOmufv6uq7pR9zDmu3/eIU8OZVtkT3l6+jWLdc5mggXS6aWCHaDVqlMBsRWaYEiofQmyJrK3fZZtfAknpQyVLrc4vPevWhCZg77of0fe5Y8+Yhm+Bi0LYtUbmAAPUrJEf22s4ZBgAOQyhWu+HCqlW5ZFH7JtKr7RWH2LMMlSElMhuUVHqWfOvqFb9waFlK9Ow50FczsZnjFu7p0cgM8+GdqVsSdpKOuW4jeRXg0eE8ak2JgwAQpCKVNs3/xv3tfaRAfTl5EuziAnsp/MT5BACJ8PeJSIWgSJblS7bSDBJMfBp47gEgI4YZxfre0QuAREM6eN42J3wE29DmnQszdVLhEamVYmj6SdHHg5wNpdUh42IpDpNHDuS+7NghSJN0bfiZaHb55lYRF0j8f6tjWsSafCG+rGLsLj5Im9N1jX7kZCSTErRMP3wIkeJ6vwUU/guj3N6IukrboGZ6i7YrIeYzwa5qdUYlIY2cGO00owlLFyDgs/flFwJT4FLxDNuKUfajjph1Id8GAqGFOf6QfkUsE6GMvFLpHPtX7GH3S4Z5rUz1pV/Zz0UxbRJOXMAUDuDPO25HUppSvvaaw3+gT+Z+Yv6nNuN0Ct1UxJcIXKRukMFEJaAQy3ypIt+3jiTck3sSbPykq3k0rNDXVXj7C7Q5p3XMbMQH3anl6CHxehc9XkcrBBJjp4th6XHvnxdscDS50dyv0ojQhoPZhhBBvvOC+locEVrFaLKJY3ClA/RikkdYdlawhxCGwS/ArTy3prCF4RZ9EUzC/TUQe4NwJslEd/PbtqOhsTHOKyOg5i3bsbkc6ipZiW/qijFH+TvdiXaUWAGiwtlBTUK1SayVBwD/yA6lMqbx92ReYPD1epHHkCKcjTVMwHbaukrC L/jG88Z2 mdjnI4EjYUlWqcWY79GwjNhuiHYMRJvYz26hkmANkKmWJXa8uTptJ+We6iYUNkwBlHu9jk4V/Tp1jnuqZNhTu++JlhjkN5xED1w9sQ9jKbVhtlCe7uULGVXddiHIROC3CO+IEJEuREKOfvVjWK1ZxYuKMhiZTWqtKLK7wthQT/vsXBeQfUuLoF/0Q3vyQFPtL4MB2oSK0dTzVjRaNCdLtnTmS1UEYpCxWRTVu X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This is mostly just inlining page_mapping() into the two callers. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Sidhartha Kumar Reviewed-by: David Hildenbrand Acked-by: Miaohe Lin --- mm/memory-failure.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index e065dd9be21e..62aa3db17854 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -216,6 +216,7 @@ EXPORT_SYMBOL_GPL(hwpoison_filter_flags_value); static int hwpoison_filter_dev(struct page *p) { + struct folio *folio = page_folio(p); struct address_space *mapping; dev_t dev; @@ -223,7 +224,7 @@ static int hwpoison_filter_dev(struct page *p) hwpoison_filter_dev_minor == ~0U) return 0; - mapping = page_mapping(p); + mapping = folio_mapping(folio); if (mapping == NULL || mapping->host == NULL) return -EINVAL; @@ -1090,7 +1091,8 @@ static int me_pagecache_clean(struct page_state *ps, struct page *p) */ static int me_pagecache_dirty(struct page_state *ps, struct page *p) { - struct address_space *mapping = page_mapping(p); + struct folio *folio = page_folio(p); + struct address_space *mapping = folio_mapping(folio); /* TBD: print more information about the file. */ if (mapping) { From patchwork Tue Apr 23 22:55:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13640864 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D2EDC4345F for ; Tue, 23 Apr 2024 22:56:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D2766B018A; Tue, 23 Apr 2024 18:56:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5817E6B018B; Tue, 23 Apr 2024 18:56:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 470366B018C; Tue, 23 Apr 2024 18:56:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2F6A56B018A for ; Tue, 23 Apr 2024 18:56:00 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A9BE6C0E42 for ; Tue, 23 Apr 2024 22:55:59 +0000 (UTC) X-FDA: 82042306038.14.F433EEB Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 64EE914000C for ; Tue, 23 Apr 2024 22:55:57 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=fWz1hx0j; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713912958; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=HkiZG9m0iZUn7YHN2uAFIsSMCWAiQIiQFvg2/jh9MHY=; b=DV4pQgrCbxWaF/2Ejb05IVVDgXn6OYOP+9Dtag+sS098ZMOVJQsYq8L5knAaKk2Oe96ioU 8EZKsEXyM1Mx9TfCAfV+2gDNB5aIKyVXiK4C7efiIvuDOOjv1NvuVSngc2Zxm19fI5M6CR V8V9AjFFDhzFbLMly8Vm2r0F0EtpQvo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713912958; a=rsa-sha256; cv=none; b=iaucu4i4RbzpGfFmBJX4HIt54eh0G29J060PUcrm1k1aoFFHZMzmt/4Uny919lDzAOdA+4 CAxZU43jo9HvqOfpjyIE1TwSR1+McBqKIqIZ0Gp+kwSi6APrWr6pxKDsZwKrDugYJCVpy5 qOYqUeIKptYJe4T08zQL8zfJImjHVTc= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=fWz1hx0j; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=HkiZG9m0iZUn7YHN2uAFIsSMCWAiQIiQFvg2/jh9MHY=; b=fWz1hx0jDqtp05rXrTDwSTlW1l oZeuyvzFJHEc/0+YW3p1DyW3UWM9dRaBZjHbmz1C2E2jOB081Aye+WIX7P/XqgdmV3Q8eP/iI/ryH IBIzcVOSH1sK7V8oDiocBKo6gv42nFvkExjp6vRYblqvxaazX6cDDC4vZtSxOcaBVbPeheHmXvL2Y k/WZKL/TVFnczAEaKfgpo7QUMvQsNxDyf8R9tZI3BePQ/lc9p6Ng0uqXMg0uvh1mlm/8c0PzoZq/D JiJEX09m8u2IIH8YhGn/N7Fv7wzw5XCysAFi3vVgjr8VPfs3ZvqeDOJCkoh8FHu8h1YQzPomRTlhV f6LivFTw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzP3K-0000000HG6K-2IMq; Tue, 23 Apr 2024 22:55:54 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 4/6] migrate: Expand the use of folio in __migrate_device_pages() Date: Tue, 23 Apr 2024 23:55:35 +0100 Message-ID: <20240423225552.4113447-5-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240423225552.4113447-1-willy@infradead.org> References: <20240423225552.4113447-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: d6s1t5bcbuf1cqtoogmfbkhsijwscdx3 X-Rspamd-Queue-Id: 64EE914000C X-Rspamd-Server: rspam06 X-Rspam-User: X-HE-Tag: 1713912957-265213 X-HE-Meta: U2FsdGVkX18pWmfJITSo3rhW5vY4MGb5d951cIZ3cCUoP9ee+WGcFb0DSSnL9AoL7lCmYUhktERV9DoNOxRkFtlNkyCykBGeo0XYydJF2WdgBriNtPVlrZ7lKby0SLLbv7plWDnbv0X49teUgkDkeK1ZvpJms+HQZ7Rc7CvSbWrHnUwbzxgVF7inujeI6J+Rk3KvI8NGpfkjjvdKU+od0l15MjwKGrvjU/7G/ICTmd2GZ0uxoCV9AeGKLAZ8FwLuR+yu9ezDANRGhD2/ZFj3+nz9blEFmW5USJO56iRLv+e8kh3v91TlhhHHlM8ed+DrNBWHjVnR6PezGv2hC86fWsoWZ+JxHr+k+67tkk/HwbosTfiU+U0wbElbI1lK/yCNaftlBoykpryIoLLm+Pn2lPuHI/c59jQtfLeFIuYOmnV3xZN0Zw+Gi1C7LWU9TEgZuNUTWLhIqoQAFZZ+na3y+8wr6yAbKMfDS8kggLejY/jT5pJVQ5e/5K7bm7gE16iCi2VVilc589UnBCNO+0BH21Td77usm+R7HreQy3tcS8wrCzVXiQ135LmiWglarJVD9sAbjoIjxYyZUV8Q2DgO8tzBoEXIBzB91oX6EWsdIRysWsSogyFnJnJ5EA+J+ziRQ/BCEZsAauLX5GLJ0F6vIj/WWCu0KT3N145SwNpzwL1HOK/wMAvatKvtLmxJg36E9CWwJrQYDO6OmqHFt0c1MZZbi0xcWWrp5X82DqIlDlTHNtBexIS4pkbWClUbEYLH2QRtptW7kngCBQ3MK6AIqMbGVMmhpDY4ZbLVQkLueurTLvXlcu7g9SVsF58Huumi5logi6TxMdfdXO73ftscPvssZwmS4jcko9wHlC1XrfKeW2Jk7Aqto2x6DDYZ5Z0pt2NS2ifexBhhup3PPY/pvvTSurox9kXwRVb82rHf/5bvNYEX87ZkZxJYIPsX1Y+K7jHUOXCR6kqgu3RvGEo 5q7Nxqof Lrmi5kA9Nq9e7+eVFXZ0uOF8yScJdizqu4r1bBmbS8zV9+B/2TwG+pBggaSYthZNGy4x3PgD0CHDqBxdNAUN6cjhZxUDxlJ+RbTWUMQOxYdVdZTCa3NnTRbrPrMKUhInZVP38Thjw5k8hW1lMsvCauNykovkjdOoESJStfQDiVEW4synLPeP10xHmW6VpWzmHp0Solq9yF6ITaBcHRdsYyayJdYhPAG7NFG2g X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Removes a few calls to compound_head() and a call to page_mapping(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand --- mm/migrate_device.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/mm/migrate_device.c b/mm/migrate_device.c index a68616c1965f..aecc71972a87 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -692,6 +692,7 @@ static void __migrate_device_pages(unsigned long *src_pfns, struct page *newpage = migrate_pfn_to_page(dst_pfns[i]); struct page *page = migrate_pfn_to_page(src_pfns[i]); struct address_space *mapping; + struct folio *folio; int r; if (!newpage) { @@ -726,15 +727,12 @@ static void __migrate_device_pages(unsigned long *src_pfns, continue; } - mapping = page_mapping(page); + folio = page_folio(page); + mapping = folio_mapping(folio); if (is_device_private_page(newpage) || is_device_coherent_page(newpage)) { if (mapping) { - struct folio *folio; - - folio = page_folio(page); - /* * For now only support anonymous memory migrating to * device private or coherent memory. @@ -757,11 +755,10 @@ static void __migrate_device_pages(unsigned long *src_pfns, if (migrate && migrate->fault_page == page) r = migrate_folio_extra(mapping, page_folio(newpage), - page_folio(page), - MIGRATE_SYNC_NO_COPY, 1); + folio, MIGRATE_SYNC_NO_COPY, 1); else r = migrate_folio(mapping, page_folio(newpage), - page_folio(page), MIGRATE_SYNC_NO_COPY); + folio, MIGRATE_SYNC_NO_COPY); if (r != MIGRATEPAGE_SUCCESS) src_pfns[i] &= ~MIGRATE_PFN_MIGRATE; } From patchwork Tue Apr 23 22:55:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13640870 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEB4FC4345F for ; Tue, 23 Apr 2024 22:56:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07B956B0195; Tue, 23 Apr 2024 18:56:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 02FC36B0197; Tue, 23 Apr 2024 18:56:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE7576B0198; Tue, 23 Apr 2024 18:56:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C05A56B0195 for ; Tue, 23 Apr 2024 18:56:16 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 45C95160167 for ; Tue, 23 Apr 2024 22:56:16 +0000 (UTC) X-FDA: 82042306752.26.FAC4A80 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf27.hostedemail.com (Postfix) with ESMTP id A4B3C4000E for ; Tue, 23 Apr 2024 22:56:14 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="p/a8joIL"; spf=none (imf27.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713912974; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NEsYsbU8qr0emUe6mxit/OuVTFvxbBfZCV5/pFcVA2w=; b=EDyDaeq3bMAXzrIwbGPXeEiEiBiROqpR7DgjBLuCJTuhaNXtVaFcfWqqrWMZxvarzN35Qy Oq2/rP0sRowVPB1syUrXbVNrSQOcO/tMJl53JHcRSi9Wy45nWwHlpgoYQ5F6kqPgBjjx45 5HQVzp5yCLlTLFBOgOMCj7fjwr1I8oQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713912974; a=rsa-sha256; cv=none; b=xFuJ4/bFvOaIN95M6Jcno+mMgQclM9ByqUtZkdtRBrJYOrdfafuOMsBMODHxDY6AY4gvH0 cfliF9ZFdp64qXrcKXnMpdKrf89sW5zxb+KvDnC8i02KV77cx9iSAwnH0CIaGx5v84EAst eghPkuAYfpu/14qDzZqTiYB8szo8DW4= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="p/a8joIL"; spf=none (imf27.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=NEsYsbU8qr0emUe6mxit/OuVTFvxbBfZCV5/pFcVA2w=; b=p/a8joILHo6OFpo2LhD6CykxRP WENvmFqHj0Ms3f2UKDAOSFJIen96AOJiItabSIxbfg/vMqH4dve5AA62QmtoQ748wuOlzizNjlL4v e/zDOTLlGiOzyDSauvcqu33bjQxTK2ZeUyy6PqvLrabr328y521cnxeM6BDh9iZ+s9TtErkhXew+z OlE6R3FkJueq/zlMKzBgdWdABtXTXqu/xN0aOtUuyE3D6tkefH6hr2EXw8kA4xvYiF6HC2uyxj/aj ukM0aTq63eh25mHnTS/tu5nyZN7C3c9ERJpH7Wgy6T/aPdNNYtvAGR8cnfSlANAxPuxsZxHnO/yht A2/G5ZJQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzP3K-0000000HG6M-2eAw; Tue, 23 Apr 2024 22:55:54 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 5/6] userfault; Expand folio use in mfill_atomic_install_pte() Date: Tue, 23 Apr 2024 23:55:36 +0100 Message-ID: <20240423225552.4113447-6-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240423225552.4113447-1-willy@infradead.org> References: <20240423225552.4113447-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: A4B3C4000E X-Stat-Signature: jdurjn3h6aaaobebks8p5d531ppsmcb9 X-Rspam-User: X-HE-Tag: 1713912974-802880 X-HE-Meta: U2FsdGVkX1944iXHnxP3FybAv6L8OSxMySLpQcRRVctFDIDu6/9aZn7dGX5vbLuH5QDHJc44iIlQe/I1Ii6q28rod5pJqumz2E+W0AWKLzq97OQBIvdghpj8urC9DlMVnBNjSmGdyl/PhzGh7CNPfit92ESvIyZGrMHLYa4DyP4jhNa7X0m4c/A8kujL4xcLBSGhHxL5nrrosXq2pGYQDkRo6Go73rEa28Bfiu7tu4e+e8DMXanki6mZ/tToS18cnyMDkDlVjemtdyEhMbWbErSSr2v1NWX0+nmkNb1CYb8MZTDA3U/3YOsKJ5B7iP4ReciN/0EyvMuf+rDD+WVTkX0XhRduIfGTwO9vGSbEtBmfhG3RVqcidjdbs4woCT1CSu2lo6Lgvq1Q+BrGNsrHgjIPPIEsXUi0NjjQo7Yj5TTQ3m8kabcMVpTJnj7pYi4lf+CrWGMxfRKB98Y7ivO58OqukU+W2fcZmLe9M6eOvi1ZOyBDdSOw2iHzYTG/z49AF+TCFSxXJRY70wM2b4h4hfUGE8XHjnOWdocV2qBNqGSqhVyPZc58th8dvDzc44Y69ASWSS05iDf91imdU8uRCOXxrj8GjK6JAqcPDRiq/kZFQpMaQhkqQ79wIZECGDoGcE8WBIaqsph0AJ+K7QfyrOcYvZFudMWHrLzmFnvQccS+P9Pc6tnT+coLqIm0Y74+2s80d/Be5I8iOTpgLyBp3xSH6pL8fQynd9VGFg13AtrfhB/CM9Nf2BIDlFNPRe+m95iTlZgglRE2JToWnsGsBlxvjuVE3pwiOclopgw7Hi2n8QNubs1Jvl3R2lGAFZ0se/CWguz/dz/nJL4NLDxm89PuW5+koLHuD1xLPHvxOGFl7W2BMV/jNTPGT5fyq2AayZ3TOxd4ztuxL2tKFO37MWzK04T+YMjWCZB63Ylpo6xtdl4rqoY8sO+GDigVe+QFKGgtvZjGePlGEmXLTwS z9QwjXhB CnqPi93Y+qHxI5BAepzmjwWMs1myEr1eFiRK5cmDw/6nTMaJkDfdcTTlZedqp2yzyLOu574/X2W8gz9SmpLKoQ5aC4ZWQdF2xM4R8KfxTlGav98smxDPlMCnE6ea4V7GG3R9ZJ6vV2Pzv6GEs+9KzsT2gi6b/0eMjt/5Jcy/aKj3HMxTXZtUnhi+oEgQB7K1BQNqONQXgtQIb7YFPQ6Go3BYfpwgZ6JFeV32f X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Call page_folio() a little earlier so we can use folio_mapping() instead of page_mapping(), saving a call to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand --- mm/userfaultfd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c index d9dcc7d71a39..e6486923263c 100644 --- a/mm/userfaultfd.c +++ b/mm/userfaultfd.c @@ -180,9 +180,9 @@ int mfill_atomic_install_pte(pmd_t *dst_pmd, pte_t _dst_pte, *dst_pte; bool writable = dst_vma->vm_flags & VM_WRITE; bool vm_shared = dst_vma->vm_flags & VM_SHARED; - bool page_in_cache = page_mapping(page); spinlock_t *ptl; - struct folio *folio; + struct folio *folio = page_folio(page); + bool page_in_cache = folio_mapping(folio); _dst_pte = mk_pte(page, dst_vma->vm_page_prot); _dst_pte = pte_mkdirty(_dst_pte); @@ -212,7 +212,6 @@ int mfill_atomic_install_pte(pmd_t *dst_pmd, if (!pte_none_mostly(ptep_get(dst_pte))) goto out_unlock; - folio = page_folio(page); if (page_in_cache) { /* Usually, cache pages are already added to LRU */ if (newly_allocated) From patchwork Tue Apr 23 22:55:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13640868 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2886AC10F15 for ; Tue, 23 Apr 2024 22:56:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B2A3F6B0192; Tue, 23 Apr 2024 18:56:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AB51C6B0193; Tue, 23 Apr 2024 18:56:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 97B4B6B0194; Tue, 23 Apr 2024 18:56:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 7E9FC6B0192 for ; Tue, 23 Apr 2024 18:56:10 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3E5A1A1A3D for ; Tue, 23 Apr 2024 22:56:10 +0000 (UTC) X-FDA: 82042306500.07.5BD2EC5 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id A1BCBC000A for ; Tue, 23 Apr 2024 22:56:08 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=GXqibsIW; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713912968; a=rsa-sha256; cv=none; b=IjT6fxK/iZWF9CAHD2+O5bZnDBudoSJ70gloCUlYouY2ExpSMcTIeNAc5knbXFXgohcfh8 zgjlNDx8Mxu2sbKt0J4SOhKf9PD8F1WYgeT+4nL9l+aeFUDgO8YPna+lUOv2b2YExXinbN ue6q9ecPQZGvjjpbtK/pQFT1zBKotwM= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=GXqibsIW; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713912968; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6BdbrjGMJLxdb5ZMK/G6foThAN9UndlEGGEDv4wlWRI=; b=dhvjCx0tEscSJ6oRKTpIdEH5Oz0HQKn2FSw+6s2s7slX6AY9grYwZxlYBnphuWfKI6C8CW VID4ps8E4SCaykYjwEhWnDSN6iVxaLnGkczF4Rgo81YWyYNXx2zGl5HIwYHN2SuEo3lb3u kLyRXmxlMc22nFoIhfziZtvMUZnxPQE= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=6BdbrjGMJLxdb5ZMK/G6foThAN9UndlEGGEDv4wlWRI=; b=GXqibsIW/9Se+tRhLO20+7a/v9 wsmcZhSZd4aKV02wYbXtdOm7xh9lbELNh6lQxP5GxA27iIrRPW1rK/Ymdtqpu/+/nGFyAzNy9lxxP vy6pUdo+sbheXOrI4jhKUlZ6Ipc8ez5vku8zL1C7HWAh5Bri1s4bZXyjWL8pl+8/66uAUJKoXWRUz 3l94tyRtywEBnqZANW5qHke2GMUTLpyMRSsIt3MczQUwOdg6NTMK+fBrHg0SKG1L5aBKO9/X9mPsn +iuTcNxlzraFoaUd4AYsaG73ZFUkHXpkDEIEYj9kpBzwsfM/1YOZAAJd1F/v7zGZqC0EVto1KhuBu 8OzRZSlQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzP3K-0000000HG6O-308H; Tue, 23 Apr 2024 22:55:54 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 6/6] mm: Remove page_mapping() Date: Tue, 23 Apr 2024 23:55:37 +0100 Message-ID: <20240423225552.4113447-7-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240423225552.4113447-1-willy@infradead.org> References: <20240423225552.4113447-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: A1BCBC000A X-Stat-Signature: iwdum6rqwhdqq3ef7rfj41yynqa85ip7 X-Rspam-User: X-HE-Tag: 1713912968-461854 X-HE-Meta: U2FsdGVkX19Zvga5nYVjFyZkDTQdSjLL9OXbUcEqQKVqpNQKyK2zVudM0xDgr/4we0nm03IYKwGNMFOpVkH73vwJgHsaa9z3wTIl+vOPJLBa7cwxCKctpz/07ybemPSHZ4p/FaGeFFf4t69ZmUrPM+WDcp9s2lRpaZxyRrjO8/HTPFvZgETuc1cHibMw+igufyk1+OX2rEmGlxUzYNh1a9EGcZgRT3YPR2d4R9t3bsCW8rDKSabMmGEV11RcbndxU5Yqyy/c/U/yvl+oUxF2aHDKOJFziU3PGAw0piSHposFoy0I12y2wwOS64T+DeLoaFw0oQmP0JQpYJ9LJT3QTwgxS3zu/s216MVenmNo/hFSUeVU/J3wdX1bxL1yTdq4rDvmGa9VNPl4/0OVSpUQ3OUAioqgluQqq+jhs7BMwfEr7Fh7aX24na1jWKvlO77xmJ+FCaa7MTrnSQKCzC9jcdZeaybuYdfYgtYnHsvWoMRliYJeXMtRxue/ur/thxPx0tUgFV+2WTK9kiei7/dDk0OZuSvQNLWAXwHgrmU7MTC/xWiGxRVsXwdoFuMbhLHt1s38I4RlyAVZr/b8nKjXglpOBkyWROikK3lFq1rE1PCXPSEK2AnfP4Ggics67+YBP2Qj4VFnO67X3oL5qS1qqcv70LJ9UBQRNQoMSX7O/5d9PpVPVUXWcLUq2twmoG2qazYgqPVjw3ajayxQvTerssbOddRlhKTTg/RMh8/zGaFa65vzeuTWsDeXcVQ03AqoARo6F/eL02/QoOaXhIL/8h6vGd95HNWCpdVBjVEOUVXaltwgEimOQL2p8dINdtzsU+xg0Yo/0E1CYGeULuaWNPzIiU7uSKUWDoZHCGH8zr9IzLH2Kf9mpq7RqVMg+m1DDQnftPdt6Aw14ba78q6/RrownSgPqnnrs6T9w2bUZiTVPatwlr9qa8L490czDKQTrbSirTnIGH3xpPRjp1J VdLYfqG+ jqIK/6fEcUkA+pRyFWKGpDzov9urk7WEwlbz8esCZnT6LlWfxuSAHHdiB72nyWobZRVcvEnDtKpwTNxVUgr1V2Wk6PQMIc362JgRMaCRyJdxpwiqyP1wCFRF8CqldW4ogH4qtRBT6arKy1VOJ6HQ/cZ0L9Ez9R5X1xew/SzpRa0tJdPh46XB6A1jfqtNmCFQ/J2FxZJng+vvdmhcswkTrojqNK10LMRdjpW+c X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: All callers are now converted, delete this compatibility wrapper. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton --- 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 b6f14e9a2d98..941f7ed714b9 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -399,7 +399,6 @@ static inline void filemap_nr_thps_dec(struct address_space *mapping) #endif } -struct address_space *page_mapping(struct page *); struct address_space *folio_mapping(struct folio *); struct address_space *swapcache_mapping(struct folio *); diff --git a/mm/folio-compat.c b/mm/folio-compat.c index f31e0ce65b11..f05906006b3c 100644 --- a/mm/folio-compat.c +++ b/mm/folio-compat.c @@ -10,12 +10,6 @@ #include #include "internal.h" -struct address_space *page_mapping(struct page *page) -{ - return folio_mapping(page_folio(page)); -} -EXPORT_SYMBOL(page_mapping); - void unlock_page(struct page *page) { return folio_unlock(page_folio(page));