From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 664A2C83004 for ; Wed, 29 Apr 2020 13:37:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 20D16208FE for ; Wed, 29 Apr 2020 13:37:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="NHSXfgm8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20D16208FE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 718A88E001B; Wed, 29 Apr 2020 09:37:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DCEF8E0006; Wed, 29 Apr 2020 09:37:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DB838E001B; Wed, 29 Apr 2020 09:37:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0116.hostedemail.com [216.40.44.116]) by kanga.kvack.org (Postfix) with ESMTP id BCBA78E0009 for ; Wed, 29 Apr 2020 09:37:00 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7AA1E181AC553 for ; Wed, 29 Apr 2020 13:37:00 +0000 (UTC) X-FDA: 76760993400.22.flock49_3d25f36035f27 X-HE-Tag: flock49_3d25f36035f27 X-Filterd-Recvd-Size: 5508 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Apr 2020 13:37:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=2R/FYBpDxf8n8DUKZHEPryWyNhbKsTabgMS9K6/ChLE=; b=NHSXfgm8lk/2Hx8SW1rWpWtiV3 CMlijdePU4dNUxJhfYwYKKr++zz3A3vWmZ0U+m39yRV3QnD1yEK6fEIj30dwVbZmhkJGaXB6a4hCS 9WPxVP/ku95he8yuNEd9dWy4YIkAUHLgX17mPcszOtUkVc7gqxXx081Wt/XyobfJJaqzzPVUmiPwx 9ZDVdyUFB/jYmVvKEq+hdDheMxldBQB3n4xgppgq5QNMBECHin+il0gJINg8YZ7tpgjooDajwaTEJ 8iBfm3wuj0F//WR35WQ2hQp9jPNF23EQhb9gPpc6la3Z+JY7BRbk6rU8oFCkwqmTyXmpLtISGbOFA do5Dx+UA==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTmtX-0005uB-2T; Wed, 29 Apr 2020 13:36:59 +0000 From: Matthew Wilcox To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 00/25] Large pages in the page cache Date: Wed, 29 Apr 2020 06:36:32 -0700 Message-Id: <20200429133657.22632-1-willy@infradead.org> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: From: "Matthew Wilcox (Oracle)" This patch set does not pass xfstests. Test at your own risk. It is based on the readahead rewrite which is in Andrew's tree. The large pages somehow manage to fall off the LRU, so the test VM quickly runs out of memory and freezes. To reproduce: # mkfs.xfs /dev/sdb && mount /dev/sdb /mnt && dd if=3D/dev/zero bs=3D1M c= ount=3D2048 of=3D/mnt/bigfile && sync && sleep 2 && sync && echo 1 >/proc= /sys/vm/drop_caches=20 # /host/home/willy/kernel/xarray-2/tools/vm/page-types | grep thp 0x0000000000401800 511 1 ___________Ma_________t__________= __________ mmap,anonymous,thp 0x0000000000405868 1 0 ___U_lA____Ma_b_______t__________= __________ uptodate,lru,active,mmap,anonymous,swapbacked,thp # dd if=3D/mnt/bigfile of=3D/dev/null bs=3D2M count=3D5 # /host/home/willy/kernel/xarray-2/tools/vm/page-types | grep thp 0x0000000000400000 2516 9 ______________________t__________= __________ thp 0x0000000000400028 1 0 ___U_l________________t__________= __________ uptodate,lru,thp 0x000000000040006c 106 0 __RU_lA_______________t__________= __________ referenced,uptodate,lru,active,thp 0x0000000000400228 1 0 ___U_l___I____________t__________= __________ uptodate,lru,reclaim,thp 0x0000000000401800 511 1 ___________Ma_________t__________= __________ mmap,anonymous,thp 0x0000000000405868 1 0 ___U_lA____Ma_b_______t__________= __________ uptodate,lru,active,mmap,anonymous,swapbacked,thp The principal idea here is that a large part of the overhead in dealing with individual pages is that there's just so darned many of them. We would be better off dealing with fewer, larger pages, even if they don't get to be the size necessary for the CPU to use a larger TLB entry. Matthew Wilcox (Oracle) (24): mm: Allow hpages to be arbitrary order mm: Introduce thp_size mm: Introduce thp_order mm: Introduce offset_in_thp fs: Add a filesystem flag for large pages fs: Introduce i_blocks_per_page fs: Make page_mkwrite_check_truncate thp-aware fs: Support THPs in zero_user_segments bio: Add bio_for_each_thp_segment_all iomap: Support arbitrarily many blocks per page iomap: Support large pages in iomap_adjust_read_range iomap: Support large pages in read paths iomap: Support large pages in write paths iomap: Inline data shouldn't see large pages xfs: Support large pages mm: Make prep_transhuge_page return its argument mm: Add __page_cache_alloc_order mm: Allow large pages to be added to the page cache mm: Allow large pages to be removed from the page cache mm: Remove page fault assumption of compound page size mm: Add DEFINE_READAHEAD mm: Make page_cache_readahead_unbounded take a readahead_control mm: Make __do_page_cache_readahead take a readahead_control mm: Add large page readahead William Kucharski (1): mm: Align THP mappings for non-DAX drivers/nvdimm/btt.c | 4 +- drivers/nvdimm/pmem.c | 6 +- fs/ext4/verity.c | 4 +- fs/f2fs/verity.c | 4 +- fs/iomap/buffered-io.c | 110 ++++++++++++++++-------------- fs/jfs/jfs_metapage.c | 2 +- fs/xfs/xfs_aops.c | 4 +- fs/xfs/xfs_super.c | 2 +- include/linux/bio.h | 13 ++++ include/linux/bvec.h | 23 +++++++ include/linux/fs.h | 1 + include/linux/highmem.h | 15 +++-- include/linux/huge_mm.h | 25 +++++-- include/linux/mm.h | 97 ++++++++++++++------------- include/linux/pagemap.h | 62 ++++++++++++++--- mm/filemap.c | 60 ++++++++++++----- mm/highmem.c | 62 ++++++++++++++++- mm/huge_memory.c | 49 ++++++-------- mm/internal.h | 13 ++-- mm/memory.c | 7 +- mm/page_io.c | 2 +- mm/page_vma_mapped.c | 4 +- mm/readahead.c | 145 ++++++++++++++++++++++++++++++---------- 23 files changed, 485 insertions(+), 229 deletions(-) --=20 2.26.2