Date: Thu, 5 Aug 2004 15:48:18 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern subr_rman.c Message-ID: <200408051548.i75FmILZ074276@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408051548.i75FmILZ074276>