aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe/aoe.h
diff options
context:
space:
mode:
authorEd Cashin <ecashin@coraid.com>2012-10-04 20:16:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-05 14:05:25 -0400
commit69cf2d85de773d998798e47e3335b85e5645d157 (patch)
tree765eb2be45726e7e098fe73b7f368239c0461342 /drivers/block/aoe/aoe.h
parent896831f5909e2733c13c9cb13a1a215f10c3eaa8 (diff)
aoe: become I/O request queue handler for increased user control
To allow users to choose an elevator algorithm for their particular workloads, change from a make_request-style driver to an I/O-request-queue-handler-style driver. We have to do a couple of things that might be surprising. We manipulate the page _count directly on the assumption that we still have no guarantee that users of the block layer are prohibited from submitting bios containing pages with zero reference counts.[1] If such a prohibition now exists, I can get rid of the _count manipulation. Just as before this patch, we still keep track of the sk_buffs that the network layer still hasn't finished yet and cap the resources we use with a "pool" of skbs.[2] Now that the block layer maintains the disk stats, the aoe driver's diskstats function can go away. 1. https://lkml.org/lkml/2007/3/1/374 2. https://lkml.org/lkml/2007/7/6/241 Signed-off-by: Ed Cashin <ecashin@coraid.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/aoe/aoe.h')
-rw-r--r--drivers/block/aoe/aoe.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h
index 0cd6c0f7a535..8c4f6d942e05 100644
--- a/drivers/block/aoe/aoe.h
+++ b/drivers/block/aoe/aoe.h
@@ -90,7 +90,7 @@ enum {
90 MIN_BUFS = 16, 90 MIN_BUFS = 16,
91 NTARGETS = 8, 91 NTARGETS = 8,
92 NAOEIFS = 8, 92 NAOEIFS = 8,
93 NSKBPOOLMAX = 128, 93 NSKBPOOLMAX = 256,
94 NFACTIVE = 17, 94 NFACTIVE = 17,
95 95
96 TIMERTICK = HZ / 10, 96 TIMERTICK = HZ / 10,
@@ -100,30 +100,26 @@ enum {
100}; 100};
101 101
102struct buf { 102struct buf {
103 struct list_head bufs;
104 ulong stime; /* for disk stats */
105 ulong flags;
106 ulong nframesout; 103 ulong nframesout;
107 ulong resid; 104 ulong resid;
108 ulong bv_resid; 105 ulong bv_resid;
109 ulong bv_off;
110 sector_t sector; 106 sector_t sector;
111 struct bio *bio; 107 struct bio *bio;
112 struct bio_vec *bv; 108 struct bio_vec *bv;
109 struct request *rq;
113}; 110};
114 111
115struct frame { 112struct frame {
116 struct list_head head; 113 struct list_head head;
117 u32 tag; 114 u32 tag;
118 ulong waited; 115 ulong waited;
119 struct buf *buf;
120 struct aoetgt *t; /* parent target I belong to */ 116 struct aoetgt *t; /* parent target I belong to */
121 char *bufaddr;
122 ulong bcnt;
123 sector_t lba; 117 sector_t lba;
124 struct sk_buff *skb; /* command skb freed on module exit */ 118 struct sk_buff *skb; /* command skb freed on module exit */
125 struct sk_buff *r_skb; /* response skb for async processing */ 119 struct sk_buff *r_skb; /* response skb for async processing */
120 struct buf *buf;
126 struct bio_vec *bv; 121 struct bio_vec *bv;
122 ulong bcnt;
127 ulong bv_off; 123 ulong bv_off;
128}; 124};
129 125
@@ -161,6 +157,7 @@ struct aoedev {
161 u16 rttavg; /* round trip average of requests/responses */ 157 u16 rttavg; /* round trip average of requests/responses */
162 u16 mintimer; 158 u16 mintimer;
163 u16 fw_ver; /* version of blade's firmware */ 159 u16 fw_ver; /* version of blade's firmware */
160 ulong ref;
164 struct work_struct work;/* disk create work struct */ 161 struct work_struct work;/* disk create work struct */
165 struct gendisk *gd; 162 struct gendisk *gd;
166 struct request_queue *blkq; 163 struct request_queue *blkq;
@@ -168,11 +165,13 @@ struct aoedev {
168 sector_t ssize; 165 sector_t ssize;
169 struct timer_list timer; 166 struct timer_list timer;
170 spinlock_t lock; 167 spinlock_t lock;
171 struct sk_buff_head sendq;
172 struct sk_buff_head skbpool; 168 struct sk_buff_head skbpool;
173 mempool_t *bufpool; /* for deadlock-free Buf allocation */ 169 mempool_t *bufpool; /* for deadlock-free Buf allocation */
174 struct list_head bufq; /* queue of bios to work on */ 170 struct { /* pointers to work in progress */
175 struct buf *inprocess; /* the one we're currently working on */ 171 struct buf *buf;
172 struct bio *nxbio;
173 struct request *rq;
174 } ip;
176 struct aoetgt *targets[NTARGETS]; 175 struct aoetgt *targets[NTARGETS];
177 struct aoetgt **tgt; /* target in use when working */ 176 struct aoetgt **tgt; /* target in use when working */
178 struct aoetgt *htgt; /* target needing rexmit assistance */ 177 struct aoetgt *htgt; /* target needing rexmit assistance */
@@ -209,6 +208,8 @@ void aoecmd_exit(void);
209int aoecmd_init(void); 208int aoecmd_init(void);
210struct sk_buff *aoecmd_ata_id(struct aoedev *); 209struct sk_buff *aoecmd_ata_id(struct aoedev *);
211void aoe_freetframe(struct frame *); 210void aoe_freetframe(struct frame *);
211void aoe_flush_iocq(void);
212void aoe_end_request(struct aoedev *, struct request *, int);
212 213
213int aoedev_init(void); 214int aoedev_init(void);
214void aoedev_exit(void); 215void aoedev_exit(void);
@@ -216,7 +217,8 @@ struct aoedev *aoedev_by_aoeaddr(int maj, int min);
216struct aoedev *aoedev_by_sysminor_m(ulong sysminor); 217struct aoedev *aoedev_by_sysminor_m(ulong sysminor);
217void aoedev_downdev(struct aoedev *d); 218void aoedev_downdev(struct aoedev *d);
218int aoedev_flush(const char __user *str, size_t size); 219int aoedev_flush(const char __user *str, size_t size);
219void aoe_failbuf(struct aoedev *d, struct buf *buf); 220void aoe_failbuf(struct aoedev *, struct buf *);
221void aoedev_put(struct aoedev *);
220 222
221int aoenet_init(void); 223int aoenet_init(void);
222void aoenet_exit(void); 224void aoenet_exit(void);