From: Patrick Mansfield <patmans@us.ibm.com>
To: Luben Tuikov <luben@splentec.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: scsi command slab allocation under memory pressure
Date: Wed, 29 Jan 2003 12:11:17 -0800 [thread overview]
Message-ID: <20030129121117.A3389@beaverton.ibm.com> (raw)
In-Reply-To: <3E382E2C.4030201@splentec.com>; from luben@splentec.com on Wed, Jan 29, 2003 at 02:40:28PM -0500
On Wed, Jan 29, 2003 at 02:40:28PM -0500, Luben Tuikov wrote:
> Patrick Mansfield wrote:
>
> Is this a question, narrative, comment or flame? I'll try to answer
> this anyway.
Yes, except for the flame part :)
> James had this comment, just because I put the mechanism there to allow
> for more than one command to be in the store of backup command structs.
> See my reply to his email in the archives.
>
> The reason for populating free_list with just one command on host init,
> is quite obvious, but to elaborate, the choices are 1 and N, where N is
> a natural number greater than 1.
>
> The problem with N is that I do *not* have a heuristic which will tell me
> what a suitable value for N is. How about 5, hmm, what about 10, or maybe
> 1e10?
We do have bounds on the number of commands.
Assuming N is the minimum number of commands we want available:
Currently (plain 2.5.59) we have N being at the number of scsi_device's on
the system, and we always have at least one command available for each
scsi_device.
It is not clear if N should be the number of scsi commands that might be
outstanding on the system (what it used to be prior to Doug L's queue
depth changes, and what we have in 2.4).
So N should be at least the number of scsi_devices on the system, and at
most the sum of all the commands that can potentially be used by all
scsi_devices on the system.
> Furthermore, N may be a constant or it may be a function of how much
> memory we currently have, how many commands have been queued into the host,
> etc, or it may just be N = can_queue - num_queued_commands + 1, which is
> dynamic, which is pointless (Homework: show why).
>
> We want to waste as little memory as possible (thus 1 per host), since
> SCSI Core is not the only subsystem running on the machine. Hint:
> see the flags the slabs are allocated with. Using the Central Limit
> Theorem, I hope that by the time we get low on memory pressure, the scsi
> command cache pool size has settled*. Unless we started with very little
> memory, which would be quite unusual in this day and age.
If we must allocate enough space to ensure proper swapout behavour, it is
not a waste!
IMO we need something similiar to the request_queue_t free list, where
we allocate a bunch of items up front out of a slab.
> * Lots of assumptions here, but all valid for a *server* machine.
>
> Let's get some experience with this thing running and actually have a
> *natural* failing example, and we can twiddle with the initial value
> of N, and/or can develop a f(N) which would be computed occasionally
> and free_list varied upon scsi_put_command().
Are you saying we will always be able to get a command under low memory
situtations?
If not, the code should be changed, otherwise please explain how.
We should not wait for a failure to occur to answer the question.
-- Patrick Mansfield
next prev parent reply other threads:[~2003-01-29 20:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-29 18:47 scsi command slab allocation under memory pressure Patrick Mansfield
2003-01-29 19:40 ` Luben Tuikov
2003-01-29 20:11 ` Patrick Mansfield [this message]
2003-01-29 22:26 ` Luben Tuikov
2003-01-31 6:57 ` Andrew Morton
2003-01-31 13:46 ` James Bottomley
2003-01-31 20:44 ` Andrew Morton
2003-02-01 2:46 ` Patrick Mansfield
2003-02-03 22:55 ` Doug Ledford
2003-02-03 22:59 ` Andrew Morton
2003-02-03 23:05 ` James Bottomley
2003-02-03 23:19 ` Andrew Morton
2003-02-04 18:04 ` Luben Tuikov
2003-02-04 6:15 ` Andre Hedrick
2003-01-29 22:53 ` James Bottomley
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=20030129121117.A3389@beaverton.ibm.com \
--to=patmans@us.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=luben@splentec.com \
/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