public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Peschke <mp3@de.ibm.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [Patch] cleanup: GFP_ATOMIC to GFP_KERNEL in scsi_scan.c
Date: Tue, 22 Aug 2006 17:44:58 +0200	[thread overview]
Message-ID: <44EB267A.7010104@de.ibm.com> (raw)
In-Reply-To: <44EAD1B7.1010505@s5r6.in-berlin.de>

Stefan Richter wrote:
> Martin Peschke wrote:
>> It seems to be safe to replace all 4 occurrences of GFP_ATOMIC in
>> scsi_scan.c by GFP_KERNEL. I found that calling code always held a mutex
>> (indicating process context) while not acquiring a spin_lock or such
>> inside the mutex sections and when using GFP_ATOMIC (see details below).
> 
> Please use diff's -p option for postings like this.

okay

> Did you check Documentation/scsi/scsi_mid_low_api.txt with respect to
> the detailed description of all exported functions which you modify? All
> of them should contain a remark like "Might block: yes" or something
> else in the way of "do not call in atomic context". Although I suppose
> that all or most of them do so already.
> 
> If scsi_mid_low_api.txt does not fully reflect what your patch imposes,
> please modify scsi_mid_low_api.txt in the same patch.

Thanks for the hint.

My changes conform to this description, as far as scsi_mid_low_api.txt
covers the interfaces touched by my patch.

Looks like a documentation update is needed regardless of my patch:

scsi_get_host_dev(), scsi_scan_target(), __scsi_add_device() are not
documented, though being exported. These are the ones affected by my
patch. I didn't check for other misses.

scsi_mid_low_api.txt says scsi_add_host() never blocks. This function
calls sysfs routines which might block (on mutex), and it uses
GFP_KERNEL - the latter not being my fault :)

scsi_host_get() "currently may block but may be changed to not block" -
current code won't block.

(My observations come from 2.6.18-rc4-mm2.)

> You need to make sure that it does not break _any_ caller. (SCSI is more
> than the bundle of interconnect drivers for SPI hardware.) Also take
> precautions for future callers or future changes to current callers.

Sure. I found that all these interface functions acquire a mutex. That is,
any caller which doesn't guarantee process context would be broken anyway,
even without me changing GFP_ATOMICs.

Martin


  reply	other threads:[~2006-08-22 15:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-21 19:07 [Patch] cleanup: GFP_ATOMIC to GFP_KERNEL in scsi_scan.c Martin Peschke
2006-08-22  9:43 ` Stefan Richter
2006-08-22 15:44   ` Martin Peschke [this message]
2006-08-22 20:26     ` Stefan Richter

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=44EB267A.7010104@de.ibm.com \
    --to=mp3@de.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stefanr@s5r6.in-berlin.de \
    /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