public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ram Pai <linuxram@us.ibm.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Ram Pai <linuxram@us.ibm.com>,
	Bjorn Helgaas <bjorn.helgaas@hp.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	clemens@ladisch.de, Yinghai Lu <yinghai@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	peter.henriksson@gmail.com, ebiederm@aristanetworks.com
Subject: Re: [PATCH 1/1] PCI: ignore failure to preallocate minimal resources to hotplug bridges
Date: Tue, 11 Jan 2011 13:10:22 -0800	[thread overview]
Message-ID: <20110111211021.GA26352@ram-laptop> (raw)
In-Reply-To: <20110107143208.036a3c01@jbarnes-desktop>

On Fri, Jan 07, 2011 at 02:32:08PM -0800, Jesse Barnes wrote:
> On Fri, 22 Oct 2010 10:16:40 -0700
> Ram Pai <linuxram@us.ibm.com> wrote:
> 
> >         PCI: ignore failure to preallocate minimal resources to 
> > 		hotplug bridges
> > 
> > 	Linux tries to pre-allocate minimal resources to hotplug 
> > 	bridges.  This 	works 	fine as long as there are enough 
> > 	resources  to  satisfy   all   other   genuine  resource
> > 	requirements.  However  if  enough  resources   are  not 
> > 	available    to    satisfy    the    pre-allocation, the 
> > 	resource-allocator reports errors and returns failure.
> > 	
> > 	This patch distinguishes between must-need resources and
> > 	nice-to-have   resources.   Any   failure   to  allocate 
> > 	nice-to-have resources are ignored. 
> > 
> > 	This  behavior  can  be  particularly  useful to trigger 
> > 	automatic  reallocation, if  the  OS  discovers  genuine 
> > 	resource  allocation  conflicts  or  genuine unallocated 
> > 	BARs  caused  by not-so-smart allocation behavior of the 
> > 	native BIOS.
> > 
> > 	The motivation for this patch is due a issue reported in 
> > 	https://bugzilla.kernel.org/show_bug.cgi?id=15960
> > 
> > Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> > 
> 
> Seems like we want a fix like this; did you see Bjorn's comments?
> Maybe we can adjust the order of allocation instead?
> 
> What issues do you still have outstanding wrt resource allocation?  Do
> you still think you need the big "reallocate everything" option?

Jesse,

 Yes I saw Bjorn's comment but then i got pulled into something else and
 made no progress. Just yesterday I started looking into this and co-incidently
 see your mail too.

 I am not sure how to order the allocation given the current organization
 of the code.
	
 The real problem  is that the kernel wants to pre-allocate some minimum
 memory and ioport to hotplug bridges. On a system with just enough resources to
 satisfy the currently installed devices, the current code organization makes it
 hard to organize the allocation order such that atleast the must-have requests
 are satisfied.
	
 An ideal solution should first satisfy the must-have requests and if
 any additional resources are still available then pre-allocate nice-to-have
 requests.

 I am thinking of structuring the code the following way.

 a) note down the must-have requirement as well as the nice-to-way requirement
	for each pci-resource.
 b) run through each resource and satisfy the must-have requirement. 
 c) if (b) succeeds, run through each resource and *try* to satisfy the
	nice-to-way requirement.

 The other solution is to simply ignore preallocation to hotplug bridges.

Please suggest,
RP
	

> 
> Thanks,
> -- 
> Jesse Barnes, Intel Open Source Technology Center

-- 
Ram Pai
System X Device-Driver Enablement Lead
Linux Technology Center
Beaverton OR-97006
503-5783752 t/l 7753752
linuxram@us.ibm.com

  reply	other threads:[~2011-01-11 21:10 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-06 22:58 [RFC v2 PATCH 1/1] PCI: override BIOS/firmware resource allocation Ram Pai
2010-10-06 23:39 ` Bjorn Helgaas
2010-10-07  0:30   ` Ram Pai
2010-10-07  4:13     ` Bjorn Helgaas
2010-10-07 20:42       ` Ram Pai
2010-10-07 21:41         ` Bjorn Helgaas
2010-10-08 17:32           ` Ram Pai
2010-10-08 20:16             ` Bjorn Helgaas
2010-10-12  7:05               ` Ram Pai
2010-10-12 19:01                 ` Bjorn Helgaas
2010-10-18 20:10                   ` Jesse Barnes
2010-10-19 17:17                     ` Ram Pai
2010-10-19 18:24                       ` Jesse Barnes
2010-10-22  0:28                         ` Ram Pai
2010-10-22 17:55                           ` Bjorn Helgaas
2010-10-22 18:59                             ` Ram Pai
2010-10-22 21:49                               ` Bjorn Helgaas
2010-10-22 17:16                         ` [PATCH 1/1] PCI: ignore failure to preallocate minimal resources to hotplug bridges Ram Pai
2010-10-22 22:16                           ` Bjorn Helgaas
2011-01-07 22:32                           ` Jesse Barnes
2011-01-11 21:10                             ` Ram Pai [this message]
2011-01-14 18:19                               ` [PATCH 1/1] PCI: allocate essential resources before reserving hotplug resources Ram Pai
2011-01-18 20:52                                 ` Bjorn Helgaas
2011-01-18 21:42                                   ` Ram Pai
2011-01-18 22:11                                     ` Bjorn Helgaas
2011-01-19 19:58                                       ` [PATCH 1/1 v3] " Ram Pai
2011-01-20  1:00                                         ` [PATCH 1/1 v4] " Ram Pai
2011-01-21  1:22                                           ` Yinghai Lu
2011-01-21  7:17                                             ` Ram Pai
2011-01-18 21:30                                 ` [PATCH 1/1 Version 2.0] " Ram Pai
2011-01-18 21:46                                   ` Bjorn Helgaas
2011-01-18 22:03                                     ` Ram Pai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110111211021.GA26352@ram-laptop \
    --to=linuxram@us.ibm.com \
    --cc=bjorn.helgaas@hp.com \
    --cc=clemens@ladisch.de \
    --cc=ebiederm@aristanetworks.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=peter.henriksson@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox