Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Oct 2016 16:26:17 -0400
From:      Anton Yuzhaninov <citrin@citrin.ru>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org>
Subject:   Re: UFS: unaligned read from GELI with 8k sectorsize
Message-ID:  <68a8ed6d-e302-799c-3d2c-1d85c48d07bf@citrin.ru>
In-Reply-To: <20161001115439.GY38409@kib.kiev.ua>
References:  <f84b069b-aeee-ff3c-d4f9-e2fe3caaddb1@citrin.ru> <20161001114536.GX38409@kib.kiev.ua> <20161001115439.GY38409@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?68a8ed6d-e302-799c-3d2c-1d85c48d07bf>