mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Robinson <andr345@gmail.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] sata_nv: add a module parameter to enable async scanning
Date: Sun, 08 Mar 2009 21:13:57 +0100	[thread overview]
Message-ID: <1236543237.5783.16.camel@andreas-laptop> (raw)
In-Reply-To: <20090308090102.2db82a5b@infradead.org>

On Sun, 2009-03-08 at 09:01 -0700, Arjan van de Ven wrote:
> One thing to mention is that fastinit for sata... I only did AHCI
> (because all my machines have that). Your machine looks like it has
> something different than AHCI, so maybe the sata controller can use
> some work ;-)
> (a sata driver needs to opt into parallel scanning via a flag)
> 
> SATA init tends to be one of the things that are fix time per drive;
> and so working on that first to at least ONLY get that is worth it,
> it's a huge chunk of time (more than half the total time in your
> bootchart)

Something like the patch below, mabye? :-)

Before: [    3.056308] Freeing unused kernel memory: 364k freed
After:  [    2.411417] Freeing unused kernel memory: 364k freed

The chipset is nforce2 (drivers/ata/sata_nv.c). I couldn't find
anything like the SSS flag documented in the code, and register
specs from nvidia are as rare as hen's teeth... So I only added
the module parameter to force parallel scans.

I named it parallel_scan instead of ignore_sss though, since
there might not be an SSS-flag to ignore.

/Andreas

>From a5b090856173782308c8f61de84085be9a9b73ba Mon Sep 17 00:00:00 2001
From: Andreas Robinson <andr345@gmail.com>
Date: Sun, 8 Mar 2009 20:44:16 +0100
Subject: [PATCH] sata_nv: add a module parameter to enable async scanning

This parameter (parallel_scan) forces the OS to scan for
disks asynchronously/in parallel, to reduce boot time.

It might cause problems (brown-outs, blown fuses) in
multi-drive systems, if the PSU is unable to handle several
drives spinning up simultaneously.

It ought to be safe in single-drive systems.

Signed-off-by: Andreas Robinson <andr345@gmail.com>
---
 drivers/ata/sata_nv.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 55a8eed..e8aba2f 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -579,6 +579,7 @@ MODULE_VERSION(DRV_VERSION);
 
 static int adma_enabled;
 static int swncq_enabled = 1;
+static int parallel_scan = 0;
 
 static void nv_adma_register_mode(struct ata_port *ap)
 {
@@ -2427,6 +2428,9 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	} else if (type == SWNCQ)
 		nv_swncq_host_init(host);
 
+	if (parallel_scan)
+		host->flags |= ATA_HOST_PARALLEL_SCAN;
+
 	pci_set_master(pdev);
 	return ata_host_activate(host, pdev->irq, ipriv->irq_handler,
 				 IRQF_SHARED, ipriv->sht);
@@ -2526,4 +2530,6 @@ module_param_named(adma, adma_enabled, bool, 0444);
 MODULE_PARM_DESC(adma, "Enable use of ADMA (Default: true)");
 module_param_named(swncq, swncq_enabled, bool, 0444);
 MODULE_PARM_DESC(swncq, "Enable use of SWNCQ (Default: true)");
+module_param_named(parallel_scan, parallel_scan, bool, 0444);
+MODULE_PARM_DESC(parallel_scan, "Force parallel host scan (Default: false)");
 
-- 
1.5.6.3



  reply	other threads:[~2009-03-08 20:14 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-15 18:20 [RFC PATCH 0/6] module, kbuild: Faster boot with custom kernel Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 1/6] New option: Static linking of external modules Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 2/6] module: add module ELF section with module_init() pointer Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 3/6] module: always prefix module parameters with the module name Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 4/6] kbuild: allow linking of an external object into vmlinux Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 5/6] scripts: new module preprocessor for static linking Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 6/6] kbuild: enable relinking of vmlinux without full kernel tree Andreas Robinson
2009-02-16 22:51 ` [RFC PATCH 0/6] module, kbuild: Faster boot with custom kernel Rusty Russell
2009-02-17 10:42   ` Andreas Robinson
2009-02-17 11:53     ` Kay Sievers
2009-02-18  4:58       ` Rusty Russell
2009-02-18  9:15         ` Kay Sievers
2009-02-18 10:25           ` Andreas Robinson
2009-02-20  0:37             ` Andreas Robinson
2009-02-20  1:55               ` Kay Sievers
2009-02-21 11:43                 ` Andreas Robinson
2009-03-02 14:32                   ` Andreas Robinson
2009-03-02 15:59                     ` Kay Sievers
2009-03-02 16:20                     ` Arjan van de Ven
2009-03-02 16:29                       ` Kay Sievers
2009-03-02 18:27                         ` Arjan van de Ven
2009-03-02 21:41                           ` Andreas Robinson
2009-03-04 18:47                           ` Andreas Robinson
2009-03-06  0:18                             ` Arjan van de Ven
2009-03-06 15:15                               ` Andreas Robinson
2009-03-06 15:45                                 ` Arjan van de Ven
2009-03-08 10:47                                   ` Andreas Robinson
2009-03-08 16:01                                     ` Arjan van de Ven
2009-03-08 20:13                                       ` Andreas Robinson [this message]
2009-03-09 17:12                                       ` Will Newton
2009-03-06  7:05                       ` fastboot kernel parameter Sitsofe Wheeler
2009-03-06 11:23                         ` Arjan van de Ven
2009-02-24  1:27               ` [RFC PATCH 0/6] module, kbuild: Faster boot with custom kernel Rusty Russell
2009-02-18 11:57           ` Rusty Russell
2009-02-18 13:57             ` Kay Sievers
2009-02-19 11:15               ` Rusty Russell
2009-02-19 11:41                 ` Kay Sievers
2009-02-19 20:48                   ` Kay Sievers
2009-02-19 21:59                     ` Kay Sievers
2009-02-20  0:58                       ` Rusty Russell
2009-02-20  1:33                         ` Kay Sievers
2009-02-24  1:39                           ` Rusty Russell
2009-02-20 11:32                         ` Rusty Russell
2009-02-23 16:42                           ` Kay Sievers
2009-02-25  7:03                             ` Rusty Russell
2009-02-25 18:12                               ` Kay Sievers

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=1236543237.5783.16.camel@andreas-laptop \
    --to=andr345@gmail.com \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.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

Powered by JetHome