From: Jens Axboe <axboe@suse.de>
To: Douglas Gilbert <dougg@torque.net>
Cc: Nishanth Aravamudan <nacc@us.ibm.com>,
James Bottomley <James.Bottomley@SteelEye.com>,
SCSI Mailing List <linux-scsi@vger.kernel.org>,
hch@infradead.org
Subject: Re: [PATCH] scsi_debug [was: scsi_debug issues]
Date: Fri, 22 Oct 2004 12:02:13 +0200 [thread overview]
Message-ID: <20041022100212.GX1820@suse.de> (raw)
In-Reply-To: <41743E41.8020707@torque.net>
On Tue, Oct 19 2004, Douglas Gilbert wrote:
> Nishanth Aravamudan wrote:
> >On Mon, Oct 18, 2004 at 11:44:59PM +1000, Douglas Gilbert wrote:
> >
> >>James Bottomley wrote:
> >>
> >>>On Sat, 2004-10-16 at 01:51, Douglas Gilbert wrote:
> >>>
> >>>
> >>>>So this problem seems related to highmem.
> >
> >
> ><snip>
> >
> >>The above required a fair few changes to scsi_debug.
> >>Attached is a patch that rolls "kmap" changes with
> >>patches I have sent recently for scsi_debug.
> >>Attachment is gzipped (due to size) and applies against
> >>lk 2.6.8.1 -> lk 2.6.9-rc4 .
> >>
> >>Nishanth, could you test this with highmem?
> >
> >
> >Doug,
> >
> >I ran 2.6.9-rc4 with your patch applied and had several dump_stack()s
> >occur (complaining about sleeping in an invalid context) and a final
> >panic during mkfs :) I think something is still wrong... ;) Output is
> >below and attached.
>
> Ok, it looks like kmap_atomic() is needed.
> Could you try this additional patch.
>
> Doug Gilbert
> --- linux/drivers/scsi/scsi_debug.c 2004-10-19 07:59:14.966673272 +1000
> +++ linux/drivers/scsi/scsi_debug.c174b 2004-10-19 07:58:46.044070176 +1000
> @@ -56,7 +56,7 @@
> #include "scsi_debug.h"
>
> #define SCSI_DEBUG_VERSION "1.74"
> -static const char * scsi_debug_version_date = "20041018";
> +static const char * scsi_debug_version_date = "20041019";
>
> /* Additional Sense Code (ASC) used */
> #define NO_ADDED_SENSE 0x0
> @@ -505,7 +505,8 @@
> active = 1;
> for (k = 0, req_len = 0, act_len = 0; k < scp->use_sg; ++k, ++sgpnt) {
> if (active) {
> - kaddr = (unsigned char *)kmap(sgpnt->page);
> + kaddr = (unsigned char *)
> + kmap_atomic(sgpnt->page, KM_USER0);
> if (NULL == kaddr)
> return (DID_ERROR << 16);
> kaddr = (unsigned char *)kaddr + sgpnt->offset;
> @@ -515,7 +516,7 @@
> len = arr_len - req_len;
> }
> memcpy(kaddr, arr + req_len, len);
> - kunmap(sgpnt->page);
> + kunmap_atomic(sgpnt->page, KM_USER0);
BUG, kunmap_atomic(kaddr) (without the offset).
Also do make sure that you stay on the same cpu from calling kmap_atomic
to kunmap_atomic(). If you are under the queue_lock you are fine, I
didn't check if this is the case for all your calls.
--
Jens Axboe
prev parent reply other threads:[~2004-10-22 10:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-15 19:01 scsi_debug issues Nishanth Aravamudan
2004-10-16 6:51 ` Douglas Gilbert
2004-10-16 10:50 ` Christoph Hellwig
2004-10-16 13:12 ` James Bottomley
2004-10-18 13:44 ` [PATCH] scsi_debug [was: scsi_debug issues] Douglas Gilbert
2004-10-18 18:37 ` Nishanth Aravamudan
2004-10-18 22:05 ` Douglas Gilbert
2004-10-18 23:23 ` Nishanth Aravamudan
2004-10-19 6:57 ` Douglas Gilbert
2004-10-21 21:36 ` Nishanth Aravamudan
2004-10-22 10:04 ` Jens Axboe
2004-10-22 10:02 ` Jens Axboe [this message]
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=20041022100212.GX1820@suse.de \
--to=axboe@suse.de \
--cc=James.Bottomley@SteelEye.com \
--cc=dougg@torque.net \
--cc=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nacc@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.