Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758163Ab2EHCqs (ORCPT ); Mon, 7 May 2012 22:46:48 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:43319 "EHLO e23smtp05.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758087Ab2EHCqr (ORCPT ); Mon, 7 May 2012 22:46:47 -0400 Date: Tue, 8 May 2012 10:46:12 +0800 From: Richard Yang To: Yinghai Lu Cc: Richard Yang , Wei Yang , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: One problem in reassign pci bus number? Message-ID: <20120508024612.GA11485@richard> Reply-To: Richard Yang References: <20120504024721.GA6775@richard> <20120504045205.GA21624@richard> <20120506151715.GA7773@richard> <20120507011722.GA8122@richard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) x-cbid: 12050716-1396-0000-0000-0000011C2E71 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1518 Lines: 45 On Sun, May 06, 2012 at 07:04:09PM -0700, Yinghai Lu wrote: >On Sun, May 6, 2012 at 6:17 PM, Richard Yang wrote: >> so this free space will be combined with the free space got from >> parent, form a big space to meet the requirement. >> >> This is the general idea about probe_resource()? >> >> And this is the design decision to find the free space at the end >> of top, even at the start we have more free space? > >no, probe_resource will get from start if space is big enough. > >if not, it will try to extend top. Hmm... for example we still have this parent[70-160] brother1[70-80] res[90-150] brother2[151-160] ->child[105-140] if we call probe_resource(res, new_res, 16, par, 1, 0xff, IORESOURCE_PCI_FIXED); I think this call is used to allocate a res of size 16 under res. When there is no enough free space, it will expend res, and res->parent. While in this situation, res doesn't have enough free space. so it need to expend itself. In the probe_resource() it tries to extend res on the right side. So even there is enough space between brother1 and res, I think the probe_resource() will not return 0. Do you think my analysis is correct? > >Yinghai -- Richard Yang Help you, Help me -- 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/