Message ID | 20230218003323.2322580-1-ericvh@kernel.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp148394wrn; Fri, 17 Feb 2023 16:49:25 -0800 (PST) X-Google-Smtp-Source: AK7set/Zoh7ShelL3GqxFjDNlA6Ca/lbo8NGlWcyPUAC+v9FyXly89EskwF2JqgWu0aysT5cxWi1 X-Received: by 2002:a17:902:fa90:b0:19a:8284:83a2 with SMTP id lc16-20020a170902fa9000b0019a828483a2mr1885027plb.10.1676681365636; Fri, 17 Feb 2023 16:49:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676681365; cv=none; d=google.com; s=arc-20160816; b=Sr+FSKaszsxkwrPiqW5oJm+Ffx/PBJBrrDolc3bbWar1YzwWLscwgH/viAKsYGtZHV dmmJ8lcteCQR82OkpME2srRNT7rui87Pfy7mptJmqXjxEIurqz3g55myNF9NWNgHHvP+ BILH6XcYA03XwauOubMdjt73gsfmpCl7GLdHlnATAOjOFgYZ3fezuBlCc+RoFIS5thg5 VaH56X6291rq4+X2/I6QTMlNMlOwAEVMBRb1/xsOKihj5jJchtre+64pKmgpI2G4ZuQj WVlR7I9rtFZE10eLGLX91Ha0Tpp53Mkt4ELh3LkWpxe9K6P3QCjST+z6AiqE2g4cVxc6 DIHQ== 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=QqeHCeZBkZ41yv09fXeJYjnM+sSkb+0rFkrueg+KhM0=; b=rKlZ1V20LTnN2q7ERnYWil0YE2pZXZl5AzS6Va3aWmbDbI2NJBY2JHk7UqFbx36Xum n3Y5ttXMleD+WlmLSkhLbe8QBon9miufEx1SOFCXm0kTYBN38TaZw0POmcbPf7mwETmp aFXd0VPtPIQc/HYlsQGNM0o+GzkbVp3b8EHq/Qrbm5Zq+AuZxRMiR2DHG1GLQMVP3Ng8 XdJ4s+XkNuHdok9sKvlB4AGb29i4xtQ5kDewEmy9WZCnnPBCVGMXIPR2Omt67BqVfYga jnm6GCBURfcrtXx7cVAVwrFP8thgqie88AmDT/resdqd3/AHm6HJRkDvmaX/5zwgS1r4 ka9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GStguZfz; 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=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a170902e94500b001960922af15si1145287pll.239.2023.02.17.16.49.13; Fri, 17 Feb 2023 16:49:25 -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=@kernel.org header.s=k20201202 header.b=GStguZfz; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230019AbjBRAny (ORCPT <rfc822;daweilics@gmail.com> + 99 others); Fri, 17 Feb 2023 19:43:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbjBRAnu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 17 Feb 2023 19:43:50 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6373218ABF; Fri, 17 Feb 2023 16:43:13 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A1ADF6207E; Sat, 18 Feb 2023 00:33:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2611BC433EF; Sat, 18 Feb 2023 00:33:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676680424; bh=lXhsoutPECxKV3nX3JhNGjme2nqA5IIggiW3j7Todqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GStguZfzTZmY9/0+uqzLErEw1TejVU0fhuxl//reMls8miLIU91W/7TLvimRuiGHf XePD67lej6yLD5XJh0y7TNJJ1DSudwUpuk79+AwNgYZwwciuwJ6WUApJ18mfTlIaYO UiGgS9G+zDI0voHtEpJb8EaOu3t1lKkz8v8RQJssPykqXwao9fSskaKKxH+Lr+Rl7F ctqFm79kJvDFnWfuB5KNEX1ZbGycAgjELErU7MSo8Ye0IQ/XoAgpbc6SklW66MF1Ig UqUq6UcEKHFcB4qMiIqed9Y0FJ6S2Tsob64qOAm1L9GprL5YU+4Px2CizqSnt82M0d 3U9q1K7lXvdQQ== From: Eric Van Hensbergen <ericvh@kernel.org> To: v9fs-developer@lists.sourceforge.net, asmadeus@codewreck.org, rminnich@gmail.com, lucho@ionkov.net Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux_oss@crudebyte.com, Eric Van Hensbergen <ericvh@kernel.org> Subject: [PATCH v4 00/11] Performance fixes for 9p filesystem Date: Sat, 18 Feb 2023 00:33:12 +0000 Message-Id: <20230218003323.2322580-1-ericvh@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230124023834.106339-1-ericvh@kernel.org> References: <20230124023834.106339-1-ericvh@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752596047668354679?= X-GMAIL-MSGID: =?utf-8?q?1758127839599251945?= |
Series |
Performance fixes for 9p filesystem
|
|
Message
Eric Van Hensbergen
Feb. 18, 2023, 12:33 a.m. UTC
This is the fourth version of a patch series which adds a number of features to improve read/write performance in the 9p filesystem. Mostly it focuses on fixing caching to help utilize the recently increased MSIZE limits and also fixes some problematic behavior within the writeback code. All together, these show roughly 10x speed increases on simple file transfers over no caching for readahead mode. Future patch sets will improve cache consistency and directory caching, which should benefit loose mode. This iteration of the patch incorporates an important fix for writeback which uses a stronger mechanism to flush writeback on close of files and addresses observed bugs in previous versions of the patch for writeback, mmap, and loose cache modes. These patches are also available on github: https://github.com/v9fs/linux/tree/ericvh/for-next and on kernel.org: https://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs.git Tested against qemu, cpu, and diod with fsx, dbench, and postmark in every caching mode. I'm gonna definitely submit the first couple patches as they are fairly harmless - but would like to submit the whole series to the upcoming merge window. Would appreciate reviews. Eric Van Hensbergen (11): net/9p: Adjust maximum MSIZE to account for p9 header fs/9p: Expand setup of writeback cache to all levels fs/9p: Consolidate file operations and add readahead and writeback fs/9p: Remove unnecessary superblock flags fs/9p: allow disable of xattr support on mount net/9p: fix bug in client create for .L 9p: Add additional debug flags and open modes fs/9p: Add new mount modes fs/9p: fix error reporting in v9fs_dir_release fs/9p: writeback mode fixes fs/9p: Fix revalidate Documentation/filesystems/9p.rst | 26 ++-- fs/9p/fid.c | 49 +++----- fs/9p/fid.h | 33 ++++- fs/9p/v9fs.c | 49 +++++--- fs/9p/v9fs.h | 10 +- fs/9p/v9fs_vfs.h | 4 - fs/9p/vfs_addr.c | 24 ++-- fs/9p/vfs_dentry.c | 3 +- fs/9p/vfs_dir.c | 10 +- fs/9p/vfs_file.c | 205 +++++++------------------------ fs/9p/vfs_inode.c | 102 +++++++-------- fs/9p/vfs_inode_dotl.c | 69 ++++++----- fs/9p/vfs_super.c | 28 +++-- include/net/9p/9p.h | 5 + net/9p/client.c | 8 +- 15 files changed, 284 insertions(+), 341 deletions(-) -- 2.37.2
Comments
Eric Van Hensbergen wrote on Sat, Feb 18, 2023 at 12:33:12AM +0000: > I'm gonna definitely submit the first couple patches as they are > fairly harmless - but would like to submit the whole series to the > upcoming merge window. Could you take the three patches I have in my 9p-next branch: https://github.com/martinetd/linux/commits/9p-next If you're going to submit some? The async stuff still isn't good, but there three patches have had reviews and should be good to go. (I guess we can just send Linus two pull requests for 9p, but it doesn't really make sense given the low number of patches) > Would appreciate reviews. Just one first review on the form: let's start a new thread for every new revision of the patchset. I also used to relink from the pervious cover letter and thought that made more sense at the time, but I was told to split threads a while ago and now I'm trying some new tools based on lkml.kernel.org's public inbox thread view I can agree it's much simpler to grab a batch of patch if older versions aren't mixed in the thread. (For the curious, I'm just grabbing the thread to review on an e-ink reader for my eyes, but there's also b4 that I've been meaning to try at some point -- https://b4.docs.kernel.org/en/latest/ -- that will likely work the same) Anyway, off to look at patches a bit.
On Saturday, February 18, 2023 1:33:12 AM CET Eric Van Hensbergen wrote: > This is the fourth version of a patch series which adds a number > of features to improve read/write performance in the 9p filesystem. > Mostly it focuses on fixing caching to help utilize the recently > increased MSIZE limits and also fixes some problematic behavior > within the writeback code. > > All together, these show roughly 10x speed increases on simple > file transfers over no caching for readahead mode. Future patch > sets will improve cache consistency and directory caching, which > should benefit loose mode. > > This iteration of the patch incorporates an important fix for > writeback which uses a stronger mechanism to flush writeback on > close of files and addresses observed bugs in previous versions of > the patch for writeback, mmap, and loose cache modes. > > These patches are also available on github: > https://github.com/v9fs/linux/tree/ericvh/for-next > and on kernel.org: > https://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs.git > > Tested against qemu, cpu, and diod with fsx, dbench, and postmark > in every caching mode. > > I'm gonna definitely submit the first couple patches as they are > fairly harmless - but would like to submit the whole series to the > upcoming merge window. Would appreciate reviews. I tested this version thoroughly today (msize=512k in all tests). Good news first: the previous problems of v3 are gone. Great! But I'm still trying to make sense of the performance numbers I get with these patches. So when doing some compilations with 9p, performance of mmap, writeback and readahead are basically all the same, and only loose being 6x faster than the other cache modes. Expected performance results? No errors at least. Good! Then I tested simple linear file I/O. First linear writing a 12GB file (time dd if=/dev/zero of=test.data bs=1G count=12): writeback 3m10s [this series - v4] readahead 0m11s [this series - v4] mmap 0m11s [this series - v4] mmap 0m11s [master] loose 2m50s [this series - v4] loose 2m19s [master] That's a bit surprising. Why is loose and writeback slower? Next linear reading a 12GB file (time cat test.data > /dev/null): writeback 0m24s [this series - v4] readahead 0m25s [this series - v4] mmap 0m25s [this series - v4] mmap 0m9s [master] loose 0m24s [this series - v4] loose 0m24s [master] mmap degredation sticks out here, and no improvement with the other modes? I always performed a guest reboot between each run BTW.
Glad to hear bugs disappeared. writeback having a different performance than mmap is confusing as they should be equivalent. The huge blocksize on your dd is an interesting choice -- it will completely get rid of any impact of readahead. To see impact of readahead, choose a blocksize of less than msize (like 4k) to actually see the perf of readahead. The mmap degradation is likely due to stricter coherence (open-to-close consistency means we wait on writeout), but I'd probably need to go in and trace to verify (which probably isn't a bad idea overall). probably a similar situation for loose and writeback. Essentially, before close consistency it didn't have to wait for the final write to complete before it returns so you see a faster time (even though data wasn't actually written all the way through so you aren't measuring the last little bit of the write (which can be quite large of a big msize). I'm going to take a pass through tomorrow making some fixups that Dominiquee suggested and trying to reproduce/fix the fscache problems. -eric On Sun, Feb 19, 2023 at 3:36 PM Christian Schoenebeck <linux_oss@crudebyte.com> wrote: > > On Saturday, February 18, 2023 1:33:12 AM CET Eric Van Hensbergen wrote: > > This is the fourth version of a patch series which adds a number > > of features to improve read/write performance in the 9p filesystem. > > Mostly it focuses on fixing caching to help utilize the recently > > increased MSIZE limits and also fixes some problematic behavior > > within the writeback code. > > > > All together, these show roughly 10x speed increases on simple > > file transfers over no caching for readahead mode. Future patch > > sets will improve cache consistency and directory caching, which > > should benefit loose mode. > > > > This iteration of the patch incorporates an important fix for > > writeback which uses a stronger mechanism to flush writeback on > > close of files and addresses observed bugs in previous versions of > > the patch for writeback, mmap, and loose cache modes. > > > > These patches are also available on github: > > https://github.com/v9fs/linux/tree/ericvh/for-next > > and on kernel.org: > > https://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs.git > > > > Tested against qemu, cpu, and diod with fsx, dbench, and postmark > > in every caching mode. > > > > I'm gonna definitely submit the first couple patches as they are > > fairly harmless - but would like to submit the whole series to the > > upcoming merge window. Would appreciate reviews. > > I tested this version thoroughly today (msize=512k in all tests). Good news > first: the previous problems of v3 are gone. Great! But I'm still trying to > make sense of the performance numbers I get with these patches. > > So when doing some compilations with 9p, performance of mmap, writeback and > readahead are basically all the same, and only loose being 6x faster than the > other cache modes. Expected performance results? No errors at least. Good! > > Then I tested simple linear file I/O. First linear writing a 12GB file > (time dd if=/dev/zero of=test.data bs=1G count=12): > > writeback 3m10s [this series - v4] > readahead 0m11s [this series - v4] > mmap 0m11s [this series - v4] > mmap 0m11s [master] > loose 2m50s [this series - v4] > loose 2m19s [master] > > That's a bit surprising. Why is loose and writeback slower? > > Next linear reading a 12GB file > (time cat test.data > /dev/null): > > writeback 0m24s [this series - v4] > readahead 0m25s [this series - v4] > mmap 0m25s [this series - v4] > mmap 0m9s [master] > loose 0m24s [this series - v4] > loose 0m24s [master] > > mmap degredation sticks out here, and no improvement with the other modes? > > I always performed a guest reboot between each run BTW. > > >