mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Satyam Sharma" <satyam.sharma@gmail.com>
To: "Matthew Wilcox" <matthew@wil.cx>
Cc: "Simon Arlott" <simon@fire.lp0.eu>,
	"James Bottomley" <james.bottomley@steeleye.com>,
	"Dave Jones" <davej@redhat.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	linux-scsi@vger.kernel.org, kernel-packagers@vger.kernel.org,
	"Robert P. J. Day" <rpjday@mindspring.com>
Subject: Re: Asynchronous scsi scanning
Date: Wed, 16 May 2007 04:57:52 +0530	[thread overview]
Message-ID: <a781481a0705151627n18d3be55t6b77885fd7775ffd@mail.gmail.com> (raw)
In-Reply-To: <20070515172905.GJ10562@parisc-linux.org>

Hi,

[ I appreciate you forked the thread and gave it a better subject name,
it would be better still if you could maintain the original CC list, thanks. ]

On Tue, May 15, 2007 at 12:26:29PM +0100, Simon Arlott wrote:
> I've already suggested a sysfs attribute - or something equivalent - would
> be much better. It's just one function that a user might want to run multiple
> times (e.g. after adding scsi devices?) - why should loading a module be used
> for this?

I have to agree with Simon that ...

static int __init wait_scan_init(void)
{
	scsi_complete_async_scans();
	return 0;
/* BTW this could've been return scsi_complete_async_scans();
 * I see scsi_complete_async_scans() never fails, but still. */
}
late_initcall(wait_scan_init);

... does _not_ deserve to be a module, and writing/building a module
for something like this (just to run a function in some kernel subsytem)
does not seem to be the proper way to solve the problem either. And
IMHO sysfs attribute for this is a good (well, better than this module
thing, at least) suggestion -- I hope you'd take it more seriously.

On 5/15/07, Matthew Wilcox <matthew@wil.cx> wrote:
> > >It's easy to suggest a sysfs attribute.  What you've failed to do is
> > >suggest the pathname of the sysfs attribute,

/sys/module/scsi_mod/parameters/wait_for_async_scans (?)
Doesn't really matter, but perhaps who created the sysfs namespace
for scsi in /sys/module/scsi_mod/... could be the best person to suggest.

> > >the contents of it, or the

