All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael J. Accetta" <mja@laurelnetworks.com>
To: linuxppc-dev@lists.linuxppc.org
Subject: pciauto_setup_bars() allocation algorithm tweak
Date: Mon, 25 Aug 2003 23:08:33 -0400	[thread overview]
Message-ID: <3F4ACF31.9010506@laurelnetworks.com> (raw)


We recently had to bring up linuxppc on a new custom board with a PCI
device providing a 512Mb BAR region.
This appeared to run into some resource exhaustion issue when the
allocated addresses dropped below 0x80000000 (which I don't purport to
understand, not being that familar with the ppc address layout).
 However, the 512Mb BAR was clearly our culprit, since its alignment
requirement forced the current allocator to waste much of the address
space aligning the 512Mb BAR.  We implemented a relatively minor tweak
to  arch/ppc/kernel/pci_auto.c which while not a completely general
allocator handles cases like this much better. The change is described
below and I can supply a patch against MVL 2.4.18 if this might be of
any general interest.

/*
 * tweak to reduce fragmentation of the BAR address space.
 *
 * Previously, pciauto_setup_bars() simply allocated BAR addresses by
 * subtracting from these two upper limits, wasting any intervening
space left
 * unused due to the alignment required by the BAR size.  This can be fatal
 * with very large alignments that can exhaust the available address space.
 * To mitigate this a bit, we now also record the size and lower bound
of any
 * hole in the address space created by an allocation from either of these
 * upper limits.  Each setup will now try first to allocate space in the
 * hole "above" the previous allocation.  If it succeeds, the hole is
reduced
 * by the allocation size.  If it fails, allocation proceeds as before and a
 * new (possibly empty) hole is created.
 */

Mike Accetta


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

                 reply	other threads:[~2003-08-26  3:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3F4ACF31.9010506@laurelnetworks.com \
    --to=mja@laurelnetworks.com \
    --cc=linuxppc-dev@lists.linuxppc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.