From owner-svn-src-all@FreeBSD.ORG Tue Feb 26 08:51:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B599E991; Tue, 26 Feb 2013 08:51:39 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A64D16F3; Tue, 26 Feb 2013 08:51:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q8pd5g038774; Tue, 26 Feb 2013 08:51:39 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q8pdZt038773; Tue, 26 Feb 2013 08:51:39 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302260851.r1Q8pdZt038773@svn.freebsd.org> From: Martin Matuska Date: Tue, 26 Feb 2013 08:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r247315 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 08:51:39 -0000 Author: mm Date: Tue Feb 26 08:51:39 2013 New Revision: 247315 URL: http://svnweb.freebsd.org/changeset/base/247315 Log: Update vendor-sys/illumos/dist to illumos-gate 13968:e4988c7d0403 Illumos ZFS issues: 3552 condensing one space map burns 3 seconds of CPU in spa_sync() thread (fix race condition) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Tue Feb 26 08:17:34 2013 (r247314) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Tue Feb 26 08:51:39 2013 (r247315) @@ -1383,6 +1383,13 @@ metaslab_group_alloc(metaslab_group_t *m mutex_exit(&mg->mg_lock); return (-1ULL); } + + /* + * If the selected metaslab is condensing, skip it. + */ + if (msp->ms_map->sm_condensing) + continue; + was_active = msp->ms_weight & METASLAB_ACTIVE_MASK; if (activation_weight == METASLAB_WEIGHT_PRIMARY) break; @@ -1423,16 +1430,6 @@ metaslab_group_alloc(metaslab_group_t *m mutex_enter(&msp->ms_lock); /* - * If this metaslab is currently condensing then pick again as - * we can't manipulate this metaslab until it's committed - * to disk. - */ - if (msp->ms_map->sm_condensing) { - mutex_exit(&msp->ms_lock); - continue; - } - - /* * Ensure that the metaslab we have selected is still * capable of handling our request. It's possible that * another thread may have changed the weight while we @@ -1458,6 +1455,16 @@ metaslab_group_alloc(metaslab_group_t *m continue; } + /* + * If this metaslab is currently condensing then pick again as + * we can't manipulate this metaslab until it's committed + * to disk. + */ + if (msp->ms_map->sm_condensing) { + mutex_exit(&msp->ms_lock); + continue; + } + if ((offset = space_map_alloc(msp->ms_map, asize)) != -1ULL) break;