Received: from eggs.gnu.org ([2001:4830:134:3::10]:46117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNJP1-0006Z2-Vx for qemu-devel@nongnu.org; Mon, 16 Feb 2015 05:59:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNJOy-0002gB-R3 for qemu-devel@nongnu.org; Mon, 16 Feb 2015 05:59:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNJOy-0002g3-Jc for qemu-devel@nongnu.org; Mon, 16 Feb 2015 05:59:44 -0500 Date: Mon, 16 Feb 2015 11:59:42 +0100 From: Kevin Wolf Message-ID: <20150216105942.GH4079@noname.str.redhat.com> References: <1423244272-24887-1-git-send-email-den@openvz.org> <1423244272-24887-3-git-send-email-den@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1423244272-24887-3-git-send-email-den@openvz.org> Subject: Re: [Qemu-devel] [PATCH 2/2] block: align bounce buffers to page List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Paolo Bonzini , qemu-devel@nongnu.org Am 06.02.2015 um 18:37 hat Denis V. Lunev geschrieben: > The following sequence > int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); > for (i = 0; i < 100000; i++) > write(fd, buf, 4096); > performs 5% better if buf is aligned to 4096 bytes. > > The difference is quite reliable. > > On the other hand we do not want at the moment to enforce bounce > buffering if guest request is aligned to 512 bytes. > > The patch introduces new concept: minimal memory alignment for bounce > buffers. Original so called "optimal" value is actually minimal required > value for aligment. Optimal should be set to page size by default. > There is no driver which should change this default at the moment. > > Signed-off-by: Denis V. Lunev > CC: Paolo Bonzini > CC: Kevin Wolf I don't think the subject lines describes the patch correctly. IIUC, patch 1 introduces a hard enforcement of page size alignment, and this patch only loosens it again. Perhaps the order of patches should be changed so that min_mem_alignment is introduced first (without changes in the behaviour), and only then opt_mem_alignment is increased. Kevin