From owner-svn-src-stable-8@FreeBSD.ORG Mon May 3 09:46:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5DD11065679; Mon, 3 May 2010 09:46:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id B4B238FC2D; Mon, 3 May 2010 09:46:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o439klIp040689; Mon, 3 May 2010 09:46:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o439klsv040687; Mon, 3 May 2010 09:46:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201005030946.o439klsv040687@svn.freebsd.org> From: Xin LI Date: Mon, 3 May 2010 09:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207560 - stable/8/sys/cddl/compat/opensolaris/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 May 2010 09:46:47 -0000 Author: delphij Date: Mon May 3 09:46:47 2010 New Revision: 207560 URL: http://svn.freebsd.org/changeset/base/207560 Log: MFC r206838: Partially MFp4 #176265 by pjd@: - Properly initialize and destroy system_taskq. - Add a dummy implementation of taskq_create_proc(). Note: We do not currently use system_taskq in ZFS so this is mostly a no-op at this time. Proper system_taskq initialization is required by newer ZFS code. Ok'ed by: pjd Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon May 3 09:35:40 2010 (r207559) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon May 3 09:46:47 2010 (r207560) @@ -52,9 +52,9 @@ static void system_taskq_init(void *arg) { - system_taskq = (taskq_t *)taskqueue_thread; taskq_zone = uma_zcreate("taskq_zone", sizeof(struct ostask), NULL, NULL, NULL, NULL, 0, 0); + system_taskq = taskq_create("system_taskq", mp_ncpus, 0, 0, 0, 0); } SYSINIT(system_taskq_init, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_init, NULL); @@ -62,6 +62,7 @@ static void system_taskq_fini(void *arg) { + taskq_destroy(system_taskq); uma_zdestroy(taskq_zone); } SYSUNINIT(system_taskq_fini, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_fini, NULL); @@ -72,10 +73,8 @@ taskq_create(const char *name, int nthre { taskq_t *tq; - if ((flags & TASKQ_THREADS_CPU_PCT) != 0) { - /* TODO: Calculate number od threads. */ - printf("%s: TASKQ_THREADS_CPU_PCT\n", __func__); - } + if ((flags & TASKQ_THREADS_CPU_PCT) != 0) + nthreads = MAX((mp_ncpus * nthreads) / 100, 1); tq = kmem_alloc(sizeof(*tq), KM_SLEEP); tq->tq_queue = taskqueue_create(name, M_WAITOK, taskqueue_thread_enqueue, @@ -85,6 +84,14 @@ taskq_create(const char *name, int nthre return ((taskq_t *)tq); } +taskq_t * +taskq_create_proc(const char *name, int nthreads, pri_t pri, int minalloc, + int maxalloc, proc_t *proc __unused, uint_t flags) +{ + + return (taskq_create(name, nthreads, pri, minalloc, maxalloc, flags)); +} + void taskq_destroy(taskq_t *tq) {