提交 fd820f40 编写于 作者: F FUJITA Tomonori 提交者: Jens Axboe

revert sg segment size ifdefs

This reverts sg segment size ifdefs that the current code has in order
to provide a way to reduce sgpool memory consumption.
Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 7530c20f
...@@ -34,6 +34,13 @@ ...@@ -34,6 +34,13 @@
#define SG_MEMPOOL_NR ARRAY_SIZE(scsi_sg_pools) #define SG_MEMPOOL_NR ARRAY_SIZE(scsi_sg_pools)
#define SG_MEMPOOL_SIZE 2 #define SG_MEMPOOL_SIZE 2
/*
* The maximum number of SG segments that we will put inside a scatterlist
* (unless chaining is used). Should ideally fit inside a single page, to
* avoid a higher order allocation.
*/
#define SCSI_MAX_SG_SEGMENTS 128
struct scsi_host_sg_pool { struct scsi_host_sg_pool {
size_t size; size_t size;
char *name; char *name;
...@@ -45,9 +52,15 @@ struct scsi_host_sg_pool { ...@@ -45,9 +52,15 @@ struct scsi_host_sg_pool {
static struct scsi_host_sg_pool scsi_sg_pools[] = { static struct scsi_host_sg_pool scsi_sg_pools[] = {
SP(8), SP(8),
SP(16), SP(16),
#if (SCSI_MAX_SG_SEGMENTS > 16)
SP(32), SP(32),
#if (SCSI_MAX_SG_SEGMENTS > 32)
SP(64), SP(64),
#if (SCSI_MAX_SG_SEGMENTS > 64)
SP(128), SP(128),
#endif
#endif
#endif
}; };
#undef SP #undef SP
...@@ -684,13 +697,6 @@ static struct scsi_cmnd *scsi_end_request(struct scsi_cmnd *cmd, int uptodate, ...@@ -684,13 +697,6 @@ static struct scsi_cmnd *scsi_end_request(struct scsi_cmnd *cmd, int uptodate,
return NULL; return NULL;
} }
/*
* The maximum number of SG segments that we will put inside a scatterlist
* (unless chaining is used). Should ideally fit inside a single page, to
* avoid a higher order allocation.
*/
#define SCSI_MAX_SG_SEGMENTS 128
/* /*
* Like SCSI_MAX_SG_SEGMENTS, but for archs that have sg chaining. This limit * Like SCSI_MAX_SG_SEGMENTS, but for archs that have sg chaining. This limit
* is totally arbitrary, a setting of 2048 will get you at least 8mb ios. * is totally arbitrary, a setting of 2048 will get you at least 8mb ios.
...@@ -708,15 +714,21 @@ static inline unsigned int scsi_sgtable_index(unsigned short nents) ...@@ -708,15 +714,21 @@ static inline unsigned int scsi_sgtable_index(unsigned short nents)
case 9 ... 16: case 9 ... 16:
index = 1; index = 1;
break; break;
#if (SCSI_MAX_SG_SEGMENTS > 16)
case 17 ... 32: case 17 ... 32:
index = 2; index = 2;
break; break;
#if (SCSI_MAX_SG_SEGMENTS > 32)
case 33 ... 64: case 33 ... 64:
index = 3; index = 3;
break; break;
case 65 ... SCSI_MAX_SG_SEGMENTS: #if (SCSI_MAX_SG_SEGMENTS > 64)
case 65 ... 128:
index = 4; index = 4;
break; break;
#endif
#endif
#endif
default: default:
printk(KERN_ERR "scsi: bad segment count=%d\n", nents); printk(KERN_ERR "scsi: bad segment count=%d\n", nents);
BUG(); BUG();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册