From owner-svn-src-head@freebsd.org Fri May 27 19:23:17 2016 Return-Path: Delivered-To: svn-src-head@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 0CE61B4C627; Fri, 27 May 2016 19:23:17 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD9441341; Fri, 27 May 2016 19:23:16 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RJNF81016636; Fri, 27 May 2016 19:23:15 GMT (envelope-from ambrisko@FreeBSD.org) Received: (from ambrisko@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RJNF0d016635; Fri, 27 May 2016 19:23:15 GMT (envelope-from ambrisko@FreeBSD.org) Message-Id: <201605271923.u4RJNF0d016635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ambrisko set sender to ambrisko@FreeBSD.org using -f From: Doug Ambrisko Date: Fri, 27 May 2016 19:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300866 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 19:23:17 -0000 Author: ambrisko Date: Fri May 27 19:23:15 2016 New Revision: 300866 URL: https://svnweb.freebsd.org/changeset/base/300866 Log: If the I/O offset and length is multiple of the media size then directly pass the request otherwise use a buffer that is a multiple of the media size. This speeds up I/O quite a bit when using large transfer sizes on 4Kn disks etc. MFC after: 1 week Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Fri May 27 19:15:45 2016 (r300865) +++ head/sys/boot/efi/libefi/efipart.c Fri May 27 19:23:15 2016 (r300866) @@ -325,11 +325,14 @@ efipart_realstrategy(void *devdata, int if (rsize != NULL) *rsize = size; - if (blkio->Media->BlockSize == 512) - return (efipart_readwrite(blkio, rw, blk, size / 512, buf)); + if ((size % blkio->Media->BlockSize == 0) && + ((blk * 512) % blkio->Media->BlockSize == 0)) + return (efipart_readwrite(blkio, rw, + blk * 512 / blkio->Media->BlockSize, + size / blkio->Media->BlockSize, buf)); /* - * The block size of the media is not 512B per sector. + * The block size of the media is not a multiple of I/O. */ blkbuf = malloc(blkio->Media->BlockSize); if (blkbuf == NULL)