From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: Eric Snowberg <eric.snowberg@oracle.com>
Subject: Re: [PATCH] sparc64: boot performance improvements
Date: Fri, 9 Oct 2015 14:54:37 +0200 [thread overview]
Message-ID: <5617B90D.9070406@gmail.com> (raw)
In-Reply-To: <1444153184-252565-1-git-send-email-eric.snowberg@oracle.com>
[-- Attachment #1: Type: text/plain, Size: 3118 bytes --]
On 06.10.2015 19:39, Eric Snowberg wrote:
> Keep of devices open. This can save 6 - 7 seconds per open call and
> can decrease boot times from over 10 minutes to 29 seconds on
> larger SPARC systems. The open/close calls with some vendors'
> SAS controllers cause the entire card to be reinitialized after
> each close.
>
Unfortunately on some systems (AFAIR old sparcs) hard-locks if the same
device is opened twice. We tried to detect when 2 devices are named
differently but it's not possible to do reliably on IEEE1275. Our only
solution was to ensure that only 1 disk is open at a time. Do you use
some kind of RAID? Can you try keeping last_handle open in ofdisk.c
rather than closing it?
> Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
> ---
> grub-core/kern/ieee1275/ieee1275.c | 39 ++++++++++++++++++++++++++++++++++++
> 1 files changed, 39 insertions(+), 0 deletions(-)
>
> diff --git a/grub-core/kern/ieee1275/ieee1275.c b/grub-core/kern/ieee1275/ieee1275.c
> index 9821702..30f973b 100644
> --- a/grub-core/kern/ieee1275/ieee1275.c
> +++ b/grub-core/kern/ieee1275/ieee1275.c
> @@ -19,11 +19,24 @@
>
> #include <grub/ieee1275/ieee1275.h>
> #include <grub/types.h>
> +#include <grub/misc.h>
> +#include <grub/list.h>
> +#include <grub/mm.h>
>
> #define IEEE1275_PHANDLE_INVALID ((grub_ieee1275_cell_t) -1)
> #define IEEE1275_IHANDLE_INVALID ((grub_ieee1275_cell_t) 0)
> #define IEEE1275_CELL_INVALID ((grub_ieee1275_cell_t) -1)
>
> +struct grub_of_opened_device
> +{
> + struct grub_of_opened_device *next;
> + struct grub_of_opened_device **prev;
> + grub_ieee1275_ihandle_t ihandle;
> + char *path;
> +};
> +
> +static struct grub_of_opened_device *grub_of_opened_devices;
> +
> \f
>
> int
> @@ -452,6 +465,18 @@ grub_ieee1275_open (const char *path, grub_ieee1275_ihandle_t *result)
> }
> args;
>
> + struct grub_of_opened_device *dev;
> +
> + FOR_LIST_ELEMENTS(dev, grub_of_opened_devices)
> + if (grub_strcmp(dev->path, path) == 0)
> + break;
> +
> + if (dev)
> + {
> + *result = dev->ihandle;
> + return 0;
> + }
> +
> INIT_IEEE1275_COMMON (&args.common, "open", 1, 1);
> args.path = (grub_ieee1275_cell_t) path;
>
> @@ -460,6 +485,11 @@ grub_ieee1275_open (const char *path, grub_ieee1275_ihandle_t *result)
> *result = args.result;
> if (args.result == IEEE1275_IHANDLE_INVALID)
> return -1;
> +
> + dev = grub_zalloc(sizeof(struct grub_of_opened_device));
> + dev->path = grub_strdup(path);
> + dev->ihandle = args.result;
> + grub_list_push(GRUB_AS_LIST_P (&grub_of_opened_devices), GRUB_AS_LIST (dev));
> return 0;
> }
>
> @@ -473,6 +503,15 @@ grub_ieee1275_close (grub_ieee1275_ihandle_t ihandle)
> }
> args;
>
> + struct grub_of_opened_device *dev;
> +
> + FOR_LIST_ELEMENTS(dev, grub_of_opened_devices)
> + if (dev->ihandle == ihandle)
> + break;
> +
> + if (dev)
> + return 0;
> +
> INIT_IEEE1275_COMMON (&args.common, "close", 1, 0);
> args.ihandle = ihandle;
>
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]
prev parent reply other threads:[~2015-10-10 7:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 17:39 [PATCH] sparc64: boot performance improvements Eric Snowberg
2015-10-07 8:36 ` Andrei Borzenkov
2015-10-07 23:20 ` Eric Snowberg
2015-10-09 6:50 ` Andrei Borzenkov
2015-10-10 1:31 ` Eric Snowberg
2015-10-10 7:35 ` Vladimir 'phcoder' Serbinenko
2015-10-11 16:49 ` Eric Snowberg
2015-10-25 15:20 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-10-27 16:34 ` Eric Snowberg
2015-10-28 10:28 ` Vladimir 'phcoder' Serbinenko
2015-10-09 12:54 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
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=5617B90D.9070406@gmail.com \
--to=phcoder@gmail.com \
--cc=eric.snowberg@oracle.com \
--cc=grub-devel@gnu.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.