From patchwork Fri Sep 15 09:51:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez X-Patchwork-Id: 13386755 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 018A0EE644C for ; Fri, 15 Sep 2023 09:51:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9A04E6B0332; Fri, 15 Sep 2023 05:51:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 901936B0333; Fri, 15 Sep 2023 05:51:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E0C76B0334; Fri, 15 Sep 2023 05:51:36 -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 5B4716B0332 for ; Fri, 15 Sep 2023 05:51:36 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2D2B8B4398 for ; Fri, 15 Sep 2023 09:51:36 +0000 (UTC) X-FDA: 81238364592.17.EEC79BC Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by imf20.hostedemail.com (Postfix) with ESMTP id 354921C001F for ; Fri, 15 Sep 2023 09:51:32 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=JOehX4by; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf20.hostedemail.com: domain of da.gomez@samsung.com designates 210.118.77.12 as permitted sender) smtp.mailfrom=da.gomez@samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694771493; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KBxqvbiqwxbpjqMz9Z69KDs2z1l+Vy83NL/rF/oYkIA=; b=wqck3eQ+NX9tEjEHGfFRAT4WwNVMxYXGOSet9GvQ+7Dn+K1ji5XOme7JpkUBCCO+h0pM9g 4vHHbA+ugOytxKlrzc3USp5eqQuZpObNrlZu6C7rDNiTO5PS3w+SHX62iFNkPNaMpPn+Uh CLK/v4WCwK5IhyCLF6rgHyHx3lgP3jY= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=JOehX4by; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf20.hostedemail.com: domain of da.gomez@samsung.com designates 210.118.77.12 as permitted sender) smtp.mailfrom=da.gomez@samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694771493; a=rsa-sha256; cv=none; b=CcUN9A1iirlQcQV/Yx9lFgKdWA/jw6cC7vBwOlruSGF/fk2lGjeciniCXymKNvlORyIJCK RbOBoMOA7Bs5sK8ocvVVDuBwSI0WPn6FAQhcdbMOoUhN7EKEkK4RFv0k8Y3q2/LaGqN4jp 8j6nENl0OJTEHbcPPEzmIX46Bo3pI4I= Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230915095131euoutp02918031175f9c8fd2f4dd43eda8f14eb0~FCbFSC3vY1230712307euoutp02L for ; Fri, 15 Sep 2023 09:51:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230915095131euoutp02918031175f9c8fd2f4dd43eda8f14eb0~FCbFSC3vY1230712307euoutp02L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1694771492; bh=KBxqvbiqwxbpjqMz9Z69KDs2z1l+Vy83NL/rF/oYkIA=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=JOehX4by5wtuX/tE/lkY/wGdcZiXjGvV+uvowvsHd2pzTMwEPs6jAg6SaKbGyeYcE iR1US6vyNvUMUR3ILaF+Pv2qAnqLxDu6BYFROC3ouKN35j27QhPrumNlIemiLqUGlG wMaSFWpsfDW+px6/1X9wAnkxvPWX6ewHOlmRMtkE= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230915095131eucas1p25cc2b04fd359369a4fc473bf907da57c~FCbFAjAMZ1349613496eucas1p21; Fri, 15 Sep 2023 09:51:31 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 2B.9A.42423.32924056; Fri, 15 Sep 2023 10:51:31 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230915095131eucas1p1010e364cd1c351e5b7379954bd237a3d~FCbEmMxFv0060700607eucas1p1L; Fri, 15 Sep 2023 09:51:31 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230915095131eusmtrp24a417d7970c44623708b2e39cfebe5a0~FCbElcNAu1712217122eusmtrp27; Fri, 15 Sep 2023 09:51:31 +0000 (GMT) X-AuditID: cbfec7f2-a51ff7000002a5b7-1a-65042923bb09 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 09.3B.10549.22924056; Fri, 15 Sep 2023 10:51:31 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230915095130eusmtip22dc6e7222c8a07a587bf7bef6f55c865~FCbES6n5V0935009350eusmtip2L; Fri, 15 Sep 2023 09:51:30 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 15 Sep 2023 10:51:30 +0100 Received: from CAMSVWEXC02.scsc.local ([::1]) by CAMSVWEXC02.scsc.local ([fe80::3c08:6c51:fa0a:6384%13]) with mapi id 15.00.1497.012; Fri, 15 Sep 2023 10:51:30 +0100 From: Daniel Gomez To: "minchan@kernel.org" , "senozhatsky@chromium.org" , "axboe@kernel.dk" , "djwong@kernel.org" , "willy@infradead.org" , "hughd@google.com" , "akpm@linux-foundation.org" , "mcgrof@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" CC: "gost.dev@samsung.com" , Pankaj Raghav , Daniel Gomez Subject: [PATCH 5/6] shmem: add file length in shmem_get_folio path Thread-Topic: [PATCH 5/6] shmem: add file length in shmem_get_folio path Thread-Index: AQHZ57ozxEpCdFcMBk645e2R7dVRyg== Date: Fri, 15 Sep 2023 09:51:29 +0000 Message-ID: <20230915095042.1320180-6-da.gomez@samsung.com> In-Reply-To: <20230915095042.1320180-1-da.gomez@samsung.com> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [106.110.32.103] MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02SfVBMYRTG57179+7tjtW1Wr2EMduUsZul4Y+LUMNwfczEjDEYg2tdWX1g txX5KoNRI5K+7G6lsJS0WqXUrpJRtpSy+RhGwkY0JopY1abtLtN/v+c553nPOTMvzhNZ+ZNw ZVQ0q4piIiQYgd6pdTyZ6TsDZWdfbJ5G6Y2FGHXjzTmMstnHUh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S21j4 v3mJxP+vnMmT02c8sTp+3flzua/+XRUlluKMREMt5qLiRABLoVzZ1gMAAA== X-CMS-MailID: 20230915095131eucas1p1010e364cd1c351e5b7379954bd237a3d X-Msg-Generator: CA X-RootMTR: 20230915095131eucas1p1010e364cd1c351e5b7379954bd237a3d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230915095131eucas1p1010e364cd1c351e5b7379954bd237a3d References: <20230915095042.1320180-1-da.gomez@samsung.com> X-Rspamd-Queue-Id: 354921C001F X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: sdc33khhr5ks7jhy9xkqhaarozd3xe4w X-HE-Tag: 1694771492-848673 X-HE-Meta: U2FsdGVkX1+EDJOCqrw6hzhXeUfjsm5+QxQgE3FAAgvwmn4TjhLUuKt1zL7ciGVJLqWE8SyGfyZPj0wqjTBuSjD9OOehC1c+jGQmfYyKxfdvKst6IRDwl6yRkjHOMM/+99xo3XugPvFuwaxgVBVtSj/B8m9eZQ/9QCi0aojAKV6P3bOOof2gCgI8axYTpWTOvDmL66m31ygd8RD6lLDwkwJfGVaVOSsZI1Y7aX61ntasw7WVaKD0o/mBTnwQGpr8TKnisJgquJjdSlZ/xg4sh2mLrf1vbLGt1R7ljZuH8J1UblZ8dd7C2thaHhKqT5YLZwScfJX1um4St4y2oJVFcVv2JbZ6Sa+Ko+vMUsCSRHdlawkWgHYXX997sSY8SPIUBJmK7ZaXhfG9JYENS2c7f3ylTGbZRDX7xxkvjz78xK793UnIH474P9A562/neGqIk5q0pHZ5d5bPJ9pi6MotdCqBz9rSSal2MN8114rzFGXbq+mLUSrRiYtv+rRGSa7jmFZY5Ivm5hSbqUJBJMtX1J9KQbwJQFO6/vORnGcgfcMbng2x1LQxunG9m11OunJw5OhqBF8plD17gS81Y8NvrVbuzfQwK/AMKOpOzxRr8JRB+MfE00H7uboDk8DlgRnogkGYH+uHEL65ZCEKXJD8YBZx4rrd2cj8A4KgFuUSaQWdMO4tRetmmTpRVYqwhZM6Kjh/F29guU/gelaxW373JQZgYWmzeSES3HfQPKjDLSi//CdhMnKtSHECv0VmyUxXmFlPBAcFG0r/bYMgwwZ6/lmpcndy5FSiepfB/tO22VPnuf9+ai+G6QgImI6qzOD/ni2jpc/R0F75RvE6FSLp2Yve+CwUmSUny+2ivc+6CHR+CxoTiTCV7k5GMakvhv0IJ92MrTxoAdadEw/vtqz2Fg/qJ+zsOdFKo2DRrxUsN1tfuttWpjACrB5qHdHxZPn94ho/c5GZ4fzz6k2XoUu imU4VBTN JNswnkZ51kt7Zqpy+hqAwOfWyyh8naXIO0MnYBKvFlaufQ+OD98Or37lUaQyAPcroMdRlfmdog/TeNfo3Qg0sfPirZIB0it+xXY4oI0QByvpujqs+RXSZxL+1B6vuanh2oh3V8+ch/oWjf3MlQhcI3fE+lAHXCwb143U+hYPpYfS3z6t9+B3x1ac27W9u4e3gO1dOMYNf8LLK3HYyBXEextRh6w== 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: To be able to calculate folio order based on the file size when allocation occurs on the write path. Use of length 0 for non write paths. Signed-off-by: Daniel Gomez --- include/linux/shmem_fs.h | 2 +- mm/khugepaged.c | 2 +- mm/shmem.c | 28 ++++++++++++++++------------ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 6b0c626620f5..b3509e7f1054 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h @@ -133,7 +133,7 @@ enum sgp_type { }; int shmem_get_folio(struct inode *inode, pgoff_t index, struct folio **foliop, - enum sgp_type sgp); + enum sgp_type sgp, size_t len); struct folio *shmem_read_folio_gfp(struct address_space *mapping, pgoff_t index, gfp_t gfp); diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 88433cc25d8a..e5d3feff6de6 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1856,7 +1856,7 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr, xas_unlock_irq(&xas); /* swap in or instantiate fallocated page */ if (shmem_get_folio(mapping->host, index, - &folio, SGP_NOALLOC)) { + &folio, SGP_NOALLOC, 0)) { result = SCAN_FAIL; goto xa_unlocked; } diff --git a/mm/shmem.c b/mm/shmem.c index ee297d8874d3..adff74751065 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -969,7 +969,7 @@ static struct folio *shmem_get_partial_folio(struct inode *inode, pgoff_t index) * (although in some cases this is just a waste of time). */ folio = NULL; - shmem_get_folio(inode, index, &folio, SGP_READ); + shmem_get_folio(inode, index, &folio, SGP_READ, 0); return folio; } @@ -1950,7 +1950,7 @@ static int shmem_swapin_folio(struct inode *inode, pgoff_t index, static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index, struct folio **foliop, enum sgp_type sgp, gfp_t gfp, struct vm_area_struct *vma, struct vm_fault *vmf, - vm_fault_t *fault_type) + vm_fault_t *fault_type, size_t len) { struct address_space *mapping = inode->i_mapping; struct shmem_inode_info *info = SHMEM_I(inode); @@ -2164,10 +2164,11 @@ static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index, } int shmem_get_folio(struct inode *inode, pgoff_t index, struct folio **foliop, - enum sgp_type sgp) + enum sgp_type sgp, size_t len) { return shmem_get_folio_gfp(inode, index, foliop, sgp, - mapping_gfp_mask(inode->i_mapping), NULL, NULL, NULL); + mapping_gfp_mask(inode->i_mapping), + NULL, NULL, NULL, len); } /* @@ -2251,7 +2252,7 @@ static vm_fault_t shmem_fault(struct vm_fault *vmf) } err = shmem_get_folio_gfp(inode, vmf->pgoff, &folio, SGP_CACHE, - gfp, vma, vmf, &ret); + gfp, vma, vmf, &ret, i_size_read(inode)); if (err) return vmf_error(err); if (folio) @@ -2702,6 +2703,9 @@ shmem_write_begin(struct file *file, struct address_space *mapping, struct folio *folio; int ret = 0; + if (!mapping_large_folio_support(mapping)) + len = min_t(size_t, len, PAGE_SIZE - offset_in_page(pos)); + /* i_rwsem is held by caller */ if (unlikely(info->seals & (F_SEAL_GROW | F_SEAL_WRITE | F_SEAL_FUTURE_WRITE))) { @@ -2711,7 +2715,7 @@ shmem_write_begin(struct file *file, struct address_space *mapping, return -EPERM; } - ret = shmem_get_folio(inode, index, &folio, SGP_WRITE); + ret = shmem_get_folio(inode, index, &folio, SGP_WRITE, len); if (ret) return ret; @@ -2783,7 +2787,7 @@ static ssize_t shmem_file_read_iter(struct kiocb *iocb, struct iov_iter *to) break; } - error = shmem_get_folio(inode, index, &folio, SGP_READ); + error = shmem_get_folio(inode, index, &folio, SGP_READ, 0); if (error) { if (error == -EINVAL) error = 0; @@ -2960,7 +2964,7 @@ static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos, break; error = shmem_get_folio(inode, *ppos / PAGE_SIZE, &folio, - SGP_READ); + SGP_READ, 0); if (error) { if (error == -EINVAL) error = 0; @@ -3147,7 +3151,7 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset, error = -ENOMEM; else error = shmem_get_folio(inode, index, &folio, - SGP_FALLOC); + SGP_FALLOC, 0); if (error) { info->fallocend = undo_fallocend; /* Remove the !uptodate folios we added */ @@ -3502,7 +3506,7 @@ static int shmem_symlink(struct mnt_idmap *idmap, struct inode *dir, inode->i_op = &shmem_short_symlink_operations; } else { inode_nohighmem(inode); - error = shmem_get_folio(inode, 0, &folio, SGP_WRITE); + error = shmem_get_folio(inode, 0, &folio, SGP_WRITE, 0); if (error) goto out_remove_offset; inode->i_mapping->a_ops = &shmem_aops; @@ -3550,7 +3554,7 @@ static const char *shmem_get_link(struct dentry *dentry, return ERR_PTR(-ECHILD); } } else { - error = shmem_get_folio(inode, 0, &folio, SGP_READ); + error = shmem_get_folio(inode, 0, &folio, SGP_READ, 0); if (error) return ERR_PTR(error); if (!folio) @@ -4923,7 +4927,7 @@ struct folio *shmem_read_folio_gfp(struct address_space *mapping, BUG_ON(!shmem_mapping(mapping)); error = shmem_get_folio_gfp(inode, index, &folio, SGP_CACHE, - gfp, NULL, NULL, NULL); + gfp, NULL, NULL, NULL, i_size_read(inode)); if (error) return ERR_PTR(error);