From owner-cvs-src@FreeBSD.ORG Thu Aug 5 19:56:53 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D82B916A511; Thu, 5 Aug 2004 19:56:53 +0000 (GMT) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 860AF43D60; Thu, 5 Aug 2004 19:56:53 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.0.34] (adsl-67-127-84-57.dsl.snfc21.pacbell.net [67.127.84.57]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id i75JuqRX031329; Thu, 5 Aug 2004 12:56:52 -0700 Message-ID: <41129104.30207@root.org> Date: Thu, 05 Aug 2004 12:56:52 -0700 From: Nate Lawson User-Agent: Mozilla Thunderbird 0.7 (X11/20040702) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Baldwin , cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, src-committers@FreeBSD.org References: <20040805154821.C9E3F16A541@hub.freebsd.org> In-Reply-To: <20040805154821.C9E3F16A541@hub.freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: cvs commit: src/sys/kern subr_rman.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2004 19:56:54 -0000 John Baldwin wrote: > jhb 2004-08-05 15:48:18 UTC > > FreeBSD src repository > > Modified files: > sys/kern subr_rman.c > Log: > Fix the code in rman that merges adjacent unallocated resources to use a > better check for 'adjacent'. The old code assumed that if two resources > were adjacent in the linked list that they were also adjacent range wise. > This is not true when a resource manager has to manage disparate regions. > For example, the current interrupt code on i386/amd64 will instruct > irq_rman to manage two disjoint regions: 0-1 and 3-15 for the non-APIC > case. If IRQs 1 and 3 were allocated and then released, the old code > would coalesce across the 1 to 3 boundary because the resources were > adjacent in the linked list thus adding 2 to the area of resources that > irq_rman managed as a side effect. The fix adds extra checks so that > adjacent unallocated resources are only merged with the resource being > freed if the start and end values of the resources also match up. The > patch also consolidates the checks for adjacent resources being allocated. > > Revision Changes Path > 1.35 +12 -5 src/sys/kern/subr_rman.c Thanks! I'm really glad you looked into this. We're starting to have more "merge" cases for rman with ACPI management of IO ports/memory. -Nate