[PATCH]Fixes of performance and stability issues in CFI driver.

Alexey Korolev akorolev at pentafluge.infradead.org
Fri Jul 7 13:00:28 EDT 2006


Nicolas,

What is your opinion regardring the modified patch.
If nobody complains would it be possible to include this patch into repository? 

Thanks,
Alexey
> The code I verified today has some issues:
> 
> 1. The resolution of sleeping procedure on erase operations is still very low. 
> Tests showed erase performance ~278Kb/sec it's better than 246Kb/sec from original code but it's still far from real device speed ~310Kb/sec.
> 
> 2. This code
> >+		if (chip_op_time/2 >= 1000000/HZ) {
> >+			/*
> >+			 * Half of the normal delay still remaining
> >+			 * can be performed with a sleeping delay instead
> >+			 * of busy waiting.
> >+			 */
> >+			msleep(chip_op_time/2000);
> >+			timeo -= chip_op_time/2;
> >+			chip_op_time -= chip_op_time/2;
> >+		} else {
> >+			udelay(1);
> >+			cond_resched();
> >+			timeo--;
> >+		}
> may add additional load of CPU when it is unnecessary (necessety is doubtful here). If we need to wait for a long time (erase) we divide chip_op_time by 2 everytime. When we reach 10ms we go to the udelay(1) and perform ~10000 cycles. IMO there is no necessety to do this. 
> 
> I found a rather good idea in your code with handling of timeo variable. So I slightly modified your code to avoid the issues with erase performance and verified it. It passed the tests.
> (New code showed erase performance ~310Kb/sec)
> 
> What do you think about this patch?
> 
> 
Thanks,
Alexey




More information about the linux-mtd mailing list