svn commit: r314843 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi

Andreas Tobler andreast at FreeBSD.org
Wed Mar 8 20:57:23 UTC 2017


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;



More information about the svn-src-head mailing list