Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262322AbUC1SXS (ORCPT ); Sun, 28 Mar 2004 13:23:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262335AbUC1SXS (ORCPT ); Sun, 28 Mar 2004 13:23:18 -0500 Received: from e32.co.us.ibm.com ([32.97.110.130]:22736 "EHLO e32.co.us.ibm.com") by vger.kernel.org with ESMTP id S262322AbUC1SXM (ORCPT ); Sun, 28 Mar 2004 13:23:12 -0500 Date: Sun, 28 Mar 2004 12:22:23 -0600 (CST) From: Olof Johansson To: akpm@osdl.org, cc: benh@kernel.crashing.org, , , Subject: [PATCH] ppc64: Fix thinko in iommu allocator Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1033 Lines: 35 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/