From owner-svn-src-head@freebsd.org Wed Sep 9 15:14:44 2015 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 EBA49A00CDB; Wed, 9 Sep 2015 15:14:44 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 A77FF1A9D; Wed, 9 Sep 2015 15:14:44 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZZh52-0005ze-0V; Wed, 09 Sep 2015 18:14:36 +0300 Date: Wed, 9 Sep 2015 18:14:35 +0300 From: Slawa Olhovchenkov To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287099 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150909151435.GP3158@zxy.spb.ru> References: <201508240810.t7O8Aq0J096319@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201508240810.t7O8Aq0J096319@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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: Wed, 09 Sep 2015 15:14:45 -0000 On Mon, Aug 24, 2015 at 08:10:52AM +0000, Andriy Gapon wrote: > Author: avg > Date: Mon Aug 24 08:10:52 2015 > New Revision: 287099 > URL: https://svnweb.freebsd.org/changeset/base/287099 > > Log: > account for ashift when gathering buffers to be written to l2arc device > > The change that introduced the L2ARC compression support also introduced > a bug where the on-disk size of the selected buffers could end up larger > than the target size if the ashift is greater than 9. This was because > the buffer selection could did not take into account the fact that > on-disk size could be larger than the in-memory buffer size due to > the alignment requirements. > > At the moment b_asize is a misnomer as it does not always represent the > allocated size: if a buffer is compressed, then the compressed size is > properly rounded (on FreeBSD), but if the compression fails or it is not > applied, then the original size is kept and it could be smaller than what > ashift requires. > > For the same reasons arcstat_l2_asize and the reported used space > on the cache device could be smaller than the actual allocated size > if ashift > 9. That problem is not fixed by this change. > > This change only ensures that l2ad_hand is not advanced by more > than target_sz. Otherwise we would overwrite active (unevicted) > L2ARC buffers. That problem is manifested as growing l2_cksum_bad > and l2_io_error counters. > > This change also changes 'p' prefix to 'a' prefix in a few places > where variables represent allocated rather than physical size. > > The resolved problem could also result in the reported allocated size > being greater than the cache device's capacity, because of the > overwritten buffers (more than one buffer claiming the same disk > space). > > This change is already in ZFS-on-Linux: > zfsonlinux/zfs@ef56b0780c80ebb0b1e637b8b8c79530a8ab3201 > > PR: 198242 > PR: 195746 (possibly related) > Reviewed by: mahrens (https://reviews.csiden.org/r/229/) > Tested by: gkontos@aicom.gr (most recently) > MFC after: 15 days Not ready?