From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:38:03 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 F40C9830; Wed, 3 Jul 2013 23:38:02 +0000 (UTC) (envelope-from gonzo@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 E6B8F1EBB; Wed, 3 Jul 2013 23:38:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Nc2Ze063407; Wed, 3 Jul 2013 23:38:02 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nc24U063406; Wed, 3 Jul 2013 23:38:02 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201307032338.r63Nc24U063406@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 3 Jul 2013 23:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252652 - head/sys/arm/arm 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.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: Wed, 03 Jul 2013 23:38:03 -0000 Author: gonzo Date: Wed Jul 3 23:38:02 2013 New Revision: 252652 URL: http://svnweb.freebsd.org/changeset/base/252652 Log: Fix one of INVARIANTS-related UMA panics on ARM Force UMA zone to allocate service structures like slabs using own allocator. uma_debug code performs atomic ops on uma_slab_t fields and safety of this operation is not guaranteed for write-back caches Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Wed Jul 3 23:29:40 2013 (r252651) +++ head/sys/arm/arm/busdma_machdep-v6.c Wed Jul 3 23:38:02 2013 (r252652) @@ -192,14 +192,26 @@ static busdma_bufalloc_t standard_alloca static void busdma_init(void *dummy) { + int uma_flags; + + uma_flags = 0; /* Create a cache of buffers in standard (cacheable) memory. */ standard_allocator = busdma_bufalloc_create("buffer", arm_dcache_align, /* minimum_alignment */ NULL, /* uma_alloc func */ NULL, /* uma_free func */ - 0); /* uma_zcreate_flags */ + uma_flags); /* uma_zcreate_flags */ +#ifdef INVARIANTS + /* + * Force UMA zone to allocate service structures like + * slabs using own allocator. uma_debug code performs + * atomic ops on uma_slab_t fields and safety of this + * operation is not guaranteed for write-back caches + */ + uma_flags = UMA_ZONE_OFFPAGE; +#endif /* * Create a cache of buffers in uncacheable memory, to implement the * BUS_DMA_COHERENT (and potentially BUS_DMA_NOCACHE) flag. @@ -208,7 +220,7 @@ busdma_init(void *dummy) arm_dcache_align, /* minimum_alignment */ busdma_bufalloc_alloc_uncacheable, busdma_bufalloc_free_uncacheable, - 0); /* uma_zcreate_flags */ + uma_flags); /* uma_zcreate_flags */ } /*