From owner-freebsd-fs@freebsd.org Sat Oct 1 20:26:36 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 6FDA9A940B8 for ; Sat, 1 Oct 2016 20:26:36 +0000 (UTC) (envelope-from citrin@citrin.ru) Received: from hz.citrin.ru (hz.citrin.ru [IPv6:2a01:4f8:d16:10c3::2]) (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 3791DA4C for ; Sat, 1 Oct 2016 20:26:36 +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]) (Authenticated sender: citrin@citrin.ru) by hz.citrin.ru (Postfix) with ESMTPSA id 0178B2874D1; Sat, 1 Oct 2016 20:26:32 +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> Cc: "freebsd-fs@freebsd.org" From: Anton Yuzhaninov Message-ID: <68a8ed6d-e302-799c-3d2c-1d85c48d07bf@citrin.ru> Date: Sat, 1 Oct 2016 16:26:17 -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: <20161001115439.GY38409@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=1475353593; bh=4z2uK2adxY83nEXQCwvpktgqfsvR0ZUZH6IAd600Pzg=; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=JXZtA0ILJ73FYlngqdynGZKsNcpTLIcbdY2h+5YNTiEtKN+jQOu1GCkzKOPDwmZQh+EczHzQaIq9EB2eXA5X9/bvyUBQMYVqAnm2j9i6gdb3copgyRMNGmE7UARYCqrwNiA2UVqplwHPkmNajmnBpGMfZeI6jWl+B7qXMdrO7Eo= 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: Sat, 01 Oct 2016 20:26:36 -0000 On 2016-10-01 07:54, Konstantin Belousov wrote: > It might be not too hard to make this case working, although the speed > of the pagein will be detrimental. Try this, please. > diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c > index a80a9c2..01e2ea2 100644 > --- a/sys/vm/vnode_pager.c > +++ b/sys/vm/vnode_pager.c > @@ -796,7 +796,7 @@ vnode_pager_generic_getpages(struct vnode *vp, vm_page_t *m, int count, > * getting pages via VOP_READ. > */ > error = VOP_BMAP(vp, foff / bsize, &bo, &bp->b_blkno, &after, &before); > - if (error == EOPNOTSUPP) { > + if (error == EOPNOTSUPP || (error == 0 && bo->bo_bsize > PAGE_SIZE)) { > relpbuf(bp, freecnt); > VM_OBJECT_WLOCK(object); > for (i = 0; i < count; i++) { With this patch there is no panic, but boot process stops after message: start_init: trying /sbin/init (boot -v was used) And nothing happens after. There is two reasons why I tried to use GELI on SSD with 8k sector size: 1. SSD internally reads data by pages. Host can request from SSD 512 bytes, but full page will be read inside SSD. For my SSD page size is 8k. 2. GELI work faster with big blocks. Quick benchmark for geli on gzero (AES-NI, single geli thread, several parallel dd if=/dev/gzero.eli): 4k sector ~ 350 Mb/s 8k sector ~ 400 Mb/s Bigger sector sizes works even faster, but not useful on real workloads because on small reads by user application more data then necessary will be read and decrypted. Given that vnode_pager is not designed to work with sector size > VM page size it will be more easy for me to reinstall FreeBSD on geli with 4k sectors.