From owner-freebsd-fs@freebsd.org Wed Dec 7 19:08:21 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56A30C6C727 for ; Wed, 7 Dec 2016 19:08:21 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFEEB1A6A for ; Wed, 7 Dec 2016 19:08:20 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id a197so182772590wmd.0 for ; Wed, 07 Dec 2016 11:08:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=2K+bOx6D5x3LQAcI+n5YHoIyggM+gDDe9Y6SU1TD2F4=; b=Cp2KDG+lTtz0/mCqPo316CEBR5x3Zev6exPIBCsTEh5EBrPbSb1TOLaEe0FifJFePv LIlSTu0sR0iMhTT+T+/d0MuoRp0xMo3XfbpGuw1lZX4zpvS96m3gp2OLIvgy6XRTxsL0 iDa2jNVrJ1s1SebuPNGe2cmCI54s6aZnAhBsdO5w5vI7/gDjPP1eYh/wsSoL5T+HXltC vDV8QmlYrEonsWX2wrzc7NlFdKQnw4PINdmizf++HIIpyf913nLj3L3kxv3fDxS6V9Jw Drw0EqG+QcssDFp9kor4pzGoNphibqqyrWIHbbza3BBzm3TxGx3kAyNeQNDyX7dZGM8v cw4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=2K+bOx6D5x3LQAcI+n5YHoIyggM+gDDe9Y6SU1TD2F4=; b=b3yU/6riJ2AlqZ2ejXmK2Bs1zD9NXCi/l9kdbqlQWPcOWVa4NM1vpadYaQeTDR0bHF 1a3MoEvydFoebOqt0UIJXKvvJLs5d2JP2LBXiJsjNufeUTa4l4H/SesY/I6aOsk3aPqD 5ePTyBDPNtfQ8GKgh3yKSjRlaDllTs/cRhV0LZd+ovfd5MYOgeED0aLEhB+lVbS6QaEk TQJFtJfnUE0h2TI5cggDGNHbpth462NYl347fvN4/vQv7nNb338h4On/lC/dY23xeLzq 9agLoXI2ryuuq2zYM581VdqDGKtI8p2v8PJDo5xDi+zwEJPMhvawi46eA63pkqYLbWZb aZug== X-Gm-Message-State: AKaTC01MG6kX34doNpSLcVdczl4qmzsHuTZz9LiPRcRq/KVgs7aqO27Ctv+BaPAGmV9Msg== X-Received: by 10.25.22.166 with SMTP id 38mr24890770lfw.11.1481137698995; Wed, 07 Dec 2016 11:08:18 -0800 (PST) Received: from spectre.mavhome.dp.ua ([134.249.139.101]) by smtp.gmail.com with ESMTPSA id t15sm4893774lfe.13.2016.12.07.11.08.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2016 11:08:18 -0800 (PST) Sender: Alexander Motin Subject: Re: 11-STABLE vs 11.0-RELENG test To: freebsd-fs@FreeBSD.org References: <8b4ba98d-03d3-f671-33b2-ed12d3b4fb7c@FreeBSD.org> <374b6d16-5cb4-9338-ec1d-65ad93ca29dc@FreeBSD.org> From: Alexander Motin Message-ID: <0b0a2d6c-59f2-aa0e-01ca-ca2613ccbe57@FreeBSD.org> Date: Wed, 7 Dec 2016 21:08:17 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <374b6d16-5cb4-9338-ec1d-65ad93ca29dc@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 19:08:21 -0000 On 07.12.2016 15:34, Alexander Motin wrote: > Closer look shown me the cause. This code sorts I/Os on time, offset > and memory address. But time on FreeBSD (to reduce overhead) returned > with 1ms resolution, so it does not provide reliable ordering. Offset > sorting used by this patch is broken by design, since io_offset field is > always zero there, since it is used only for physical I/Os, not for > logical. As result, I/Os are "sorted" on memory address, that in fact > means complete randomization of all allocations within one millisecond, > predictably killing read performance. > > Switching gethrtime() emulation from getnanouptime() to nanouptime() > fixes the read performance, resulting: > nanouptime() > write 702 > read w/ pref 845 > read w/o pref 272 > > It would be good to make offset sorting really work there rather then > just switching to high resolution time source, but that maybe quite > invasive. Will look more. PS: If somebody needs quick workaround, this loader tunable restores both read and write speed: vfs.zfs.zio.dva_throttle_enabled=0. -- Alexander Motin