From: Matthew Wilcox <matthew@wil.cx>
To: Dave Jones <davej@redhat.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] async scsi scanning, version 11
Date: Sun, 24 Sep 2006 13:51:44 -0600 [thread overview]
Message-ID: <20060924195144.GD2595@parisc-linux.org> (raw)
In-Reply-To: <20060924194345.GC4094@redhat.com>
On Sun, Sep 24, 2006 at 03:43:45PM -0400, Dave Jones wrote:
> On Sun, Sep 24, 2006 at 01:06:24PM -0600, Matthew Wilcox wrote:
> > +
> > +int scsi_complete_async_scans(void)
> > +{
> > + struct async_scan_data *data;
> > +
> > + do {
> > + if (list_empty(&scanning_hosts))
> > + return 0;
> > + data = kmalloc(sizeof(*data), GFP_KERNEL);
> > + if (!data)
> > + msleep(1);
> > + } while (!data);
>
> does __GFP_NOFAIL or __GFP_REPEAT have the desired effect here?
Well ... that would probably be OK. But I think it's actually preferable
to not use it. See, the scan might finish while we're waiting for
memory, and if it does, then we don't need to allocate memory after all.
This is totally quibbling over the most unlikely of scenarios though,
so I have no problem with making the change if we just want to exemplify
best practice here.
next prev parent reply other threads:[~2006-09-24 19:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-24 19:06 [PATCH] async scsi scanning, version 11 Matthew Wilcox
2006-09-24 19:43 ` Dave Jones
2006-09-24 19:51 ` Matthew Wilcox [this message]
2006-09-24 20:02 ` Randy Dunlap
2006-09-24 20:40 ` Matthew Wilcox
2006-09-24 20:42 ` Randy Dunlap
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=20060924195144.GD2595@parisc-linux.org \
--to=matthew@wil.cx \
--cc=davej@redhat.com \
--cc=linux-scsi@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