Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Mar 2013 11:33:48 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Ian Lepore <ian@FreeBSD.org>
Cc:        arch@FreeBSD.org
Subject:   Re: Unmapped buffers: to be merged in several days
Message-ID:  <20130313093348.GU3794@kib.kiev.ua>
In-Reply-To: <1363134753.1291.287.camel@revolution.hippie.lan>
References:  <20130311091852.GR3794@kib.kiev.ua> <1363134753.1291.287.camel@revolution.hippie.lan>

next in thread | previous in thread | raw e-mail | index | archive | help

--z0bQ+oXmfTh/YqQi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 12, 2013 at 06:32:33PM -0600, Ian Lepore wrote:
> I tested this for armv4 today, and it works.  I had a (bogus)
> used-before-init warning from gcc, and I had to add a couple lines of
> code to the pmap_copy_pages() to increment some variables; patch
> attached.  I think the pmap-v6 routine needs the same change, but I
> didn't get as far as testing v6 yet. =20
>=20
> I tested with both the md and ahci drivers on armv4.  Peformance seemed
> to be about the same before and after based on some crude tests such as
> "time tar -cf - /mnt >/dev/null" where I had the ahci drive (a fast ssd
> with a few hundred MB of data on ufs) mounted on /mnt.
>=20
> I don't have a v6 board with a sata interface running yet, but I can
> test with md, hopefully I'll get to it tomorrow.
>=20
> -- Ian
>=20

> Minimal changes required to get umapped.17 to build and run.
>=20
> diff -r 179fcc6b2485 -r 2f1c61450df0 sys/arm/arm/pmap.c
> --- a/sys/arm/arm/pmap.c	Tue Mar 12 13:41:10 2013 -0600
> +++ b/sys/arm/arm/pmap.c	Tue Mar 12 13:45:34 2013 -0600
> @@ -4458,6 +4458,9 @@ pmap_copy_pages(vm_page_t ma[], vm_offse
>  		pmap_copy_page_offs_func(VM_PAGE_TO_PHYS(a_pg), a_pg_offset,
>  		    VM_PAGE_TO_PHYS(b_pg), b_pg_offset, cnt);
>  #endif
> +		xfersize -=3D cnt;
> +		a_offset +=3D cnt;
> +		b_offset +=3D cnt;
>  	}
>  }
> =20
> diff -r 179fcc6b2485 -r 2f1c61450df0 sys/dev/md/md.c
> --- a/sys/dev/md/md.c	Tue Mar 12 13:41:10 2013 -0600
> +++ b/sys/dev/md/md.c	Tue Mar 12 13:45:34 2013 -0600
> @@ -753,9 +753,10 @@ mdstart_vnode(struct md_s *sc, struct bi
> =20
>  	KASSERT(bp->bio_length <=3D MAXPHYS, ("bio_length %jd",
>  	    (uintmax_t)bp->bio_length));
> -	if ((bp->bio_flags & BIO_UNMAPPED) =3D=3D 0)
> +	if ((bp->bio_flags & BIO_UNMAPPED) =3D=3D 0) {
> +		pb =3D NULL;
>  		aiov.iov_base =3D bp->bio_data;
> -	else {
> +	} else {
>  		pb =3D getpbuf(&md_vnode_pbuf_freecnt);
>  		pmap_qenter((vm_offset_t)pb->b_data, bp->bio_ma, bp->bio_ma_n);
>  		aiov.iov_base =3D (void *)((vm_offset_t)pb->b_data +

Both are applied, thank you, arm change is needed for pmap-v6.c as well,
definitely.

I do not expect to see much, if any, change in the system time on the
single-core machines, esp. on the memory-starved configurations.

What you could try to measure to get the targeted test, is to calculate
the sha1 of some large file which still fits into the RAM, but causes
the buffer cache trashing. E.g., on my workstation with 12GB of RAM
and 1.2GB of buffer cache space, I would take 10GB file and measure
the time to sha1 it, 4 times. First run is to load the pages into cache,
ignore the first run timings. Next 3 runs give you the data for ministat(1),
for patched and for stock kernels.

On 4x core/HTT sandy bridge machine, I see 30% reduction of the system
time in the described test. For single-core, the difference should be
much less, if any.

--z0bQ+oXmfTh/YqQi
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iQIcBAEBAgAGBQJRQEf7AAoJEJDCuSvBvK1Bg/cQAJZCNV0EPITLyND8YMfpSzG8
WINMfTOOqVPU2Vz2Tz23EAzuIwo/qv9aLY8mp9Ty5OvXPr8v1txPpTUS1+zzFttH
yFshGJyrHzFWl74eWEunJDkfA9WyJxaiOKRgOPIPqzrrhamt0GuA21kRfdx2U4Xj
pcKHwkltBCsViD/eHCts1s2JG6jekDCMq29tJA/XXklafEumOWmmOH2vALK+Bobo
I8O7a+iz50WFZsmPmr8TXlUUONBaCQaKEMyRZ3/UDrcMbvHv7GeiK6SxadhNWrnr
93lK2BBNUD6B4MG3gN+tOfx5qQ/EpVgmiHdtlJbgha/s/44H0Oog0X6EMVuJ4t3a
x0zq9EY7O3aPpsYVSYpSPLKJ3WLYwBMpcPMWJ1fyhNptukDp4IVf8AJVWoJ6g+HD
TeuTXy8TnhOodYJZh55OQhN24DCs8SH9qAOmodGbAwNo7K5bg+t24dnv28T+Ji+O
FB0samkuzfCSBJAWtDJYft3KtaBtJqQdG74X4IAHpsIalZES5pLuiQv9TH3+Z/c9
aWyNJEKFBDlupUe7Dd5DgPl9/H9/54Z7n3toPwE2zk6kiIB4YvO3gAEovulBsKk+
tuZl9XLwTdzW1xsipIW2i7HuqfiZuqYpZntWo4KrOLoCE7NNheAQWiLzc8b5EgFH
dlQlHa+R+zDbtkfreHfd
=5hue
-----END PGP SIGNATURE-----

--z0bQ+oXmfTh/YqQi--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130313093348.GU3794>