From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f177.google.com ([209.85.223.177]:35678 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757177AbbJ2OAr (ORCPT ); Thu, 29 Oct 2015 10:00:47 -0400 Received: by iofz202 with SMTP id z202so46289568iof.2 for ; Thu, 29 Oct 2015 07:00:46 -0700 (PDT) Subject: Re: Bad fs performance, IO freezes To: "cheater00 ." , Liu Bo References: <562E37F4.9080602@oracle.com> <562F638B.1040701@gmail.com> <562F7C7B.6060408@gmail.com> <562F97B5.8000108@gmail.com> Cc: Henk Slager , Btrfs BTRFS From: Austin S Hemmelgarn Message-ID: <56322679.8050001@gmail.com> Date: Thu, 29 Oct 2015 10:00:25 -0400 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-512; boundary="------------ms040005010101000709050908" Sender: linux-btrfs-owner@vger.kernel.org List-ID: This is a cryptographically signed message in MIME format. --------------ms040005010101000709050908 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 2015-10-29 09:03, cheater00 . wrote: > Hi Liu, > after talking with Holger I believe turning off COW on this FS will > work to alleviate this issue. However, even with COW on, btrfs > shouldn't be making my computer freeze every 5 seconds... especially > while the disk is written to at mere tens of kilobytes per second. > It's not even the disk holding the system. I consider this a pretty > bad bug... should we go on with trying to reproduce a minimum case? > How would I go about this? Well, COW can cause some pretty unexpected behavior for some use cases.=20 If you have a big disk (I think I remember you saying it was larger=20 than 1TB), then COW can cause some pretty significant seek times because = of how it works. With the current state of BTRFS, I wouldn't personally = consider running BTRFS on anything bigger than 256G with a non-zero seek = time with COW turned on, because large rewrites would have the potential = to cause horrifically long seek times just for a RMW cycle on a single=20 block, and this is in turn part of why database files and=20 virtual-machine images tend to be pathological use cases for BTRFS. I do agree that this kind of thing is a bug, but it's not something that = causes data corruption, which means that it is slightly lower priority=20 as far as most people are concerned. Reproducing it might be tricky=20 also, because I'd be willing to bet that things get better to the point=20 of it being almost unnoticeable with an internal disk (USB is horrible=20 when it comes to block storage performance, and has all kinds of=20 potential reliability issues). Normally, when I try to go about reproducing something like this, I use=20 a virtual machine running the most recent stable version of the Linux=20 kernel, usually with a minimalistic Gentoo installation (although a=20 clean install of pretty much any distro works fine). There are a couple = of reasons I use such a setup: 1. Using a clean install provides a well defined initial state, making=20 it easier for other people to reproduce any results. 2. Using the most recent stable kernel available (usually) eliminates=20 the chances of old bugs causing issues. 3. Using a VM means that your disk access will be slower, which will=20 visibly accentuate any kind of performance issues. 4. Using a VM also means that it is very easy to safely generate crash=20 dumps and simulate data corruption for testing purposes, and makes it=20 easier to experiment with different parameters (for example, UP versus=20 SMP, or different amounts of RAM). If you do decide to go this route, my suggestion would be to use=20 VirtualBox unless you have significant experience with some other=20 hypervisor, as it's one of the easiest to learn to use (I usually use=20 Xen or QEMU, but both require significant effort to set up initially,=20 and are decidedly non-trivial to learn), and learning to debug stuff=20 like this is itself not an easy task. --------------ms040005010101000709050908 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgMFADCABgkqhkiG9w0BBwEAAKCC Brgwgga0MIIEnKADAgECAgMRLfgwDQYJKoZIhvcNAQENBQAweTEQMA4GA1UEChMHUm9vdCBD QTEeMBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0IFNp Z25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2VydC5vcmcwHhcN MTUwOTIxMTEzNTEzWhcNMTYwMzE5MTEzNTEzWjBjMRgwFgYDVQQDEw9DQWNlcnQgV29UIFVz ZXIxIzAhBgkqhkiG9w0BCQEWFGFoZmVycm9pbjdAZ21haWwuY29t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