From 3ab45219500c4070a6a55e57040a0484db284a53 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 2 Jul 2007 11:36:22 +0000 Subject: [PATCH] Patch from Alessandro Premoli: First, the problem: you cannot calculate sgv_max_local_order and sgv_max_trans_order by excess and then compare them with get_order(size). The maximum number of local (SG + trans) entries may be 112 (like in amd64 case) and you bzero 128 sg_entries for every allocation request between 65 and 128 pages because the order is the same. This is the reason why single transfers of (70 * PAGE_SIZE) = ~285k or more fail on amd64. On i386 the limit is higher, since you can shrink more records in one page, and so it's very difficult to reach. Now, the solution: I created a patch, which consists in decreasing sgv_max_local_order and sgv_max_trans_order by 1. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@140 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scst/src/scst_mem.c b/scst/src/scst_mem.c index f64251853..3b684d8b2 100644 --- a/scst/src/scst_mem.c +++ b/scst/src/scst_mem.c @@ -723,11 +723,11 @@ int scst_sgv_pools_init(struct scst_sgv_pools *pools) sgv_max_local_order = get_order( ((((PAGE_SIZE - sizeof(struct sgv_pool_obj)) / (sizeof(struct trans_tbl_ent) + sizeof(struct scatterlist))) * - PAGE_SIZE) & PAGE_MASK)); + PAGE_SIZE) & PAGE_MASK)) - 1; sgv_max_trans_order = get_order( ((((PAGE_SIZE - sizeof(struct sgv_pool_obj)) / - (sizeof(struct trans_tbl_ent))) * PAGE_SIZE) & PAGE_MASK)); + (sizeof(struct trans_tbl_ent))) * PAGE_SIZE) & PAGE_MASK)) - 1; TRACE_MEM("sgv_max_local_order %d, sgv_max_trans_order %d", sgv_max_local_order, sgv_max_trans_order);