Seperate ioprio value from setting
[fio.git] / syslet.h
index 85f0ebc63ea7b4113604f313bc3a6e57eae2c8c8..ded5c4a778192271574cb73e56d4ab7e43ee7a4d 100644 (file)
--- a/syslet.h
+++ b/syslet.h
  * User-space API/ABI definitions:
  */
 
+#ifndef __user
+# define __user
+#endif
+
 /*
  * This is the 'Syslet Atom' - the basic unit of execution
  * within the syslet framework. A syslet always represents
  *   jump a full syslet_uatom number of bytes.) ]
  */
 struct syslet_uatom {
-       unsigned long                           flags;
-       unsigned long                           nr;
-       long __user                             *ret_ptr;
-       struct syslet_uatom     __user          *next;
-       unsigned long           __user          *arg_ptr[6];
+       uint32_t                flags;
+       uint32_t                nr;
+       uint64_t                ret_ptr;
+       uint64_t                next;
+       uint64_t                arg_ptr[6];
        /*
         * User-space can put anything in here, kernel will not
         * touch it:
         */
-       void __user                             *private;
+       uint64_t                private;
 };
 
 /*
@@ -74,7 +78,7 @@ struct syslet_uatom {
 
 /*
  * Execution control: conditions upon the return code
- * of the previous syslet atom. 'Stop' means syslet
+ * of the just executed syslet atom. 'Stop' means syslet
  * execution is stopped and the atom is put into the
  * completion ring:
  */
@@ -101,36 +105,51 @@ struct syslet_uatom {
 
 /*
  * This is the (per-user-context) descriptor of the async completion
- * ring. This gets registered via sys_async_register().
+ * ring. This gets passed in to sys_async_exec():
  */
 struct async_head_user {
        /*
-        * Pointers to completed async syslets (i.e. syslets that
+        * Current completion ring index - managed by the kernel:
+        */
+       uint64_t                kernel_ring_idx;
+       /*
+        * User-side ring index:
+        */
+       uint64_t                user_ring_idx;
+
+       /*
+        * Ring of pointers to completed async syslets (i.e. syslets that
         * generated a cachemiss and went async, returning -EASYNCSYSLET
         * to the user context by sys_async_exec()) are queued here.
-        * Syslets that were executed synchronously are not queued here.
+        * Syslets that were executed synchronously (cached) are not
+        * queued here.
         *
         * Note: the final atom that generated the exit condition is
         * queued here. Normally this would be the last atom of a syslet.
         */
-       struct syslet_uatom __user              **completion_ring;
+       uint64_t                completion_ring_ptr;
+
        /*
         * Ring size in bytes:
         */
-       unsigned long                           ring_size_bytes;
+       uint64_t                ring_size_bytes;
 
        /*
-        * Maximum number of asynchronous contexts the kernel creates.
-        *
-        * -1UL has a special meaning: the kernel manages the optimal
-        * size of the async pool.
-        *
-        * Note: this field should be valid for the lifetime of async
-        * processing, because future kernels detect changes to this
-        * field. (enabling user-space to control the size of the async
-        * pool in a low-overhead fashion)
+        * The head task can become a cachemiss thread later on
+        * too, if it blocks - so it needs its separate thread
+        * stack and start address too:
+        */
+       uint64_t                head_stack;
+       uint64_t                head_ip;
+
+       /*
+        * Newly started async kernel threads will take their
+        * user stack and user start address from here. User-space
+        * code has to check for new_thread_stack going to NULL
+        * and has to refill it with a new stack if that happens.
         */
-       unsigned long                           max_nr_threads;
+       uint64_t                new_thread_stack;
+       uint64_t                new_thread_ip;
 };
 
 #endif