Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91b74501 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  workqueue: remove in_workqueue_context()
  workqueue: Clarify that schedule_on_each_cpu is synchronous
  memory_hotplug: drop spurious calls to flush_scheduled_work()
  shpchp: update workqueue usage
  pciehp: update workqueue usage
  isdn/eicon: don't call flush_scheduled_work() from diva_os_remove_soft_isr()
  workqueue: add and use WQ_MEM_RECLAIM flag
  workqueue: fix HIGHPRI handling in keep_working()
  workqueue: add queue_work and activate_work trace points
  workqueue: prepare for more tracepoints
  workqueue: implement flush[_delayed]_work_sync()
  workqueue: factor out start_flush_work()
  workqueue: cleanup flush/cancel functions
  workqueue: implement alloc_ordered_workqueue()

Fix up trivial conflict in fs/gfs2/main.c as per Tejun
parents 04cc6976 daaae6b0
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -196,11 +196,11 @@ resources, scheduled and executed.
	suspend operations.  Work items on the wq are drained and no
	new work item starts execution until thawed.

  WQ_RESCUER
  WQ_MEM_RECLAIM

	All wq which might be used in the memory reclaim paths _MUST_
	have this flag set.  This reserves one worker exclusively for
	the execution of this wq under memory pressure.
	have this flag set.  The wq is guaranteed to have at least one
	execution context regardless of memory pressure.

  WQ_HIGHPRI

@@ -356,11 +356,11 @@ If q1 has WQ_CPU_INTENSIVE set,

6. Guidelines

* Do not forget to use WQ_RESCUER if a wq may process work items which
  are used during memory reclaim.  Each wq with WQ_RESCUER set has one
  rescuer thread reserved for it.  If there is dependency among
  multiple work items used during memory reclaim, they should be
  queued to separate wq each with WQ_RESCUER.
* Do not forget to use WQ_MEM_RECLAIM if a wq may process work items
  which are used during memory reclaim.  Each wq with WQ_MEM_RECLAIM
  set has an execution context reserved for it.  If there is
  dependency among multiple work items used during memory reclaim,
  they should be queued to separate wq each with WQ_MEM_RECLAIM.

* Unless strict ordering is required, there is no need to use ST wq.

@@ -368,12 +368,13 @@ If q1 has WQ_CPU_INTENSIVE set,
  recommended.  In most use cases, concurrency level usually stays
  well under the default limit.

* A wq serves as a domain for forward progress guarantee (WQ_RESCUER),
  flush and work item attributes.  Work items which are not involved
  in memory reclaim and don't need to be flushed as a part of a group
  of work items, and don't require any special attribute, can use one
  of the system wq.  There is no difference in execution
  characteristics between using a dedicated wq and a system wq.
* A wq serves as a domain for forward progress guarantee
  (WQ_MEM_RECLAIM, flush and work item attributes.  Work items which
  are not involved in memory reclaim and don't need to be flushed as a
  part of a group of work items, and don't require any special
  attribute, can use one of the system wq.  There is no difference in
  execution characteristics between using a dedicated wq and a system
  wq.

* Unless work items are expected to consume a huge amount of CPU
  cycles, using a bound wq is usually beneficial due to the increased
+1 −1
Original line number Diff line number Diff line
@@ -3335,7 +3335,7 @@ void ata_sff_port_init(struct ata_port *ap)

int __init ata_sff_init(void)
{
	ata_sff_wq = alloc_workqueue("ata_sff", WQ_RESCUER, WQ_MAX_ACTIVE);
	ata_sff_wq = alloc_workqueue("ata_sff", WQ_MEM_RECLAIM, WQ_MAX_ACTIVE);
	if (!ata_sff_wq)
		return -ENOMEM;

+0 −2
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
#include <asm/uaccess.h>
#include <asm/io.h>
#include <linux/ioport.h>
#include <linux/workqueue.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/list.h>
@@ -546,7 +545,6 @@ void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr)
		void *mem;

		tasklet_kill(&pdpc->divas_task);
		flush_scheduled_work();
		mem = psoft_isr->object;
		psoft_isr->object = NULL;
		diva_os_free(0, mem);
+2 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#include <linux/sched.h>		/* signal_pending() */
#include <linux/pcieport_if.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>

#define MY_NAME	"pciehp"

@@ -44,6 +45,7 @@ extern int pciehp_poll_time;
extern int pciehp_debug;
extern int pciehp_force;
extern struct workqueue_struct *pciehp_wq;
extern struct workqueue_struct *pciehp_ordered_wq;

#define dbg(format, arg...)						\
do {									\
+17 −1
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ int pciehp_poll_mode;
int pciehp_poll_time;
int pciehp_force;
struct workqueue_struct *pciehp_wq;
struct workqueue_struct *pciehp_ordered_wq;

#define DRIVER_VERSION	"0.4"
#define DRIVER_AUTHOR	"Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>, Dely Sy <dely.l.sy@intel.com>"
@@ -340,18 +341,33 @@ static int __init pcied_init(void)
{
	int retval = 0;

	pciehp_wq = alloc_workqueue("pciehp", 0, 0);
	if (!pciehp_wq)
		return -ENOMEM;

	pciehp_ordered_wq = alloc_ordered_workqueue("pciehp_ordered", 0);
	if (!pciehp_ordered_wq) {
		destroy_workqueue(pciehp_wq);
		return -ENOMEM;
	}

	pciehp_firmware_init();
	retval = pcie_port_service_register(&hpdriver_portdrv);
 	dbg("pcie_port_service_register = %d\n", retval);
  	info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
 	if (retval)
 	if (retval) {
		destroy_workqueue(pciehp_ordered_wq);
		destroy_workqueue(pciehp_wq);
		dbg("Failure to register service\n");
	}
	return retval;
}

static void __exit pcied_cleanup(void)
{
	dbg("unload_pciehpd()\n");
	destroy_workqueue(pciehp_ordered_wq);
	destroy_workqueue(pciehp_wq);
	pcie_port_service_unregister(&hpdriver_portdrv);
	info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
}
Loading