{"shas":[["960d6b68cf7d5b4d971d3c2a70bb75c07bbc07c1","546b05909706652891a87f7bfe385ae147f61f91@kernel.org","workqueue: define masks for work flags and conditionalize STATIC flags\n\nWork flags are about to see more traditional mask handling.  Define\nWORK_STRUCT_*_BIT as the bit position constant and redefine\nWORK_STRUCT_* as bit masks.  Also, make WORK_STRUCT_STATIC_* flags\nconditional\n\nWhile at it, re-define these constants as enums and use\nWORK_STRUCT_STATIC instead of hard-coding 2 in\nWORK_DATA_STATIC_INIT().\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","Tejun Heo"],["07b56cfde872d67db78cb7b95d532071d6d656c3","546b05909706652891a87f7bfe385ae147f61f91@kernel.org","workqueue: separate out process_one_work()\n\nSeparate out process_one_work() out of run_workqueue().  This patch\ndoesn't cause any behavior change.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","Tejun Heo"],["d2ca805e0faf32d5b4cb15862d41f77a9f255644","546b05909706652891a87f7bfe385ae147f61f91@kernel.org","workqueue: temporarily remove workqueue tracing\n\nStrip tracing code from workqueue and remove workqueue tracing.  This\nis temporary measure till concurrency managed workqueue is complete.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>\nCc: Frederic Weisbecker <fweisbec@gmail.com>","Tejun Heo"],["d1356f4c1b810ac462c90f9bccbac4d1619cd352","546b05909706652891a87f7bfe385ae147f61f91@kernel.org","workqueue: kill cpu_populated_map\n\nWorker management is about to be overhauled.  Simplify things by\nremoving cpu_populated_map, creating workers for all possible cpus and\nmaking single threaded workqueues behave more like multi threaded\nones.\n\nAfter this patch, all cwqs are always initialized, all workqueues are\nlinked on the workqueues list and workers for all possibles cpus\nalways exist.  This also makes CPU hotplug support simpler - checking\n->cpus_allowed before processing works in worker_thread() and flushing\ncwqs on CPU_POST_DEAD are enough.\n\nWhile at it, make get_cwq() always return the cwq for the specified\ncpu, add target_cwq() for cases where single thread distinction is\nnecessary and drop all direct usage of per_cpu_ptr() on wq->cpu_wq.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","Tejun Heo"],["3f2786cce3d7fa7c67776bfd735638ab6d7e0e16","546b05909706652891a87f7bfe385ae147f61f91@kernel.org","workqueue: update cwq alignement\n\nwork->data field is used for two purposes.  It points to cwq it's\nqueued on and the lower bits are used for flags.  Currently, two bits\nare reserved which is always safe as 4 byte alignment is guaranteed on\nevery architecture.  However, future changes will need more flag bits.\n\nOn SMP, the percpu allocator is capable of honoring larger alignment\n(there are other users which depend on it) and larger alignment works\njust fine.  On UP, percpu allocator is a thin wrapper around\nkzalloc/kfree() and don't honor alignment request.\n\nThis patch introduces WORK_STRUCT_FLAG_BITS and implements\nalloc/free_cwqs() which guarantees max(1 << WORK_STRUCT_FLAG_BITS,\n__alignof__(unsigned long long) alignment both on SMP and UP.  On SMP,\nsimply wrapping percpu allocator is enough.  On UP, extra space is\nallocated so that cwq can be aligned and the original pointer can be\nstored after it which is used in the free path.\n\n* Alignment problem on UP is reported by Michal Simek.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>\nCc: Christoph Lameter <cl@linux-foundation.org>\nCc: Ingo Molnar <mingo@elte.hu>\nCc: Frederic Weisbecker <fweisbec@gmail.com>\nReported-by: Michal Simek <michal.simek@petalogix.com>","Tejun Heo"],["a0e1802e9aae88d4ab540ccc7bb92a9e318165c8","81ef2ef7cd3a859923573a7bb84652871c617f7d@allard.it","workqueue: introduce worker\n\nSeparate out worker thread related information to struct worker from\nstruct cpu_workqueue_struct and implement helper functions to deal\nwith the new struct worker.  The only change which is visible outside\nis that now workqueue worker are all named \"kworker/CPUID:WORKERID\"\nwhere WORKERID is allocated from per-cpu ida.\n\nThis is in preparation of concurrency managed workqueue where shared\nmultiple workers would be available per cpu.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","Renaud Allard"],["2821a385b27ab1f170d9107b0c488a5959d0c246","81ef2ef7cd3a859923573a7bb84652871c617f7d@allard.it","workqueue: reimplement workqueue flushing using color coded works\n\nReimplement workqueue flushing using color coded works.  wq has the\ncurrent work color which is painted on the works being issued via\ncwqs.  Flushing a workqueue is achieved by advancing the current work\ncolors of cwqs and waiting for all the works which have any of the\nprevious colors to drain.\n\nCurrently there are 16 possible colors, one is reserved for no color\nand 15 colors are useable allowing 14 concurrent flushes.  When color\nspace gets full, flush attempts are batched up and processed together\nwhen color frees up, so even with many concurrent flushers, the new\nimplementation won't build up huge queue of flushers which has to be\nprocessed one after another.\n\nOnly works which are queued via __queue_work() are colored.  Works\nwhich are directly put on queue using insert_work() use NO_COLOR and\ndon't participate in workqueue flushing.  Currently only works used\nfor work-specific flush fall in this category.\n\nThis new implementation leaves only cleanup_workqueue_thread() as the\nuser of flush_cpu_workqueue().  Just make its users use\nflush_workqueue() and kthread_stop() directly and kill\ncleanup_workqueue_thread().  As workqueue flushing doesn't use barrier\nrequest anymore, the comment describing the complex synchronization\naround it in cleanup_workqueue_thread() is removed together with the\nfunction.\n\nThis new implementation is to allow having and sharing multiple\nworkers per cpu.\n\nPlease note that one more bit is reserved for a future work flag by\nthis patch.  This is to avoid shifting bits and updating comments\nlater.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","Renaud Allard"],["8d1976587ff8e6418b84754ff90ee51ca39a73ae","81ef2ef7cd3a859923573a7bb84652871c617f7d@allard.it","workqueue: implement per-cwq active work limit\n\nAdd cwq->nr_active, cwq->max_active and cwq->delayed_work.  nr_active\ncounts the number of active works per cwq.  A work is active if it's\nflushable (colored) and is on cwq's worklist.  If nr_active reaches\nmax_active, new works are queued on cwq->delayed_work and activated\nlater as works on the cwq complete and decrement nr_active.\n\ncwq->max_active can be specified via the new @max_active parameter to\n__create_workqueue() and is set to 1 for all workqueues for now.  As\neach cwq has only single worker now, this double queueing doesn't\ncause any behavior difference visible to its users.\n\nThis will be used to reimplement freeze/thaw and implement shared\nworker pool.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","Renaud Allard"],["09c7b36471e84a8fb3b93306a311c2e0548eb096","81ef2ef7cd3a859923573a7bb84652871c617f7d@allard.it","workqueue: reimplement workqueue freeze using max_active\n\nCurrently, workqueue freezing is implemented by marking the worker\nfreezeable and calling try_to_freeze() from dispatch loop.\nReimplement it using cwq->limit so that the workqueue is frozen\ninstead of the worker.\n\n* workqueue_struct->saved_max_active is added which stores the\n  specified max_active on initialization.\n\n* On freeze, all cwq->max_active's are quenched to zero.  Freezing is\n  complete when nr_active on all cwqs reach zero.\n\n* On thaw, all cwq->max_active's are restored to wq->saved_max_active\n  and the worklist is repopulated.\n\nThis new implementation allows having single shared pool of workers\nper cpu.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","Renaud Allard"],["4a0ba30384d9e30fd0a44d0ae3ac99dbd685deae","546b05909706652891a87f7bfe385ae147f61f91@kernel.org","workqueue: introduce global cwq and unify cwq locks\n\nThere is one gcwq (global cwq) per each cpu and all cwqs on an cpu\npoint to it.  A gcwq contains a lock to be used by all cwqs on the cpu\nand an ida to give IDs to workers belonging to the cpu.\n\nThis patch introduces gcwq, moves worker_ida into gcwq and make all\ncwqs on the same cpu use the cpu's gcwq->lock instead of separate\nlocks.  gcwq->ida is now protected by gcwq->lock too.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","Tejun Heo"],["e05ff3cf3755d8d3bff505f5cc7c65d7f6d70703","546b05909706652891a87f7bfe385ae147f61f91@kernel.org","workqueue: implement worker states\n\nImplement worker states.  After created, a worker is STARTED.  While a\nworker isn't processing a work, it's IDLE and chained on\ngcwq->idle_list.  While processing a work, a worker is BUSY and\nchained on gcwq->busy_hash.  Also, gcwq now counts the number of all\nworkers and idle ones.\n\nworker_thread() is restructured to reflect state transitions.\ncwq->more_work is removed and waking up a worker makes it check for\nevents.  A worker is killed by setting DIE flag while it's IDLE and\nwaking it up.\n\nThis gives gcwq better visibility of what's going on and allows it to\nfind out whether a work is executing quickly which is necessary to\nhave multiple workers processing the same cwq.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","Tejun Heo"],["88eed07152bbe89002899fbbb230769784d4e3b7","81ef2ef7cd3a859923573a7bb84652871c617f7d@allard.it","workqueue: reimplement CPU hotplugging support using trustee\n\nReimplement CPU hotplugging support using trustee thread.  On CPU\ndown, a trustee thread is created and each step of CPU down is\nexecuted by the trustee and workqueue_cpu_callback() simply drives and\nwaits for trustee state transitions.\n\nCPU down operation no longer waits for works to be drained but trustee\nsticks around till all pending works have been completed.  If CPU is\nbrought back up while works are still draining,\nworkqueue_cpu_callback() tells trustee to step down and tell workers\nto rebind to the cpu.\n\nAs it's difficult to tell whether cwqs are empty if it's freezing or\nfrozen, trustee doesn't consider draining to be complete while a gcwq\nis freezing or frozen (tracked by new GCWQ_FREEZING flag).  Also,\nworkers which get unbound from their cpu are marked with WORKER_ROGUE.\n\nTrustee based implementation doesn't bring any new feature at this\npoint but it will be used to manage worker pool when dynamic shared\nworker pool is implemented.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","Renaud Allard"],["8cf67ce12ecce6ce6b2dfa8cdd117e868d86e60e","546b05909706652891a87f7bfe385ae147f61f91@kernel.org","workqueue: add find_worker_executing_work() and track current_cwq\n\nNow that all the workers are tracked by gcwq, we can find which worker\nis executing a work from gcwq.  Implement find_worker_executing_work()\nand make worker track its current_cwq so that we can find things the\nother way around.  This will be used to implement non-reentrant wqs.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","Tejun Heo"]],"ref":"refs/heads/fugumod_cm7-kernel","size":13,"head":"8cf67ce12ecce6ce6b2dfa8cdd117e868d86e60e","push_id":39671601}