From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Zkp1D-0004ZF-3Y for mharc-grub-devel@gnu.org; Sat, 10 Oct 2015 03:56:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkXCD-00023k-38 for grub-devel@gnu.org; Fri, 09 Oct 2015 08:54:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkXC9-0001tT-SG for grub-devel@gnu.org; Fri, 09 Oct 2015 08:54:49 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:33596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkXC9-0001tK-Jo for grub-devel@gnu.org; Fri, 09 Oct 2015 08:54:45 -0400 Received: by wiclk2 with SMTP id lk2so69326756wic.0 for ; Fri, 09 Oct 2015 05:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=dfvIJ6wdOQZUqEDXH31Klv0gW5rMAB+p6Z1dhOWAWzY=; b=BvLHCF/Kpo4subKIVwMMcnJD8IVW7G7mY2xez+1pUP6TVRWZSYsXGE6Z6j+ALtFfo6 XVQknpKvr4Vr0MtyyQIPlq/XIiTzWB49+kgm1fUhS4I9DhdjAglyck8+5ZbXeX1K4PP4 5dxFYrNR4Hb5bf8A3Gwlxunx/9C4LQWg94ojUWE5IXa7v4S42ipcACuMzFsEatNf16rL rEfbpzy82NTwTSZO1j4HkTLG20hrKNN+vTN8PveQyThtDHbT3nfmeuuULSNXFkB1jK2t dxi/7HE1ZylpIEFuNZy5zkfr1x5q7Mw3aWE42zHQesag/7yf//TknxiQpTgPLnHW6O7O E4dg== X-Received: by 10.194.223.72 with SMTP id qs8mr5154462wjc.145.1444395285016; Fri, 09 Oct 2015 05:54:45 -0700 (PDT) Received: from [10.119.6.25] ([83.143.7.1]) by smtp.gmail.com with ESMTPSA id kb9sm1940331wjb.49.2015.10.09.05.54.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Oct 2015 05:54:43 -0700 (PDT) Subject: Re: [PATCH] sparc64: boot performance improvements To: The development of GNU GRUB References: <1444153184-252565-1-git-send-email-eric.snowberg@oracle.com> From: =?UTF-8?Q?Vladimir_'=cf=86-coder/phcoder'_Serbinenko?= X-Enigmail-Draft-Status: N1110 Message-ID: <5617B90D.9070406@gmail.com> Date: Fri, 9 Oct 2015 14:54:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.2.0 MIME-Version: 1.0 In-Reply-To: <1444153184-252565-1-git-send-email-eric.snowberg@oracle.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fEBprgcX8HLwvM8Hdsb7feIOga7lnWodT" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::229 Cc: Eric Snowberg X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2015 12:54:53 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fEBprgcX8HLwvM8Hdsb7feIOga7lnWodT Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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. >=20 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 > --- > grub-core/kern/ieee1275/ieee1275.c | 39 ++++++++++++++++++++++++++++= ++++++++ > 1 files changed, 39 insertions(+), 0 deletions(-) >=20 > diff --git a/grub-core/kern/ieee1275/ieee1275.c b/grub-core/kern/ieee12= 75/ieee1275.c > index 9821702..30f973b 100644 > --- a/grub-core/kern/ieee1275/ieee1275.c > +++ b/grub-core/kern/ieee1275/ieee1275.c > @@ -19,11 +19,24 @@ > =20 > #include > #include > +#include > +#include > +#include > =20 > #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) > =20 > +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; > + > =0C > =20 > int > @@ -452,6 +465,18 @@ grub_ieee1275_open (const char *path, grub_ieee127= 5_ihandle_t *result) > } > args; > =20 > + struct grub_of_opened_device *dev; > + > + FOR_LIST_ELEMENTS(dev, grub_of_opened_devices) > + if (grub_strcmp(dev->path, path) =3D=3D 0) > + break; > + > + if (dev) > + { > + *result =3D dev->ihandle; > + return 0; > + } > + > INIT_IEEE1275_COMMON (&args.common, "open", 1, 1); > args.path =3D (grub_ieee1275_cell_t) path; > =20 > @@ -460,6 +485,11 @@ grub_ieee1275_open (const char *path, grub_ieee127= 5_ihandle_t *result) > *result =3D args.result; > if (args.result =3D=3D IEEE1275_IHANDLE_INVALID) > return -1; > + > + dev =3D grub_zalloc(sizeof(struct grub_of_opened_device)); > + dev->path =3D grub_strdup(path); > + dev->ihandle =3D args.result; > + grub_list_push(GRUB_AS_LIST_P (&grub_of_opened_devices), GRUB_AS_LIS= T (dev)); > return 0; > } > =20 > @@ -473,6 +503,15 @@ grub_ieee1275_close (grub_ieee1275_ihandle_t ihand= le) > } > args; > =20 > + struct grub_of_opened_device *dev; > + > + FOR_LIST_ELEMENTS(dev, grub_of_opened_devices) > + if (dev->ihandle =3D=3D ihandle) > + break; > + > + if (dev) > + return 0; > + > INIT_IEEE1275_COMMON (&args.common, "close", 1, 0); > args.ihandle =3D ihandle; > =20 >=20 --fEBprgcX8HLwvM8Hdsb7feIOga7lnWodT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAlYXuQ0ACgkQmBXlbbo5nOs0MQEAjcNuA2hfYSJfbpQo8RYaiTh+ 9i0bVDbCAWyFRwC0L5YA/icFYHsL1Y3E9wpkD+OD2yPdwkebKptLgd9SLK3be/Cs =6qkk -----END PGP SIGNATURE----- --fEBprgcX8HLwvM8Hdsb7feIOga7lnWodT--