From owner-svn-src-all@freebsd.org Wed Mar 8 20:57:23 2017 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 96A32D03A1B; Wed, 8 Mar 2017 20:57:23 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.imp.ch (smtp.imp.ch [IPv6:2001:4060:1:1001::13:198]) (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 5DE171AE7; Wed, 8 Mar 2017 20:57:23 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from [192.168.225.14] (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPSA id 8DC5016D767; Wed, 8 Mar 2017 21:57:18 +0100 (CET) Subject: Re: svn commit: r314843 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201703071209.v27C9EnN031891@repo.freebsd.org> From: Andreas Tobler Message-ID: <76e5a216-7b3f-b9f2-f307-2f9ee8ff8431@FreeBSD.org> Date: Wed, 8 Mar 2017 21:57:19 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <201703071209.v27C9EnN031891@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: Idefix Submit on 127.0.1.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Mar 2017 20:57:23 -0000 Hi Hans Petter, On 07.03.17 13:09, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Mar 7 12:09:14 2017 > New Revision: 314843 > URL: https://svnweb.freebsd.org/changeset/base/314843 > > Log: > LinuxKPI workqueue cleanup. > > This change makes the workqueue implementation behave more like in > Linux, both functionality wise and structure wise. > > All workqueue code has been moved to linux_work.c > > Add an atomic based statemachine to the work_struct to ensure proper > operation. Prior to this change struct_work was directly mapped to a > FreeBSD task. When a taskqueue has multiple threads the same task may > end up being executed on more than one worker thread simultaneously. > This might cause problems with code coming from Linux, which expects > serial behaviour, similar to Linux tasklets. > > Move all global workqueue function names into the linux_xxx domain to > avoid symbol name clashes in the future. > > Implement a few more workqueue related functions and macros. > > Create two multithreaded taskqueues for the LinuxKPI during module > load, one for time-consuming callbacks and one for non-time consuming > callbacks. > > MFC after: 1 week > Sponsored by: Mellanox Technologies > > Added: > head/sys/compat/linuxkpi/common/src/linux_work.c (contents, props changed) /export/devel/fbsd/src/sys/compat/linuxkpi/common/src/linux_work.c:68: warning: type qualifiers ignored on function return type [-Wreturn-type] /export/devel/fbsd/src/sys/compat/linuxkpi/common/src/linux_work.c:89: warning: type qualifiers ignored on function return type [-Wreturn-type] *** Error code 1 For powerpc64, cross kernel build: amd64 -> powerpc64. How about this? Regards, Andreas Index: sys/compat/linuxkpi/common/src/linux_work.c =================================================================== --- sys/compat/linuxkpi/common/src/linux_work.c (revision 314900) +++ sys/compat/linuxkpi/common/src/linux_work.c (working copy) @@ -63,7 +63,7 @@ * This function atomically updates the work state and returns the * previous state at the time of update. */ -static const uint8_t +static int linux_update_state(atomic_t *v, const uint8_t *pstate) { int c, old; @@ -84,7 +84,7 @@ * again. Without this extra hint LinuxKPI tasks cannot be serialized * accross multiple worker threads. */ -static const bool +static bool linux_work_exec_unblock(struct work_struct *work) { struct workqueue_struct *wq;