Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Mar 2017 21:57:19 +0100
From:      Andreas Tobler <andreast@FreeBSD.org>
To:        Hans Petter Selasky <hselasky@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r314843 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi
Message-ID:  <76e5a216-7b3f-b9f2-f307-2f9ee8ff8431@FreeBSD.org>
In-Reply-To: <201703071209.v27C9EnN031891@repo.freebsd.org>
References:  <201703071209.v27C9EnN031891@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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;




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?76e5a216-7b3f-b9f2-f307-2f9ee8ff8431>