kern/173254: [zfs] [patch] Upgrade requests used in ZFS trim map based on ashift

Steven Hartland killing at multiplay.co.uk
Thu Nov 1 23:20:01 UTC 2012


The following reply was made to PR kern/173254; it has been noted by GNATS.

From: "Steven Hartland" <killing at multiplay.co.uk>
To: <bug-followup at freebsd.org>,
	<steven.hartland at multiplay.co.uk>
Cc:  
Subject: Re: kern/173254: [zfs] [patch] Upgrade requests used in ZFS trim map based on ashift
Date: Thu, 1 Nov 2012 23:15:56 -0000

 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_0AC6_01CDB886.D8C9BA80
 Content-Type: text/plain;
 	format=flowed;
 	charset="Windows-1252";
 	reply-type=original
 Content-Transfer-Encoding: 7bit
 
 Updated patched which simplifies / optimises logic
 
 ================================================
 This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 
 
 In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337
 or return the E.mail to postmaster at multiplay.co.uk.
 ------=_NextPart_000_0AC6_01CDB886.D8C9BA80
 Content-Type: text/plain;
 	format=flowed;
 	name="zz-zfstrim-block-perf.txt";
 	reply-type=original
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
 	filename="zz-zfstrim-block-perf.txt"
 
 Upgrades trim free request sizes before inserting them into to free map,=0A=
 making range consolidation much more effective particularly for small=0A=
 deletes.=0A=
 =0A=
 This reduces memory used by the free map as well as reducing the number=0A=
 of bio requests down to geom required to process all deletes.=0A=
 =0A=
 In tests this achieved a factor of 10 reduction of trim ranges / geom=0A=
 call downs.=0A=
 --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	2012-10-25 =
 13:01:17.556311206 +0000=0A=
 +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	2012-10-25 =
 13:48:39.280408543 +0000=0A=
 @@ -2325,7 +2325,7 @@=0A=
  =0A=
  /*=0A=
   * =
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
 - * Read and write to physical devices=0A=
 + * Read, write and delete to physical devices=0A=
   * =
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
   */=0A=
  static int=0A=
 --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c	2012-10-25 =
 13:01:17.544310799 +0000=0A=
 +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c	2012-10-25 =
 14:41:49.391313700 +0000=0A=
 @@ -270,7 +270,15 @@=0A=
  		return;=0A=
  =0A=
  	mutex_enter(&tm->tm_lock);=0A=
 -	trim_map_free_locked(tm, zio->io_offset, zio->io_offset + zio->io_size,=0A=
 +	/*=0A=
 +	 * Upgrade size based on ashift which would be done by=0A=
 +	 * zio_vdev_io_start later anyway.=0A=
 +	 *=0A=
 +	 * This makes free range consolidation much more effective=0A=
 +	 * than it would otherwise be.=0A=
 +	 */=0A=
 +	trim_map_free_locked(tm, zio->io_offset, zio->io_offset + =0A=
 +	    P2ROUNDUP(zio->io_size, 1ULL << vd->vdev_top->vdev_ashift),=0A=
  	    vd->vdev_spa->spa_syncing_txg);=0A=
  	mutex_exit(&tm->tm_lock);=0A=
  }=0A=
 @@ -288,7 +301,14 @@=0A=
  		return (B_TRUE);=0A=
  =0A=
  	start =3D zio->io_offset;=0A=
 -	end =3D start + zio->io_size;=0A=
 +	/*=0A=
 +	 * Upgrade size based on ashift which would be done by=0A=
 +	 * zio_vdev_io_start later anyway.=0A=
 +	 *=0A=
 +	 * This ensures that entire blocks are invalidated by=0A=
 +	 * writes=0A=
 +	 */=0A=
 +	end =3D start + P2ROUNDUP(zio->io_size, 1ULL << =
 vd->vdev_top->vdev_ashift);=0A=
  	tsearch.ts_start =3D start;=0A=
  	tsearch.ts_end =3D end;=0A=
  =0A=
 
 ------=_NextPart_000_0AC6_01CDB886.D8C9BA80--
 


More information about the freebsd-fs mailing list