Merely needs to be a "echo 1 > " kind of attribute. Whenever a
store_ happens on that attribute (and it's "1"), we just call
scsi_complete_async_scans(). Then we reset the attribute itself back
to 0. Also we could introduce a lock on wait_for_async_scans so that
we don't call scsi_complete_async_scans() twice if someone
accidentally "echo 1 > "'s to it more than once (if that would really be
a bad thing, otherwise it's fine). Also, something like ... if you read the
attribute _during_ the scsi_complete_async_scans(), then you get to
see "1".

All this is doesn't really matter, anyway, all that we really care about
is that: scsi_complete_async_scans() should run whenever something
gets written to this attribute, isn't it?

> > >semantics of it (read-only?  read-write?  write-only?

Well, it _has_ to be write, don't really care if it's read-write or
write-only. I would still prefer read-write, but we can go ahead with
write-only too. It doesn't really matter, does it?

> > >blocking?)

Why, blocking, of course. scsi_complete_async_scans() by definition
is supposed to _wait_ for async scans to complete, after all? And I
see a wait_for_completion() in their which means the current method
will also block during insmod time anyway, so we'll only be
maintaining present behaviour.

> > >I'd *really* like to hear from distro people.  What is the most
> > >convenient way for you to implement "load all the scsi modules, then
> > >wait until all devices are found"?

What do the distro people really care?

It's either going to be a:

modprobe scsi_wait_scan

versus a:

echo 1 > /sys/module/scsi_mod/.../wait_for_async_scans

somewhere in some script. In fact, the latter method seems simpler,
saner, better (in every which way)!

> > >James and I had thought that loading
> > >a new module would be the easiest way for you, but it seems inconvenient
> > >for you.

It's not _inconvenient_. Just that writing/building a module for accomplishing
something like that ... is just not _right_.

> > It's inconvenient for people who *don't* use it to be unable to stop the
> > module being built and installed.

Yes.

> Why?  You're not forced to load the module.  In what way does it
> inconvenience you?  Nobody's making you run 'make modules_install'.
> I often forget to myself.

OK, I'll get really silly here myself. I don't want even that half a second of
overhead when that module is being _built_ (during make modules), not
the overhead of copying / installing at modules_install time.

I apologize if I sounded impolite, and I certainly don't want to act
demanding / difficult or anything, but it's just that doing this via a sysfs
attribute (or hey, anything else!) sounds a better way to tackle this than
this module thing. IMHO, at least.

Satyam

  parent reply	other threads:[~2007-05-15 23:28 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-13 15:22 why does x86 "make defconfig" build a single, lonely module? Robert P. J. Day
2007-05-13 15:58 ` Jan Engelhardt
2007-05-13 16:06 ` Dave Jones
2007-05-13 16:10   ` James Bottomley
2007-05-13 16:18     ` James Bottomley
2007-05-13 16:30       ` Dave Jones
2007-05-14  9:35       ` Satyam Sharma
2007-05-14  9:45         ` Satyam Sharma
2007-05-14 12:00           ` Satyam Sharma
2007-05-14 12:23             ` Satyam Sharma
2007-05-14 14:31               ` James Bottomley
2007-05-15  0:41                 ` Satyam Sharma
2007-05-15 11:26                   ` Simon Arlott
2007-05-15 12:02                     ` Asynchronous scsi scanning Matthew Wilcox
2007-05-15 16:30                       ` Simon Arlott
2007-05-15 17:29                         ` Matthew Wilcox
2007-05-15 21:56                           ` [PATCH] SCSI: Let users disable SCSI_WAIT_SCAN to be built Stefan Richter
2007-05-16 14:43                             ` Stefan Richter
2007-05-17 14:00                               ` James Bottomley
2007-05-17 17:02                                 ` Satyam Sharma
2007-05-15 23:27                           ` Satyam Sharma [this message]
2007-05-15 23:28                             ` Asynchronous scsi scanning Arjan van de Ven
2007-05-15 23:49                               ` Satyam Sharma
2007-05-16  2:51                             ` Matthew Wilcox
2007-05-16  2:59                               ` Roland Dreier
2007-05-17 17:13                               ` Satyam Sharma
2007-05-17 17:20                                 ` Matthew Wilcox
2007-05-17 17:41                                   ` Satyam Sharma
2007-05-17 18:24                                     ` Christoph Hellwig
2007-05-17 18:47                                       ` Satyam Sharma
2007-05-17 18:51                                         ` Christoph Hellwig
2007-05-17 19:04                                           ` Satyam Sharma
2007-05-17 19:39                                             ` Matthew Wilcox
2007-05-17 19:43                                               ` Benjamin LaHaise
2007-05-17 21:30                                                 ` Matthew Wilcox
2007-05-17 21:42                                                   ` Dave Jones
2007-05-17 22:00                                                     ` Peter Jones
2007-05-18 14:00                                                       ` Stefan Richter
2007-05-18  5:28                                                   ` Satyam Sharma
2007-05-18 11:24                                                     ` Matthew Wilcox
2007-05-18 13:14                                                       ` Satyam Sharma
2007-05-18  3:41                                                 ` Satyam Sharma
2007-05-18 11:19                                                   ` Matthew Wilcox
2007-05-18 13:06                                                     ` Satyam Sharma
2007-05-17 17:32                             ` sysfs makes scaling suck " Benjamin LaHaise
2007-05-17 17:45                               ` James Bottomley
2007-05-17 17:49                                 ` Benjamin LaHaise
2007-05-19 16:30                                   ` Greg KH
2007-05-17 22:24                       ` Peter Jones
2007-05-13 16:20     ` why does x86 "make defconfig" build a single, lonely module? Robert P. J. Day
2007-05-13 16:27       ` James Bottomley
2007-05-13 16:37         ` Robert P. J. Day
2007-05-13 17:42         ` Simon Arlott
2007-05-13 17:48           ` James Bottomley
2007-05-13 18:26             ` Simon Arlott
2007-05-13 18:45               ` Dave Jones
2007-05-13 18:45               ` James Bottomley
2007-05-14 17:29             ` Jan Engelhardt
2007-05-14 18:46               ` Alan Cox
2007-05-14 20:06                 ` Jan Engelhardt
2007-05-13 16:28     ` Dave Jones
2007-05-13 20:38     ` Simon Arlott

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=a781481a0705151627n18d3be55t6b77885fd7775ffd@mail.gmail.com \
    --to=satyam.sharma@gmail.com \
    --cc=davej@redhat.com \
    --cc=james.bottomley@steeleye.com \
    --cc=kernel-packagers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=rpjday@mindspring.com \
    --cc=simon@fire.lp0.eu \
    /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

all inboxes | Powered by JetHome®