compat: backport system work queues system_wq and system_long_wq

mcgrof@tux ~/linux-stable (git::master)$ git describe --contains d320c038
v2.6.36-rc1~506^2~26

The commit d320c038 added some new system workqueues to allow us
to categorize order of priority on workqueue items. We had already
backported usage of system_nrt_wq but hadn't backported usage of
system_wq or system_long_wq. We address this now in this patch
by also ensuring that flush_workqueue() will flush these as
designed, that is only prioritizing system_wq. Given that older
kernels would be using the older keventd_wq for now we flush
that and then system_wq, allowing users of the system_long_wq
to be delayed as intended for backported kernel code using this
framework.

For newer kernels this is a no-op.

commit d320c03830b17af64e4547075003b1eeb274bc6c
Author: Tejun Heo <tj@kernel.org>
Date:   Tue Jun 29 10:07:14 2010 +0200

    workqueue: s/__create_workqueue()/alloc_workqueue()/, and add system workqueues

    This patch makes changes to make new workqueue features available to
    its users.

    * Now that workqueue is more featureful, there should be a public
      workqueue creation function which takes paramters to control them.
      Rename __create_workqueue() to alloc_workqueue() and make 0
      max_active mean WQ_DFL_ACTIVE.  In the long run, all
      create_workqueue_*() will be converted over to alloc_workqueue().

    * To further unify access interface, rename keventd_wq to system_wq
      and export it.

    * Add system_long_wq and system_nrt_wq.  The former is to host long
      running works separately (so that flush_scheduled_work() dosen't
      take so long) and the latter guarantees any queued work item is
      never executed in parallel by multiple CPUs.  These will be used by
      future patches to update workqueue users.

    Signed-off-by: Tejun Heo <tj@kernel.org>

The ckmake [documented on 0] log:

Trying kernel                  3.3.0-030300rc2-generic  [OK]
Trying kernel                     3.2.2-030202-generic  [OK]
Trying kernel                    3.1.10-030110-generic  [OK]
Trying kernel                    3.0.18-030018-generic  [OK]
Trying kernel                  2.6.39-02063904-generic  [OK]
Trying kernel                        2.6.38-13-generic  [OK]
Trying kernel                  2.6.38-02063808-generic  [OK]
Trying kernel                  2.6.37-02063706-generic  [OK]
Trying kernel                  2.6.36-02063604-generic  [OK]
Trying kernel                  2.6.35-02063512-generic  [OK]
Trying kernel                  2.6.34-02063410-generic  [OK]
Trying kernel                  2.6.33-02063305-generic  [OK]
Trying kernel                  2.6.32-02063255-generic  [OK]
Trying kernel                        2.6.31-22-generic  [OK]
Trying kernel                  2.6.31-02063113-generic  [OK]
Trying kernel                  2.6.30-02063010-generic  [OK]
Trying kernel                  2.6.29-02062906-generic  [OK]
Trying kernel                  2.6.28-02062810-generic  [OK]
Trying kernel                    2.6.27-020627-generic  [OK]
Trying kernel                    2.6.26-020626-generic  [OK]
Trying kernel                    2.6.25-020625-generic  [OK]
Trying kernel                    2.6.24-020624-generic  [OK]

[0] https://github.com/mcgrof/compat/wiki

Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: backport work_busy()

Best we can do is just tell the users of we are WORK_BUSY_PENDING
for older kernels. The ckmake log:

Trying kernel                  3.3.0-030300rc2-generic  [OK]
Trying kernel                     3.2.2-030202-generic  [OK]
Trying kernel                    3.1.10-030110-generic  [OK]
Trying kernel                    3.0.18-030018-generic  [OK]
Trying kernel                  2.6.39-02063904-generic  [OK]
Trying kernel                        2.6.38-13-generic  [OK]
Trying kernel                  2.6.38-02063808-generic  [OK]
Trying kernel                  2.6.37-02063706-generic  [OK]
Trying kernel                  2.6.36-02063604-generic  [OK]
Trying kernel                  2.6.35-02063512-generic  [OK]
Trying kernel                  2.6.34-02063410-generic  [OK]
Trying kernel                  2.6.33-02063305-generic  [OK]
Trying kernel                  2.6.32-02063255-generic  [OK]
Trying kernel                        2.6.31-22-generic  [OK]
Trying kernel                  2.6.31-02063113-generic  [OK]
Trying kernel                  2.6.30-02063010-generic  [OK]
Trying kernel                  2.6.29-02062906-generic  [OK]
Trying kernel                  2.6.28-02062810-generic  [OK]
Trying kernel                    2.6.27-020627-generic  [OK]
Trying kernel                    2.6.26-020626-generic  [OK]
Trying kernel                    2.6.25-020625-generic  [OK]
Trying kernel                    2.6.24-020624-generic  [OK]

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: fix load time issue with kfifo backport

The CONFIG_COMPAT_KFIFO config option must be defined
to CONFIG_COMPAT_KFIFO=y instead of CONFIG_COMPAT_KFIFO=m
as the kfifo object is not a module, its simply part of
the compat module. This should fix users of the kfifo
backport on kernels older than 2.6.36.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: add some tracing backport work

Its not really easy to backport the tracing stuff, but
lets give it a shot. We should simply review how many
subsystems we want tracing for and for what target kernels
we want that enabled for. It doesn't make sense to
backport tracing if we won't have much users.

For now add some code that at least does not break building.

Trying kernel                  3.3.0-030300rc2-generic  [OK]
Trying kernel                     3.2.2-030202-generic  [OK]
Trying kernel                    3.1.10-030110-generic  [OK]
Trying kernel                    3.0.18-030018-generic  [OK]
Trying kernel                  2.6.39-02063904-generic  [OK]
Trying kernel                        2.6.38-13-generic  [OK]
Trying kernel                  2.6.38-02063808-generic  [OK]
Trying kernel                  2.6.37-02063706-generic  [OK]
Trying kernel                  2.6.36-02063604-generic  [OK]
Trying kernel                  2.6.35-02063512-generic  [OK]
Trying kernel                  2.6.34-02063410-generic  [OK]
Trying kernel                  2.6.33-02063305-generic  [OK]
Trying kernel                  2.6.32-02063255-generic  [OK]
Trying kernel                        2.6.31-22-generic  [OK]
Trying kernel                  2.6.31-02063113-generic  [OK]
Trying kernel                  2.6.30-02063010-generic  [OK]
Trying kernel                  2.6.29-02062906-generic  [OK]
Trying kernel                  2.6.28-02062810-generic  [OK]
Trying kernel                    2.6.27-020627-generic  [OK]
Trying kernel                    2.6.26-020626-generic  [OK]
Trying kernel                    2.6.25-020625-generic  [OK]
Trying kernel                    2.6.24-020624-generic  [OK]

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>