From owner-freebsd-fs@freebsd.org Mon Oct 3 20:38:47 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 7D4C6AF4304 for ; Mon, 3 Oct 2016 20:38:47 +0000 (UTC) (envelope-from citrin@citrin.ru) Received: from hz.citrin.ru (hz.citrin.ru [88.198.212.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 400F9889 for ; Mon, 3 Oct 2016 20:38:46 +0000 (UTC) (envelope-from citrin@citrin.ru) Received: from [192.168.0.144] (c-24-60-168-172.hsd1.ct.comcast.net [24.60.168.172]) by hz.citrin.ru (Postfix) with ESMTPSA id BF1A5286FFD; Mon, 3 Oct 2016 20:38:42 +0000 (UTC) Subject: Re: UFS: unaligned read from GELI with 8k sectorsize To: Konstantin Belousov References: <20161001114536.GX38409@kib.kiev.ua> <20161001115439.GY38409@kib.kiev.ua> <68a8ed6d-e302-799c-3d2c-1d85c48d07bf@citrin.ru> <20161001211025.GD38409@kib.kiev.ua> <999638f9-3fee-82e3-d67f-cffef53b74e8@citrin.ru> <20161002191349.GH38409@kib.kiev.ua> <20161003174902.GR38409@kib.kiev.ua> Cc: "freebsd-fs@freebsd.org" From: Anton Yuzhaninov Message-ID: Date: Mon, 3 Oct 2016 16:38:35 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161003174902.GR38409@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrin.ru; s=s0; t=1475527123; bh=SuMwuJezWJWnMidBU1WYh93H+PHceQrfDlcgjCo99N4=; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=ZJ5z4sZr4N+mTkSSFp3mpmdJmAGxB/X4FdODI3w/CzlUvZkZQ5aD0SiN1qk/AXUmKbQiCm9R8ruoHrS74ItPA1nIfQyAU3JDWQzbIBJq33cw+ejt+5O1lEuDSn9Es8TSOwnpBBfQ7G/0OgTxnsiyZx/F1G1cTqSN5hOOX2VkXm8= 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: Mon, 03 Oct 2016 20:38:47 -0000 On 2016-10-03 13:49, Konstantin Belousov wrote: > I did several bug fixing and read passes over the patch, below is the > current version, hopefully more robust. BTW, do you have INVARIANTS and > perhaps WITNESS in your kernel config ? I didn't have in previous tests, but I've added INVARIANTS and WITNESS for last one. With INVARIANTS I see a LOR on reboot/shutdown: https://imgur.com/a/dWPrm but may be it unrelated to vnode pager. I can confirm, that with this patch (applied to fresh stable/11) geli with 8k sector can be used as root filesystem. I don't know thought will it have some performance benefits compare to geli with 4k when vnode pager is used. Even for raw device I can't provide benchmark data, that it is useless to read from this SSD in blocks less than 8k. Samsung for some reason doesn't publish full spec for the SSD (with NAND page size and erase block size). Info about 8k pages comes from random posts on internet forums. In may case attempt to use 8k sector in geli is attempt to get optimal performance, but may be there are cases when >4k sectors are used in hardware. See e. g. this old thread: https://lists.freebsd.org/pipermail/freebsd-fs/2010-November/010023.html > +SYSCTL_INT(_vfs_ffs, OID_AUTO, use_buf_pager, CTLFLAG_RW, &use_buf_pager, 0, > + "always use buffer pager instead of bmap"); Small nit: most sysctl descriptions begin with a capital letter. I prefer CTLFLAG_RWTUN because this settings affects boot process (I haven't tested use_buf_pager=1 yet). > + if (!use_buf_pager && um->um_devvp->v_bufobj.bo_bsize <= PAGE_SIZE) > + return (vnode_pager_generic_getpages(vp, mm, count, > + ap->a_rbehind, ap->a_rahead, NULL, NULL)); Also I don't like one more if statement in performance critical path (one more place for branch misprediction in CPU), but probably it effect is negligible.