/*
 * This is the per-process anticipatory I/O scheduler state.
 */
struct as_io_context {
        spinlock_t lock;

        void (*dtor)(struct as_io_context *aic); /* destructor */
        void (*exit)(struct as_io_context *aic); /* called on task exit */

        unsigned long state;
        atomic_t nr_queued; /* queued reads & sync writes */
        atomic_t nr_dispatched; /* number of requests gone to the drivers */

        /* IO History tracking */
        /* Thinktime */
        unsigned long last_end_request;
        unsigned long ttime_total;
        unsigned long ttime_samples;
        unsigned long ttime_mean;
        /* Layout pattern */
        unsigned int seek_samples;
        sector_t last_request_pos;
        u64 seek_total;
        sector_t seek_mean;
};

struct cfq_queue;
struct cfq_io_context {
        void *key;
        unsigned long dead_key;

        struct cfq_queue *cfqq[2];

        struct io_context *ioc;

        unsigned long last_end_request;
        sector_t last_request_pos;

        unsigned long ttime_total;
        unsigned long ttime_samples;
        unsigned long ttime_mean;

        unsigned int seek_samples;
        u64 seek_total;
        sector_t seek_mean;

        struct list_head queue_list;
        struct hlist_node cic_list;

        void (*dtor)(struct io_context *); /* destructor */
        void (*exit)(struct io_context *); /* called on task exit */

        struct rcu_head rcu_head;
};

/*
"include/linux/iocontext.h" 120 lines --15%--   

Reply via email to