diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-11-19 13:10:47 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2009-11-19 13:10:47 -0500 |
commit | 6b8268b17a1ffc942bc72d7d00274e433d6b6719 (patch) | |
tree | bd293facd4b805fc05588fcaf024e964a0bb1cca /Documentation | |
parent | 0160950297c08f8233c89b9f9e7dd59cfb080809 (diff) |
SLOW_WORK: Add delayed_slow_work support
This adds support for starting slow work with a delay, similar
to the functionality we have for workqueues.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/slow-work.txt | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Documentation/slow-work.txt b/Documentation/slow-work.txt index 2e384bd4dead..a9d1b0ffdded 100644 --- a/Documentation/slow-work.txt +++ b/Documentation/slow-work.txt | |||
@@ -41,6 +41,13 @@ expand files, provided the time taken to do so isn't too long. | |||
41 | Operations of both types may sleep during execution, thus tying up the thread | 41 | Operations of both types may sleep during execution, thus tying up the thread |
42 | loaned to it. | 42 | loaned to it. |
43 | 43 | ||
44 | A further class of work item is available, based on the slow work item class: | ||
45 | |||
46 | (*) Delayed slow work items. | ||
47 | |||
48 | These are slow work items that have a timer to defer queueing of the item for | ||
49 | a while. | ||
50 | |||
44 | 51 | ||
45 | THREAD-TO-CLASS ALLOCATION | 52 | THREAD-TO-CLASS ALLOCATION |
46 | -------------------------- | 53 | -------------------------- |
@@ -95,6 +102,10 @@ Slow work items may then be set up by: | |||
95 | 102 | ||
96 | or: | 103 | or: |
97 | 104 | ||
105 | delayed_slow_work_init(&myitem, &myitem_ops); | ||
106 | |||
107 | or: | ||
108 | |||
98 | vslow_work_init(&myitem, &myitem_ops); | 109 | vslow_work_init(&myitem, &myitem_ops); |
99 | 110 | ||
100 | depending on its class. | 111 | depending on its class. |
@@ -104,7 +115,9 @@ A suitably set up work item can then be enqueued for processing: | |||
104 | int ret = slow_work_enqueue(&myitem); | 115 | int ret = slow_work_enqueue(&myitem); |
105 | 116 | ||
106 | This will return a -ve error if the thread pool is unable to gain a reference | 117 | This will return a -ve error if the thread pool is unable to gain a reference |
107 | on the item, 0 otherwise. | 118 | on the item, 0 otherwise, or (for delayed work): |
119 | |||
120 | int ret = delayed_slow_work_enqueue(&myitem, my_jiffy_delay); | ||
108 | 121 | ||
109 | 122 | ||
110 | The items are reference counted, so there ought to be no need for a flush | 123 | The items are reference counted, so there ought to be no need for a flush |
@@ -112,6 +125,7 @@ operation. But as the reference counting is optional, means to cancel | |||
112 | existing work items are also included: | 125 | existing work items are also included: |
113 | 126 | ||
114 | cancel_slow_work(&myitem); | 127 | cancel_slow_work(&myitem); |
128 | cancel_delayed_slow_work(&myitem); | ||
115 | 129 | ||
116 | can be used to cancel pending work. The above cancel function waits for | 130 | can be used to cancel pending work. The above cancel function waits for |
117 | existing work to have been executed (or prevent execution of them, depending | 131 | existing work to have been executed (or prevent execution of them, depending |