Regards, Quinn Tran On 3/28/14 5:22 PM, "sagi grimberg" wrote: >On 3/29/2014 2:05 AM, Quinn Tran wrote: >> Ram disk is allocating 8x more space than required for diff data. >> For large RAM disk test, there is small potential for memory >> starvation. >> >> Signed-off-by: Nicholas Bellinger >> Signed-off-by: Giridhar Malavali >> --- >> drivers/target/target_core_rd.c | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/target/target_core_rd.c >>b/drivers/target/target_core_rd.c >> index 01dda0b..6df177a 100644 >> --- a/drivers/target/target_core_rd.c >> +++ b/drivers/target/target_core_rd.c >> @@ -253,7 +253,11 @@ static int rd_build_prot_space(struct rd_dev >>*rd_dev, int prot_length) >> if (rd_dev->rd_flags & RDF_NULLIO) >> return 0; >> >> - total_sg_needed = rd_dev->rd_page_count / prot_length; >> + /* prot_length=8byte dif data >> + * tot sg needed = rd_page_count * (PGSZ/512) * (prot_length/PGSZ) + >>pad >> + * PGSZ canceled each other. >> + */ >> + total_sg_needed = (rd_dev->rd_page_count * prot_length / 512) +1; > >You probably will want to use block_size instead of hard-coding 512. >Other then that this makes sense. QT> agreed > >> >> sg_tables = (total_sg_needed / max_sg_per_table) + 1; >> > ________________________________ This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.