- SGV cache related parameters moved from scst.h to scst_sgv.h

- Minor updates



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@577 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2008-11-20 17:05:08 +00:00
parent 371e083d06
commit d908081912
6 changed files with 75 additions and 42 deletions
+9
View File
@@ -146,6 +146,15 @@ CAUTION: Working of target and initiator on the same host isn't
======== supported. See SCST README file for details.
Performance advices
-------------------
1. If you use Windows XP or Windows 2003+ as initiators, you should
consider to decrease TcpAckFrequency parameter to 1. See
http://support.microsoft.com/kb/328890/ or google for "TcpAckFrequency"
for more details.
Known issues
------------
+2
View File
@@ -1,6 +1,8 @@
To be done
----------
- See http://scst.sourceforge.net/contributing.html
- Kernel build integration (patch).
- Reimplement VDISK handler with usage of async. read/write operations
+2 -41
View File
@@ -34,6 +34,8 @@
#include <scst_const.h>
#include "scst_sgv.h"
/*
* Version numbers, the same as for the kernel.
*
@@ -1339,17 +1341,6 @@ struct scst_mgmt_cmd {
void *tgt_priv;
};
struct scst_mem_lim {
/* How much memory allocated under this object */
atomic_t alloced_pages;
/*
* How much memory allowed to allocated under this object. Put here
* mostly to save a possible cache miss accessing scst_max_dev_cmd_mem.
*/
int max_allowed_pages;
};
struct scst_device {
struct scst_dev_type *handler; /* corresponding dev handler */
@@ -2676,36 +2667,6 @@ static inline void scst_thr_data_put(struct scst_thr_data_hdr *data)
data->free_fn(data);
}
/* SGV pool routines and flag bits */
/* Set if the allocated object must be not from the cache */
#define SCST_POOL_ALLOC_NO_CACHED 1
/* Set if there should not be any memory allocations on a cache miss */
#define SCST_POOL_NO_ALLOC_ON_CACHE_MISS 2
/* Set an object should be returned even if it doesn't have SG vector built */
#define SCST_POOL_RETURN_OBJ_ON_ALLOC_FAIL 4
struct sgv_pool_obj;
struct sgv_pool;
struct sgv_pool *sgv_pool_create(const char *name, int clustered);
void sgv_pool_destroy(struct sgv_pool *pool);
void sgv_pool_set_allocator(struct sgv_pool *pool,
struct page *(*alloc_pages_fn)(struct scatterlist *, gfp_t, void *),
void (*free_pages_fn)(struct scatterlist *, int, void *));
struct scatterlist *sgv_pool_alloc(struct sgv_pool *pool, unsigned int size,
gfp_t gfp_mask, int flags, int *count,
struct sgv_pool_obj **sgv, struct scst_mem_lim *mem_lim, void *priv);
void sgv_pool_free(struct sgv_pool_obj *sgv, struct scst_mem_lim *mem_lim);
void *sgv_get_priv(struct sgv_pool_obj *sgv);
void scst_init_mem_lim(struct scst_mem_lim *mem_lim);
/**
** Generic parse() support routines.
** Done via pointer on functions to avoid unneeded dereferences on
+60
View File
@@ -0,0 +1,60 @@
/*
* include/scst_sgv.h
*
* Copyright (C) 2004 - 2008 Vladislav Bolkhovitin <vst@vlnb.net>
* Copyright (C) 2004 - 2005 Leonid Stoljar
* Copyright (C) 2007 - 2008 CMS Distribution Limited
*
* Include file for SCST SGV cache.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, version 2
* of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
/* SGV pool routines and flag bits */
/* Set if the allocated object must be not from the cache */
#define SCST_POOL_ALLOC_NO_CACHED 1
/* Set if there should not be any memory allocations on a cache miss */
#define SCST_POOL_NO_ALLOC_ON_CACHE_MISS 2
/* Set an object should be returned even if it doesn't have SG vector built */
#define SCST_POOL_RETURN_OBJ_ON_ALLOC_FAIL 4
struct sgv_pool_obj;
struct sgv_pool;
struct scst_mem_lim {
/* How much memory allocated under this object */
atomic_t alloced_pages;
/*
* How much memory allowed to allocated under this object. Put here
* mostly to save a possible cache miss accessing scst_max_dev_cmd_mem.
*/
int max_allowed_pages;
};
struct sgv_pool *sgv_pool_create(const char *name, int clustered);
void sgv_pool_destroy(struct sgv_pool *pool);
void sgv_pool_set_allocator(struct sgv_pool *pool,
struct page *(*alloc_pages_fn)(struct scatterlist *, gfp_t, void *),
void (*free_pages_fn)(struct scatterlist *, int, void *));
struct scatterlist *sgv_pool_alloc(struct sgv_pool *pool, unsigned int size,
gfp_t gfp_mask, int flags, int *count,
struct sgv_pool_obj **sgv, struct scst_mem_lim *mem_lim, void *priv);
void sgv_pool_free(struct sgv_pool_obj *sgv, struct scst_mem_lim *mem_lim);
void *sgv_get_priv(struct sgv_pool_obj *sgv);
void scst_init_mem_lim(struct scst_mem_lim *mem_lim);
+1
View File
@@ -71,6 +71,7 @@ install: all
modules_install
install -d $(INSTALL_DIR_H)
install -m 644 ../include/scst.h $(INSTALL_DIR_H)
install -m 644 ../include/scst_sgv.h $(INSTALL_DIR_H)
install -m 644 ../include/scst_debug.h $(INSTALL_DIR_H)
install -m 644 ../include/scst_user.h $(INSTALL_DIR_H)
install -m 644 ../include/scst_const.h $(INSTALL_DIR_H)
+1 -1
View File
@@ -603,7 +603,7 @@ static int scst_parse_cmd(struct scst_cmd *cmd)
cmd->expected_transfer_len, cmd->cdb[0],
dev->handler->name, cmd->tgtt->name,
cmd->bufflen);
PRINT_BUFF_FLAG(TRACE_MINOR, "Suspicious CDB",
PRINT_BUFF_FLAG(TRACE_MGMT_MINOR, "Suspicious CDB",
cmd->cdb, cmd->cdb_len);
}
#endif