lkml.org 
[lkml]   [2004]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] ppc64: Fix thinko in iommu allocator
Hi,

Below patch fixes a bug in the iommu allocator that causes it to behave
strangely when a fair size of the table is allocated.

Thanks to Andrew Gallatin for finding this.


-Olof

===== arch/ppc64/kernel/iommu.c 1.4 vs edited =====
--- 1.4/arch/ppc64/kernel/iommu.c Wed Mar 24 19:22:21 2004
+++ edited/arch/ppc64/kernel/iommu.c Thu Mar 25 17:37:04 2004
@@ -100,12 +100,13 @@
end = n + npages;

if (unlikely(end >= limit)) {
- if (likely(pass++ < 2)) {
+ if (likely(pass < 2)) {
/* First failure, just rescan the half of the table.
* Second failure, rescan the other half of the table.
*/
start = (largealloc ^ pass) ? tbl->it_halfpoint : 0;
limit = pass ? tbl->it_mapsize : limit;
+ pass++;
goto again;
} else {
/* Third failure, give up */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.376 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site