From owner-svn-src-all@freebsd.org Tue May 24 10:16:04 2016 Return-Path: Delivered-To: svn-src-all@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 5F1B1B46331; Tue, 24 May 2016 10:16:04 +0000 (UTC) (envelope-from kib@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 31B5E12CC; Tue, 24 May 2016 10:16:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4OAG3Bg032330; Tue, 24 May 2016 10:16:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4OAG3HR032329; Tue, 24 May 2016 10:16:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605241016.u4OAG3HR032329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 May 2016 10:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300595 - head/sys/vm X-SVN-Group: head 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.22 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, 24 May 2016 10:16:04 -0000 Author: kib Date: Tue May 24 10:16:03 2016 New Revision: 300595 URL: https://svnweb.freebsd.org/changeset/base/300595 Log: Remove Giant around allocation of the swap pager with non-NULL handle. Existing issue of not protecting pager_object_list iteration in vm_pager_object_lookup() by sw_alloc_mtx is not affected by Giant removal. Reviewed by: alc Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue May 24 09:23:04 2016 (r300594) +++ head/sys/vm/swap_pager.c Tue May 24 10:16:03 2016 (r300595) @@ -604,7 +604,6 @@ swap_pager_alloc(void *handle, vm_ooffse pindex = OFF_TO_IDX(offset + PAGE_MASK + size); if (handle) { - mtx_lock(&Giant); /* * Reference existing named region or allocate new one. There * should not be a race here against swp_pager_meta_build() @@ -617,7 +616,6 @@ swap_pager_alloc(void *handle, vm_ooffse if (cred != NULL) { if (!swap_reserve_by_cred(size, cred)) { sx_xunlock(&sw_alloc_sx); - mtx_unlock(&Giant); return (NULL); } crhold(cred); @@ -633,7 +631,6 @@ swap_pager_alloc(void *handle, vm_ooffse VM_OBJECT_WUNLOCK(object); } sx_xunlock(&sw_alloc_sx); - mtx_unlock(&Giant); } else { if (cred != NULL) { if (!swap_reserve_by_cred(size, cred))