From patchwork Thu Sep 15 11:54:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A . Shutemov" X-Patchwork-Id: 9333513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2697601C2 for ; Thu, 15 Sep 2016 12:12:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0E2C296A4 for ; Thu, 15 Sep 2016 12:12:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C45A6296A6; Thu, 15 Sep 2016 12:12:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D894F296A4 for ; Thu, 15 Sep 2016 12:12:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934430AbcIOMMl (ORCPT ); Thu, 15 Sep 2016 08:12:41 -0400 Received: from mga06.intel.com ([134.134.136.31]:21913 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756187AbcIOLzd (ORCPT ); Thu, 15 Sep 2016 07:55:33 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP; 15 Sep 2016 04:55:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,339,1470726000"; d="scan'208";a="1050743610" Received: from black.fi.intel.com ([10.237.72.56]) by orsmga002.jf.intel.com with ESMTP; 15 Sep 2016 04:55:28 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id E1763EE; Thu, 15 Sep 2016 14:55:25 +0300 (EEST) From: "Kirill A. Shutemov" To: "Theodore Ts'o" , Andreas Dilger , Jan Kara , Andrew Morton Cc: Alexander Viro , Hugh Dickins , Andrea Arcangeli , Dave Hansen , Vlastimil Babka , Matthew Wilcox , Ross Zwisler , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv3 00/41] ext4: support of huge pages Date: Thu, 15 Sep 2016 14:54:42 +0300 Message-Id: <20160915115523.29737-1-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.9.3 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Here's respin of my huge ext4 patchset on top of v4.8-rc6 with couple of fixes (see below). Please review and consider applying. I don't see any xfstests regressions with huge pages enabled. Patch with new configurations for xfstests-bld is below. The basics are the same as with tmpfs[1] which is in Linus' tree now and ext4 built on top of it. The main difference is that we need to handle read out from and write-back to backing storage. Head page links buffers for whole huge page. Dirty/writeback tracking happens on per-hugepage level. We read out whole huge page at once. It required bumping BIO_MAX_PAGES to not less than HPAGE_PMD_NR. I defined BIO_MAX_PAGES to HPAGE_PMD_NR if huge pagecache enabled. On split_huge_page() we need to free buffers before splitting the page. Page buffers takes additional pin on the page and can be a vector to mess with the page during split. We want to avoid this. If try_to_free_buffers() fails, split_huge_page() would return -EBUSY. Readahead doesn't play with huge pages well: 128k max readahead window, assumption on page size, PageReadahead() to track hit/miss. I've got it to allocate huge pages, but it doesn't provide any readahead as such. I don't know how to do this right. It's not clear at this point if we really need readahead with huge pages. I guess it's good enough for now. Shadow entries ignored on allocation -- recently evicted page is not promoted to active list. Not sure if current workingset logic is adequate for huge pages. On eviction, we split the huge page and setup 4k shadow entries as usual. Unlike tmpfs, ext4 makes use of tags in radix-tree. The approach I used for tmpfs -- 512 entries in radix-tree per-hugepages -- doesn't work well if we want to have coherent view on tags. So the first 8 patches of the patchset converts tmpfs to use multi-order entries in radix-tree. The same infrastructure used for ext4. Encryption doesn't handle huge pages yet. To avoid regressions we just disable huge pages for the inode if it has EXT4_INODE_ENCRYPT. Tested with 4k, 1k, encryption and bigalloc. All with and without huge=always. I think it's reasonable coverage. The patchset is also in git: git://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git hugeext4/v3 [1] http://lkml.kernel.org/r/1465222029-45942-1-git-send-email-kirill.shutemov@linux.intel.com Changes since v2: - fix intermittent crash in generic/299; - typo (condition inversion) in do_generic_file_read(), reported by Jitendra; TODO: - readahead ?; - wire up madvise()/fadvise(); - encryption with huge pages; - reclaim of file huge pages can be optimized -- split_huge_page() is not required for pages with backing storage; From f523dd3aad026f5a3f8cbabc0ec69958a0618f6b Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Fri, 12 Aug 2016 19:44:30 +0300 Subject: [PATCH] Add few more configurations to test ext4 with huge pages Four new configurations: huge_4k, huge_1k, huge_bigalloc, huge_encrypt. Signed-off-by: Kirill A. Shutemov --- .../test-appliance/files/root/fs/ext4/cfg/all.list | 4 ++++ .../test-appliance/files/root/fs/ext4/cfg/huge_1k | 6 ++++++ .../test-appliance/files/root/fs/ext4/cfg/huge_4k | 6 ++++++ .../test-appliance/files/root/fs/ext4/cfg/huge_bigalloc | 14 ++++++++++++++ .../files/root/fs/ext4/cfg/huge_bigalloc.exclude | 7 +++++++ .../test-appliance/files/root/fs/ext4/cfg/huge_encrypt | 5 +++++ .../files/root/fs/ext4/cfg/huge_encrypt.exclude | 16 ++++++++++++++++ kvm-xfstests/util/parse_cli | 1 + 8 files changed, 59 insertions(+) create mode 100644 kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_1k create mode 100644 kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_4k create mode 100644 kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_bigalloc create mode 100644 kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_bigalloc.exclude create mode 100644 kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_encrypt create mode 100644 kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_encrypt.exclude diff --git a/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/all.list b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/all.list index 7ec37f4bafaa..14a8e72d2e6e 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/all.list +++ b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/all.list @@ -9,3 +9,7 @@ dioread_nolock data_journal bigalloc bigalloc_1k +huge_4k +huge_1k +huge_bigalloc +huge_encrypt diff --git a/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_1k b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_1k new file mode 100644 index 000000000000..209c76a8a6c1 --- /dev/null +++ b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_1k @@ -0,0 +1,6 @@ +export FS=ext4 +export TEST_DEV=$SM_TST_DEV +export TEST_DIR=$SM_TST_MNT +export MKFS_OPTIONS="-q -b 1024" +export EXT_MOUNT_OPTIONS="huge=always" +TESTNAME="Ext4 1k block with huge pages" diff --git a/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_4k b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_4k new file mode 100644 index 000000000000..bae901cb2bab --- /dev/null +++ b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_4k @@ -0,0 +1,6 @@ +export FS=ext4 +export TEST_DEV=$PRI_TST_DEV +export TEST_DIR=$PRI_TST_MNT +export MKFS_OPTIONS="-q" +export EXT_MOUNT_OPTIONS="huge=always" +TESTNAME="Ext4 4k block with huge pages" diff --git a/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_bigalloc b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_bigalloc new file mode 100644 index 000000000000..b3d87562bce6 --- /dev/null +++ b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_bigalloc @@ -0,0 +1,14 @@ +SIZE=large +export MKFS_OPTIONS="-O bigalloc" +export EXT_MOUNT_OPTIONS="huge=always" + +# Until we can teach xfstests the difference between cluster size and +# block size, avoid collapse_range, insert_range, and zero_range since +# these will fail due the fact that these operations require +# cluster-aligned ranges. +export FSX_AVOID="-C -I -z" +export FSSTRESS_AVOID="-f collapse=0 -f insert=0 -f zero=0" +export XFS_IO_AVOID="fcollapse finsert zero" + +TESTNAME="Ext4 4k block w/bigalloc" + diff --git a/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_bigalloc.exclude b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_bigalloc.exclude new file mode 100644 index 000000000000..bd779be99518 --- /dev/null +++ b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_bigalloc.exclude @@ -0,0 +1,7 @@ +# bigalloc does not support on-line defrag +ext4/301 +ext4/302 +ext4/303 +ext4/304 +ext4/307 +ext4/308 diff --git a/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_encrypt b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_encrypt new file mode 100644 index 000000000000..29f058ba937d --- /dev/null +++ b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_encrypt @@ -0,0 +1,5 @@ +SIZE=small +export MKFS_OPTIONS="" +export EXT_MOUNT_OPTIONS="test_dummy_encryption,huge=always" +REQUIRE_FEATURE=encryption +TESTNAME="Ext4 encryption" diff --git a/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_encrypt.exclude b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_encrypt.exclude new file mode 100644 index 000000000000..b91cc58b5aa3 --- /dev/null +++ b/kvm-xfstests/test-appliance/files/root/fs/ext4/cfg/huge_encrypt.exclude @@ -0,0 +1,16 @@ +ext4/004 # dump/restore doesn't handle quotas + +# encryption doesn't play well with quota +generic/082 +generic/219 +generic/230 +generic/231 +generic/232 +generic/233 +generic/235 +generic/270 + +# generic/204 tests ENOSPC handling; it doesn't correctly +# anticipate the external extended attribute required when +# using a 1k block size +generic/204 diff --git a/kvm-xfstests/util/parse_cli b/kvm-xfstests/util/parse_cli index 83400ea71985..ba64ce5df016 100644 --- a/kvm-xfstests/util/parse_cli +++ b/kvm-xfstests/util/parse_cli @@ -36,6 +36,7 @@ print_help () echo "Common file system configurations are:" echo " 4k 1k ext3 nojournal ext3conv metacsum dioread_nolock " echo " data_journal bigalloc bigalloc_1k inline" + echo " huge_4k huge_1k huge_bigalloc huge_encrypt" echo "" echo "xfstest names have the form: ext4/NNN generic/NNN shared/NNN" echo ""