Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-24 Thread Jens Axboe
On Thu, May 24 2007, Badari Pulavarty wrote:
> On Thu, 2007-05-24 at 14:05 +0200, Jens Axboe wrote:
> > On Thu, May 24 2007, Jens Axboe wrote:
> > > > Oops: Kernel access of bad area, sig: 11 [#1]
> > > > SMP NR_CPUS=32 NUMA pSeries
> > > > Modules linked in: qla2xxx scsi_transport_fc
> > > > NIP: c00414a0 LR: c004162c CTR: 0001
> > > > REGS: c47bb130 TRAP: 0300   Not tainted  (2.6.22-rc1)
> > > > MSR: 80001032   CR: 2822  XER: 0008
> > > > DAR: , DSISR: 4000
> > > > TASK = c47a6aa0[0] 'swapper' THREAD: c47b8000 CPU: 7
> > > > GPR00: 0080 c47bb3b0 c0692358 
> > > > c47a6aa0
> > > > GPR04:  0070  
> > > > c05ac0b8
> > > > GPR08: e4b4 0001  
> > > > 0280
> > > > GPR12: 0020 c05a3e80  
> > > > 07a8dd70
> > > > GPR16:    
> > > > c47b8000
> > > > GPR20: 3b9aca00 c47a6c50 0001 
> > > > 
> > > > GPR24: d0909048 0001dee6d30c0d30 c3b7dd80 
> > > > c47a6aa0
> > > > GPR28: 0001079027ca c47a6aa0 c05b7cb0 
> > > > c0472c9c
> > > > NIP [c00414a0] .dequeue_task+0x0/0x9c
> > > > LR [c004162c] .deactivate_task+0x40/0x60
> > > > Call Trace:
> > > > [c47bb3b0] [c004bccc] .printk+0x38/0x48 (unreliable)
> > > > [c47bb440] [c0471704] .schedule+0x1fc/0x8dc
> > > > [c47bb540] [c0472c9c] .schedule_timeout+0xa8/0xe8
> > > > [c47bb610] [c0057260] .msleep+0x20/0x38
> > > > [c47bb690] [c003f5ec] .eeh_dn_check_failure+0x114/0x268
> > > > [c47bb740] [c003fc64] .eeh_check_failure+0xec/0x114
> > > > [c47bb7c0] [d086190c] .qla2300_fw_dump+0x1130/0x1c00 
> > > > [qla2xxx]
> > > > [c47bb8a0] [d0858d50] .qla2300_intr_handler+0x1e8/0x60c 
> > > > [qla2xxx]
> > > > [c47bb950] [c0078368] .handle_IRQ_event+0x70/0xe4
> > > > [c47bb9f0] [c007a7e0] .handle_fasteoi_irq+0x11c/0x1d0
> > > > [c47bba90] [c000c178] .do_IRQ+0x90/0xec
> > > > [c47bbb10] [c0004790] hardware_interrupt_entry+0x18/0x1c
> > > 
> > > Not good. The qla changes are non-trivial (that hardware has a really
> > > funky sg setup), so I may have botched a part of it. I'll review the
> > > qla changes and get back to you.
> > 
> > Does this help?
> > 
> > diff --git a/drivers/scsi/qla2xxx/qla_iocb.c 
> > b/drivers/scsi/qla2xxx/qla_iocb.c
> 
> Yes. It does. For now, I have no more complaints :)

Excellent! Let me know if you manage to run some performance numbers.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-24 Thread James Bottomley
On Fri, 2007-05-25 at 01:01 +0900, FUJITA Tomonori wrote:
> From: James Bottomley <[EMAIL PROTECTED]>
> Subject: Re: [PATCH] Chaining sg lists for big IO commands v5
> Date: Thu, 24 May 2007 10:39:44 -0500
> 
> > On Thu, 2007-05-24 at 21:44 +0900, FUJITA Tomonori wrote:
> > > (cc's added)
> > > 
> > > From: Jens Axboe <[EMAIL PROTECTED]>
> > > Subject: Re: [PATCH] Chaining sg lists for big IO commands v5
> > > Date: Thu, 24 May 2007 14:05:54 +0200
> > > 
> > > > On Thu, May 24 2007, Jens Axboe wrote:
> > > > > > http://git.kernel.org/?p=linux/kernel/git/tomo/linux-2.6-bidi.git;a=commitdiff;h=fb2747a9f2465ac4a1ea9e3533b92510fbcaae0c
> > > > > 
> > > > > Neat, will take a look! I should be able to just reuse that.
> > > > 
> > > > BTW, when do you plan on pushing the SCSI sg update? I'd love for it to
> > > > be soon, so I can just rebase the sglist branch on that and get rid of
> > > > the SCSI stuff in there.
> > > 
> > > Well, all I can say is that I'd love James to push the cleanups
> > > patchset soon too.
> > 
> > I'll put the accessor one into scsi-misc.  I'll try to get the other 40
> > reviewed via the scsi-pending tree that Mark Salyzyn suggested ... give
> > me some time on that.
> 
> Thanks. Do you want me to send the patches to scsi-ml or you directly
> get them via the git tree?

Either works ... but for 40 patches it was easier for me to fetch into a
git branch and cherry pick the two that can go into scsi-misc now.

I'm just correcting a compile warning on the 53c700 one, then I'll push.

James


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-24 Thread FUJITA Tomonori
From: James Bottomley <[EMAIL PROTECTED]>
Subject: Re: [PATCH] Chaining sg lists for big IO commands v5
Date: Thu, 24 May 2007 10:39:44 -0500

> On Thu, 2007-05-24 at 21:44 +0900, FUJITA Tomonori wrote:
> > (cc's added)
> > 
> > From: Jens Axboe <[EMAIL PROTECTED]>
> > Subject: Re: [PATCH] Chaining sg lists for big IO commands v5
> > Date: Thu, 24 May 2007 14:05:54 +0200
> > 
> > > On Thu, May 24 2007, Jens Axboe wrote:
> > > > > http://git.kernel.org/?p=linux/kernel/git/tomo/linux-2.6-bidi.git;a=commitdiff;h=fb2747a9f2465ac4a1ea9e3533b92510fbcaae0c
> > > > 
> > > > Neat, will take a look! I should be able to just reuse that.
> > > 
> > > BTW, when do you plan on pushing the SCSI sg update? I'd love for it to
> > > be soon, so I can just rebase the sglist branch on that and get rid of
> > > the SCSI stuff in there.
> > 
> > Well, all I can say is that I'd love James to push the cleanups
> > patchset soon too.
> 
> I'll put the accessor one into scsi-misc.  I'll try to get the other 40
> reviewed via the scsi-pending tree that Mark Salyzyn suggested ... give
> me some time on that.

Thanks. Do you want me to send the patches to scsi-ml or you directly
get them via the git tree?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-24 Thread James Bottomley
On Thu, 2007-05-24 at 21:44 +0900, FUJITA Tomonori wrote:
> (cc's added)
> 
> From: Jens Axboe <[EMAIL PROTECTED]>
> Subject: Re: [PATCH] Chaining sg lists for big IO commands v5
> Date: Thu, 24 May 2007 14:05:54 +0200
> 
> > On Thu, May 24 2007, Jens Axboe wrote:
> > > > http://git.kernel.org/?p=linux/kernel/git/tomo/linux-2.6-bidi.git;a=commitdiff;h=fb2747a9f2465ac4a1ea9e3533b92510fbcaae0c
> > > 
> > > Neat, will take a look! I should be able to just reuse that.
> > 
> > BTW, when do you plan on pushing the SCSI sg update? I'd love for it to
> > be soon, so I can just rebase the sglist branch on that and get rid of
> > the SCSI stuff in there.
> 
> Well, all I can say is that I'd love James to push the cleanups
> patchset soon too.

I'll put the accessor one into scsi-misc.  I'll try to get the other 40
reviewed via the scsi-pending tree that Mark Salyzyn suggested ... give
me some time on that.

James


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-24 Thread Badari Pulavarty
On Thu, 2007-05-24 at 14:05 +0200, Jens Axboe wrote:
> On Thu, May 24 2007, Jens Axboe wrote:
> > > Oops: Kernel access of bad area, sig: 11 [#1]
> > > SMP NR_CPUS=32 NUMA pSeries
> > > Modules linked in: qla2xxx scsi_transport_fc
> > > NIP: c00414a0 LR: c004162c CTR: 0001
> > > REGS: c47bb130 TRAP: 0300   Not tainted  (2.6.22-rc1)
> > > MSR: 80001032   CR: 2822  XER: 0008
> > > DAR: , DSISR: 4000
> > > TASK = c47a6aa0[0] 'swapper' THREAD: c47b8000 CPU: 7
> > > GPR00: 0080 c47bb3b0 c0692358 c47a6aa0
> > > GPR04:  0070  c05ac0b8
> > > GPR08: e4b4 0001  0280
> > > GPR12: 0020 c05a3e80  07a8dd70
> > > GPR16:    c47b8000
> > > GPR20: 3b9aca00 c47a6c50 0001 
> > > GPR24: d0909048 0001dee6d30c0d30 c3b7dd80 c47a6aa0
> > > GPR28: 0001079027ca c47a6aa0 c05b7cb0 c0472c9c
> > > NIP [c00414a0] .dequeue_task+0x0/0x9c
> > > LR [c004162c] .deactivate_task+0x40/0x60
> > > Call Trace:
> > > [c47bb3b0] [c004bccc] .printk+0x38/0x48 (unreliable)
> > > [c47bb440] [c0471704] .schedule+0x1fc/0x8dc
> > > [c47bb540] [c0472c9c] .schedule_timeout+0xa8/0xe8
> > > [c47bb610] [c0057260] .msleep+0x20/0x38
> > > [c47bb690] [c003f5ec] .eeh_dn_check_failure+0x114/0x268
> > > [c47bb740] [c003fc64] .eeh_check_failure+0xec/0x114
> > > [c47bb7c0] [d086190c] .qla2300_fw_dump+0x1130/0x1c00 
> > > [qla2xxx]
> > > [c47bb8a0] [d0858d50] .qla2300_intr_handler+0x1e8/0x60c 
> > > [qla2xxx]
> > > [c47bb950] [c0078368] .handle_IRQ_event+0x70/0xe4
> > > [c47bb9f0] [c007a7e0] .handle_fasteoi_irq+0x11c/0x1d0
> > > [c47bba90] [c000c178] .do_IRQ+0x90/0xec
> > > [c47bbb10] [c0004790] hardware_interrupt_entry+0x18/0x1c
> > 
> > Not good. The qla changes are non-trivial (that hardware has a really
> > funky sg setup), so I may have botched a part of it. I'll review the
> > qla changes and get back to you.
> 
> Does this help?
> 
> diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c

Yes. It does. For now, I have no more complaints :)

Thanks,
Badari



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-24 Thread Jens Axboe
On Thu, May 24 2007, FUJITA Tomonori wrote:
> (cc's added)
> 
> From: Jens Axboe <[EMAIL PROTECTED]>
> Subject: Re: [PATCH] Chaining sg lists for big IO commands v5
> Date: Thu, 24 May 2007 14:05:54 +0200
> 
> > On Thu, May 24 2007, Jens Axboe wrote:
> > > > http://git.kernel.org/?p=linux/kernel/git/tomo/linux-2.6-bidi.git;a=commitdiff;h=fb2747a9f2465ac4a1ea9e3533b92510fbcaae0c
> > > 
> > > Neat, will take a look! I should be able to just reuse that.
> > 
> > BTW, when do you plan on pushing the SCSI sg update? I'd love for it to
> > be soon, so I can just rebase the sglist branch on that and get rid of
> > the SCSI stuff in there.
> 
> Well, all I can say is that I'd love James to push the cleanups
> patchset soon too.

Cool, James?

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-24 Thread FUJITA Tomonori
(cc's added)

From: Jens Axboe <[EMAIL PROTECTED]>
Subject: Re: [PATCH] Chaining sg lists for big IO commands v5
Date: Thu, 24 May 2007 14:05:54 +0200

> On Thu, May 24 2007, Jens Axboe wrote:
> > > http://git.kernel.org/?p=linux/kernel/git/tomo/linux-2.6-bidi.git;a=commitdiff;h=fb2747a9f2465ac4a1ea9e3533b92510fbcaae0c
> > 
> > Neat, will take a look! I should be able to just reuse that.
> 
> BTW, when do you plan on pushing the SCSI sg update? I'd love for it to
> be soon, so I can just rebase the sglist branch on that and get rid of
> the SCSI stuff in there.

Well, all I can say is that I'd love James to push the cleanups
patchset soon too.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-24 Thread Jens Axboe
On Thu, May 24 2007, Jens Axboe wrote:
> > http://git.kernel.org/?p=linux/kernel/git/tomo/linux-2.6-bidi.git;a=commitdiff;h=fb2747a9f2465ac4a1ea9e3533b92510fbcaae0c
> 
> Neat, will take a look! I should be able to just reuse that.

BTW, when do you plan on pushing the SCSI sg update? I'd love for it to
be soon, so I can just rebase the sglist branch on that and get rid of
the SCSI stuff in there.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-24 Thread Jens Axboe
On Thu, May 24 2007, Jens Axboe wrote:
> > Oops: Kernel access of bad area, sig: 11 [#1]
> > SMP NR_CPUS=32 NUMA pSeries
> > Modules linked in: qla2xxx scsi_transport_fc
> > NIP: c00414a0 LR: c004162c CTR: 0001
> > REGS: c47bb130 TRAP: 0300   Not tainted  (2.6.22-rc1)
> > MSR: 80001032   CR: 2822  XER: 0008
> > DAR: , DSISR: 4000
> > TASK = c47a6aa0[0] 'swapper' THREAD: c47b8000 CPU: 7
> > GPR00: 0080 c47bb3b0 c0692358 c47a6aa0
> > GPR04:  0070  c05ac0b8
> > GPR08: e4b4 0001  0280
> > GPR12: 0020 c05a3e80  07a8dd70
> > GPR16:    c47b8000
> > GPR20: 3b9aca00 c47a6c50 0001 
> > GPR24: d0909048 0001dee6d30c0d30 c3b7dd80 c47a6aa0
> > GPR28: 0001079027ca c47a6aa0 c05b7cb0 c0472c9c
> > NIP [c00414a0] .dequeue_task+0x0/0x9c
> > LR [c004162c] .deactivate_task+0x40/0x60
> > Call Trace:
> > [c47bb3b0] [c004bccc] .printk+0x38/0x48 (unreliable)
> > [c47bb440] [c0471704] .schedule+0x1fc/0x8dc
> > [c47bb540] [c0472c9c] .schedule_timeout+0xa8/0xe8
> > [c47bb610] [c0057260] .msleep+0x20/0x38
> > [c47bb690] [c003f5ec] .eeh_dn_check_failure+0x114/0x268
> > [c47bb740] [c003fc64] .eeh_check_failure+0xec/0x114
> > [c47bb7c0] [d086190c] .qla2300_fw_dump+0x1130/0x1c00 
> > [qla2xxx]
> > [c47bb8a0] [d0858d50] .qla2300_intr_handler+0x1e8/0x60c 
> > [qla2xxx]
> > [c47bb950] [c0078368] .handle_IRQ_event+0x70/0xe4
> > [c47bb9f0] [c007a7e0] .handle_fasteoi_irq+0x11c/0x1d0
> > [c47bba90] [c000c178] .do_IRQ+0x90/0xec
> > [c47bbb10] [c0004790] hardware_interrupt_entry+0x18/0x1c
> 
> Not good. The qla changes are non-trivial (that hardware has a really
> funky sg setup), so I may have botched a part of it. I'll review the
> qla changes and get back to you.

Does this help?

diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 10251bf..5510b86 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -155,6 +155,8 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t 
*cmd_pkt,
uint32_t*cur_dsd;
scsi_qla_host_t *ha;
struct scsi_cmnd *cmd;
+   struct scatterlist *sg;
+   int i;
 
cmd = sp->cmd;
 
@@ -178,13 +180,10 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t 
*cmd_pkt,
 
/* Load data segments */
if (cmd->use_sg != 0) {
-   struct  scatterlist *cur_seg;
-   struct  scatterlist *end_seg;
-
-   cur_seg = (struct scatterlist *)cmd->request_buffer;
-   end_seg = cur_seg + tot_dsds;
-   while (cur_seg < end_seg) {
-   cont_entry_t*cont_pkt;
+   struct scatterlist *sgl = cmd->request_buffer;
+   
+   for_each_sg(sgl, sg, tot_dsds, i) {
+   cont_entry_t *cont_pkt;
 
/* Allocate additional continuation packets? */
if (avail_dsds == 0) {
@@ -197,11 +196,9 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t 
*cmd_pkt,
avail_dsds = 7;
}
 
-   *cur_dsd++ = cpu_to_le32(sg_dma_address(cur_seg));
-   *cur_dsd++ = cpu_to_le32(sg_dma_len(cur_seg));
+   *cur_dsd++ = cpu_to_le32(sg_dma_address(sg));
+   *cur_dsd++ = cpu_to_le32(sg_dma_len(sg));
avail_dsds--;
-
-   cur_seg++;
}
} else {
*cur_dsd++ = cpu_to_le32(sp->dma_handle);
@@ -224,6 +221,9 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t 
*cmd_pkt,
uint32_t*cur_dsd;
scsi_qla_host_t *ha;
struct scsi_cmnd *cmd;
+   struct scatterlist *sgl;
+   struct scatterlist *sg;
+   int i;
 
cmd = sp->cmd;
 
@@ -247,12 +247,8 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t 
*cmd_pkt,
 
/* Load data segments */
if (cmd->use_sg != 0) {
-   struct  scatterlist *cur_seg;
-   struct  scatterlist *end_seg;
-
-   cur_seg = (struct scatterlist *)cmd->request_buffer;
-   end_seg = cur_seg + tot_dsds;
-   while (cur_seg < end_seg) {
+   sgl = cmd->request_buffer;
+   for_each_sg(sgl, sg, tot_dsds, i) {
dma_addr_t  sle_dma;
cont_a64_entry_t *

Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-24 Thread FUJITA Tomonori
From: Jens Axboe <[EMAIL PROTECTED]>
Subject: Re: [PATCH] Chaining sg lists for big IO commands v5
Date: Thu, 24 May 2007 11:34:41 +0200

> On Tue, May 22 2007, Badari Pulavarty wrote:
> > > If iommu=off works, can you try a normal boot but with this applied on
> > > top of the sglist patches? That should fix gart mapping.
> > > 
> > > diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
> > > index 2e22a3a..b16384f 100644
> > > --- a/arch/x86_64/kernel/pci-gart.c
> > > +++ b/arch/x86_64/kernel/pci-gart.c
> > 
> > Yes. With this patch + kzalloc() for ide probe took care of all my
> > problems on x86-64.
> > 
> > But my ppc64 box is still sick :(
> 
> :-(
> 
> > Oops: Kernel access of bad area, sig: 11 [#1]
> > SMP NR_CPUS=32 NUMA pSeries
> > Modules linked in: qla2xxx scsi_transport_fc
> > NIP: c00414a0 LR: c004162c CTR: 0001
> > REGS: c47bb130 TRAP: 0300   Not tainted  (2.6.22-rc1)
> > MSR: 80001032   CR: 2822  XER: 0008
> > DAR: , DSISR: 4000
> > TASK = c47a6aa0[0] 'swapper' THREAD: c47b8000 CPU: 7
> > GPR00: 0080 c47bb3b0 c0692358 c47a6aa0
> > GPR04:  0070  c05ac0b8
> > GPR08: e4b4 0001  0280
> > GPR12: 0020 c05a3e80  07a8dd70
> > GPR16:    c47b8000
> > GPR20: 3b9aca00 c47a6c50 0001 
> > GPR24: d0909048 0001dee6d30c0d30 c3b7dd80 c47a6aa0
> > GPR28: 0001079027ca c47a6aa0 c05b7cb0 c0472c9c
> > NIP [c00414a0] .dequeue_task+0x0/0x9c
> > LR [c004162c] .deactivate_task+0x40/0x60
> > Call Trace:
> > [c47bb3b0] [c004bccc] .printk+0x38/0x48 (unreliable)
> > [c47bb440] [c0471704] .schedule+0x1fc/0x8dc
> > [c47bb540] [c0472c9c] .schedule_timeout+0xa8/0xe8
> > [c47bb610] [c0057260] .msleep+0x20/0x38
> > [c47bb690] [c003f5ec] .eeh_dn_check_failure+0x114/0x268
> > [c47bb740] [c003fc64] .eeh_check_failure+0xec/0x114
> > [c47bb7c0] [d086190c] .qla2300_fw_dump+0x1130/0x1c00 
> > [qla2xxx]
> > [c47bb8a0] [d0858d50] .qla2300_intr_handler+0x1e8/0x60c 
> > [qla2xxx]
> > [c47bb950] [c0078368] .handle_IRQ_event+0x70/0xe4
> > [c47bb9f0] [c007a7e0] .handle_fasteoi_irq+0x11c/0x1d0
> > [c47bba90] [c000c178] .do_IRQ+0x90/0xec
> > [c47bbb10] [c0004790] hardware_interrupt_entry+0x18/0x1c
> 
> Not good. The qla changes are non-trivial (that hardware has a really
> funky sg setup), so I may have botched a part of it. I'll review the
> qla changes and get back to you.

I guess that qla2xxx needs more for_each_sg macros. My qla2xxx cleanup
patch might help:

http://git.kernel.org/?p=linux/kernel/git/tomo/linux-2.6-bidi.git;a=commitdiff;h=fb2747a9f2465ac4a1ea9e3533b92510fbcaae0c
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-24 Thread Jens Axboe
On Thu, May 24 2007, FUJITA Tomonori wrote:
> From: Jens Axboe <[EMAIL PROTECTED]>
> Subject: Re: [PATCH] Chaining sg lists for big IO commands v5
> Date: Thu, 24 May 2007 11:34:41 +0200
> 
> > On Tue, May 22 2007, Badari Pulavarty wrote:
> > > > If iommu=off works, can you try a normal boot but with this applied on
> > > > top of the sglist patches? That should fix gart mapping.
> > > > 
> > > > diff --git a/arch/x86_64/kernel/pci-gart.c 
> > > > b/arch/x86_64/kernel/pci-gart.c
> > > > index 2e22a3a..b16384f 100644
> > > > --- a/arch/x86_64/kernel/pci-gart.c
> > > > +++ b/arch/x86_64/kernel/pci-gart.c
> > > 
> > > Yes. With this patch + kzalloc() for ide probe took care of all my
> > > problems on x86-64.
> > > 
> > > But my ppc64 box is still sick :(
> > 
> > :-(
> > 
> > > Oops: Kernel access of bad area, sig: 11 [#1]
> > > SMP NR_CPUS=32 NUMA pSeries
> > > Modules linked in: qla2xxx scsi_transport_fc
> > > NIP: c00414a0 LR: c004162c CTR: 0001
> > > REGS: c47bb130 TRAP: 0300   Not tainted  (2.6.22-rc1)
> > > MSR: 80001032   CR: 2822  XER: 0008
> > > DAR: , DSISR: 4000
> > > TASK = c47a6aa0[0] 'swapper' THREAD: c47b8000 CPU: 7
> > > GPR00: 0080 c47bb3b0 c0692358 c47a6aa0
> > > GPR04:  0070  c05ac0b8
> > > GPR08: e4b4 0001  0280
> > > GPR12: 0020 c05a3e80  07a8dd70
> > > GPR16:    c47b8000
> > > GPR20: 3b9aca00 c47a6c50 0001 
> > > GPR24: d0909048 0001dee6d30c0d30 c3b7dd80 c47a6aa0
> > > GPR28: 0001079027ca c47a6aa0 c05b7cb0 c0472c9c
> > > NIP [c00414a0] .dequeue_task+0x0/0x9c
> > > LR [c004162c] .deactivate_task+0x40/0x60
> > > Call Trace:
> > > [c47bb3b0] [c004bccc] .printk+0x38/0x48 (unreliable)
> > > [c47bb440] [c0471704] .schedule+0x1fc/0x8dc
> > > [c47bb540] [c0472c9c] .schedule_timeout+0xa8/0xe8
> > > [c47bb610] [c0057260] .msleep+0x20/0x38
> > > [c47bb690] [c003f5ec] .eeh_dn_check_failure+0x114/0x268
> > > [c47bb740] [c003fc64] .eeh_check_failure+0xec/0x114
> > > [c47bb7c0] [d086190c] .qla2300_fw_dump+0x1130/0x1c00 
> > > [qla2xxx]
> > > [c47bb8a0] [d0858d50] .qla2300_intr_handler+0x1e8/0x60c 
> > > [qla2xxx]
> > > [c47bb950] [c0078368] .handle_IRQ_event+0x70/0xe4
> > > [c47bb9f0] [c007a7e0] .handle_fasteoi_irq+0x11c/0x1d0
> > > [c47bba90] [c000c178] .do_IRQ+0x90/0xec
> > > [c47bbb10] [c0004790] hardware_interrupt_entry+0x18/0x1c
> > 
> > Not good. The qla changes are non-trivial (that hardware has a really
> > funky sg setup), so I may have botched a part of it. I'll review the
> > qla changes and get back to you.
> 
> I guess that qla2xxx needs more for_each_sg macros. My qla2xxx cleanup
> patch might help:
> 
> http://git.kernel.org/?p=linux/kernel/git/tomo/linux-2.6-bidi.git;a=commitdiff;h=fb2747a9f2465ac4a1ea9e3533b92510fbcaae0c

Neat, will take a look! I should be able to just reuse that.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-24 Thread Jens Axboe
On Tue, May 22 2007, Badari Pulavarty wrote:
> > If iommu=off works, can you try a normal boot but with this applied on
> > top of the sglist patches? That should fix gart mapping.
> > 
> > diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
> > index 2e22a3a..b16384f 100644
> > --- a/arch/x86_64/kernel/pci-gart.c
> > +++ b/arch/x86_64/kernel/pci-gart.c
> 
> Yes. With this patch + kzalloc() for ide probe took care of all my
> problems on x86-64.
> 
> But my ppc64 box is still sick :(

:-(

> Oops: Kernel access of bad area, sig: 11 [#1]
> SMP NR_CPUS=32 NUMA pSeries
> Modules linked in: qla2xxx scsi_transport_fc
> NIP: c00414a0 LR: c004162c CTR: 0001
> REGS: c47bb130 TRAP: 0300   Not tainted  (2.6.22-rc1)
> MSR: 80001032   CR: 2822  XER: 0008
> DAR: , DSISR: 4000
> TASK = c47a6aa0[0] 'swapper' THREAD: c47b8000 CPU: 7
> GPR00: 0080 c47bb3b0 c0692358 c47a6aa0
> GPR04:  0070  c05ac0b8
> GPR08: e4b4 0001  0280
> GPR12: 0020 c05a3e80  07a8dd70
> GPR16:    c47b8000
> GPR20: 3b9aca00 c47a6c50 0001 
> GPR24: d0909048 0001dee6d30c0d30 c3b7dd80 c47a6aa0
> GPR28: 0001079027ca c47a6aa0 c05b7cb0 c0472c9c
> NIP [c00414a0] .dequeue_task+0x0/0x9c
> LR [c004162c] .deactivate_task+0x40/0x60
> Call Trace:
> [c47bb3b0] [c004bccc] .printk+0x38/0x48 (unreliable)
> [c47bb440] [c0471704] .schedule+0x1fc/0x8dc
> [c47bb540] [c0472c9c] .schedule_timeout+0xa8/0xe8
> [c47bb610] [c0057260] .msleep+0x20/0x38
> [c47bb690] [c003f5ec] .eeh_dn_check_failure+0x114/0x268
> [c47bb740] [c003fc64] .eeh_check_failure+0xec/0x114
> [c47bb7c0] [d086190c] .qla2300_fw_dump+0x1130/0x1c00 [qla2xxx]
> [c47bb8a0] [d0858d50] .qla2300_intr_handler+0x1e8/0x60c 
> [qla2xxx]
> [c47bb950] [c0078368] .handle_IRQ_event+0x70/0xe4
> [c47bb9f0] [c007a7e0] .handle_fasteoi_irq+0x11c/0x1d0
> [c47bba90] [c000c178] .do_IRQ+0x90/0xec
> [c47bbb10] [c0004790] hardware_interrupt_entry+0x18/0x1c

Not good. The qla changes are non-trivial (that hardware has a really
funky sg setup), so I may have botched a part of it. I'll review the
qla changes and get back to you.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-22 Thread Badari Pulavarty
On Mon, 2007-05-21 at 08:35 +0200, Jens Axboe wrote:
> On Mon, May 21 2007, Jens Axboe wrote:
> > On Fri, May 18 2007, Badari Pulavarty wrote:
> > > On Fri, 2007-05-18 at 09:35 +0200, Jens Axboe wrote:
> > > > On Thu, May 17 2007, Badari Pulavarty wrote:
> > > > > On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
> > > > > > On Wed, May 16 2007, Badari Pulavarty wrote:
> > > > > > > On Tue, 2007-05-15 at 19:50 +0200, Jens Axboe wrote:
> > > > > > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > > > > > On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> > > > > > > > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > > > > > > > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > > > > > > > > > > Hi,
> > > > > > > > > > > > 
> > > > > > > > > > > > Updated version of the patch - this time I'll just 
> > > > > > > > > > > > attach the patch
> > > > > > > > > > > > file...
> > > > > > > > > > > 
> > > > > > > > > > > Missing scatterlist.h inclusions..
> > > > > > > > > > > 
> > > > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c: In function 
> > > > > > > > > > > ???sym_scatter???:
> > > > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: 
> > > > > > > > > > > implicit declaration
> > > > > > > > > > > of function ???for_each_sg???
> > > > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected 
> > > > > > > > > > > ???;??? before ???{???
> > > > > > > > > > > token
> > > > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused 
> > > > > > > > > > > variable ???tp???
> > > > > > > > > > > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c: In function 
> > > > > > > > > > > ???qla24xx_build_scsi_iocbs???:
> > > > > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit 
> > > > > > > > > > > declaration of
> > > > > > > > > > > function ???for_each_sg???
> > > > > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected 
> > > > > > > > > > > ???;??? before ???{???
> > > > > > > > > > > token
> > > > > > > > > > 
> > > > > > > > > > Thanks, will fix those. What arch? I tested it here.
> > > > > > > > > 
> > > > > > > > > I am playing with them on ppc64.
> > > > > > > > 
> > > > > > > > Ah ok, you need the updated patch series for ppc64 support. 
> > > > > > > > Builds fine
> > > > > > > > here on ppc64. See the #sglist branch of the block repo:
> > > > > > > > 
> > > > > > > > git://git.kernel.dk/data/git/linux-2.6-block.git
> > > > > > > > 
> > > > > > > > I can mail you an updated patch, if you want.
> > > > > > > 
> > > > > > > 
> > > > > > > Here is the whole panic stack..
> > > > > > 
> > > > > > Thanks will fix that up, the IDE part is totally untested. Can you 
> > > > > > try
> > > > > > and backout this patch and see if it boots?
> > > > > 
> > > > > I increased max_segments to 1024 on my qla2200 attached disks and
> > > > > simple "dd" (direct read) resulted in following:
> > > > > 
> > > > > elm3b29:/sys/block/sdd/queue # echo 1024 > max_segments
> > > > > elm3b29:/sys/block/sdd/queue # cat max_hw_sectors_kb > max_sectors_kb
> > > > > elm3b29:/mnt # dd iflag=direct if=./z of=/dev/null bs=512M
> > > > > 
> > > > > Unable to handle kernel paging request at 1008 RIP:
> > > > >  [] __rmqueue+0x6f/0x120
> > > > 
> > > > Auch, that's a bug. I don't think the oom path has been tested yet,
> > > > perhaps this is hitting it.
> > > > 
> > > > Can you try with this debug patch, plus enable the slab debugging
> > > > helpers (like poisoning)?
> > > > 
> > > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> > > > index 7456992..a479d1e 100644
> > > > --- a/drivers/scsi/scsi_lib.c
> > > > +++ b/drivers/scsi/scsi_lib.c
> > > > @@ -793,6 +793,7 @@ struct scatterlist *scsi_alloc_sgtable(struct 
> > > > scsi_cmnd *cmd, gfp_t gfp_mask)
> > > > return ret;
> > > >  enomem:
> > > > if (ret) {
> > > > +   printk(KERN_ERR "scsi: failed to allocate sg table\n");
> > > > /*
> > > >  * Free entries chained off ret. Since we were trying to
> > > >  * allocate another sglist, we know that all entries 
> > > > are of
> > > > 
> > > 
> > > Not much help. I get all kinds of weird panics.. This time I got (with
> > > the above debug).
> > > 
> > > general protection fault:  [1] SMP
> > > CPU 1
> > > Modules linked in: jfs sg sd_mod qla2xxx firmware_class
> > > scsi_transport_fc scsi_mod vfat fat ipv6 thermal processor fan button
> > > battery ac dm_mod floppy parport_pc lp parport
> > > Pid: 56, comm: kblockd/1 Not tainted 2.6.22-rc1-sg #8
> > > RIP: 0010:[]  [] kmem_cache_alloc
> > > +0x36/0x70
> > > RSP: 0018:81017abbfc10  EFLAGS: 00010002
> > > RAX:  RBX: 0082 RCX: 0664
> > > RDX: 81019ff2b8a0 RSI: 00011220 RDI: 8068d120
> > > RBP: 81017abbfc20

Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-22 Thread Badari Pulavarty
On Mon, 2007-05-21 at 08:14 +0200, Jens Axboe wrote:
> On Fri, May 18 2007, Badari Pulavarty wrote:
> > On Fri, 2007-05-18 at 09:35 +0200, Jens Axboe wrote:
> > > On Thu, May 17 2007, Badari Pulavarty wrote:
> > > > On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
> > > > > On Wed, May 16 2007, Badari Pulavarty wrote:
> > > > > > On Tue, 2007-05-15 at 19:50 +0200, Jens Axboe wrote:
> > > > > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > > > > On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> > > > > > > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > > > > > > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > > > > > > > > > Hi,
> > > > > > > > > > > 
> > > > > > > > > > > Updated version of the patch - this time I'll just attach 
> > > > > > > > > > > the patch
> > > > > > > > > > > file...
> > > > > > > > > > 
> > > > > > > > > > Missing scatterlist.h inclusions..
> > > > > > > > > > 
> > > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c: In function 
> > > > > > > > > > ???sym_scatter???:
> > > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit 
> > > > > > > > > > declaration
> > > > > > > > > > of function ???for_each_sg???
> > > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected 
> > > > > > > > > > ???;??? before ???{???
> > > > > > > > > > token
> > > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused 
> > > > > > > > > > variable ???tp???
> > > > > > > > > > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c: In function 
> > > > > > > > > > ???qla24xx_build_scsi_iocbs???:
> > > > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit 
> > > > > > > > > > declaration of
> > > > > > > > > > function ???for_each_sg???
> > > > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected 
> > > > > > > > > > ???;??? before ???{???
> > > > > > > > > > token
> > > > > > > > > 
> > > > > > > > > Thanks, will fix those. What arch? I tested it here.
> > > > > > > > 
> > > > > > > > I am playing with them on ppc64.
> > > > > > > 
> > > > > > > Ah ok, you need the updated patch series for ppc64 support. 
> > > > > > > Builds fine
> > > > > > > here on ppc64. See the #sglist branch of the block repo:
> > > > > > > 
> > > > > > > git://git.kernel.dk/data/git/linux-2.6-block.git
> > > > > > > 
> > > > > > > I can mail you an updated patch, if you want.
> > > > > > 
> > > > > > 
> > > > > > Here is the whole panic stack..
> > > > > 
> > > > > Thanks will fix that up, the IDE part is totally untested. Can you try
> > > > > and backout this patch and see if it boots?
> > > > 
> > > > I increased max_segments to 1024 on my qla2200 attached disks and
> > > > simple "dd" (direct read) resulted in following:
> > > > 
> > > > elm3b29:/sys/block/sdd/queue # echo 1024 > max_segments
> > > > elm3b29:/sys/block/sdd/queue # cat max_hw_sectors_kb > max_sectors_kb
> > > > elm3b29:/mnt # dd iflag=direct if=./z of=/dev/null bs=512M
> > > > 
> > > > Unable to handle kernel paging request at 1008 RIP:
> > > >  [] __rmqueue+0x6f/0x120
> > > 
> > > Auch, that's a bug. I don't think the oom path has been tested yet,
> > > perhaps this is hitting it.
> > > 
> > > Can you try with this debug patch, plus enable the slab debugging
> > > helpers (like poisoning)?
> > > 
> > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> > > index 7456992..a479d1e 100644
> > > --- a/drivers/scsi/scsi_lib.c
> > > +++ b/drivers/scsi/scsi_lib.c
> > > @@ -793,6 +793,7 @@ struct scatterlist *scsi_alloc_sgtable(struct 
> > > scsi_cmnd *cmd, gfp_t gfp_mask)
> > >   return ret;
> > >  enomem:
> > >   if (ret) {
> > > + printk(KERN_ERR "scsi: failed to allocate sg table\n");
> > >   /*
> > >* Free entries chained off ret. Since we were trying to
> > >* allocate another sglist, we know that all entries are of
> > > 
> > 
> > Not much help. I get all kinds of weird panics.. This time I got (with
> > the above debug).
> > 
> > general protection fault:  [1] SMP
> > CPU 1
> > Modules linked in: jfs sg sd_mod qla2xxx firmware_class
> > scsi_transport_fc scsi_mod vfat fat ipv6 thermal processor fan button
> > battery ac dm_mod floppy parport_pc lp parport
> > Pid: 56, comm: kblockd/1 Not tainted 2.6.22-rc1-sg #8
> > RIP: 0010:[]  [] kmem_cache_alloc
> > +0x36/0x70
> > RSP: 0018:81017abbfc10  EFLAGS: 00010002
> > RAX:  RBX: 0082 RCX: 0664
> > RDX: 81019ff2b8a0 RSI: 00011220 RDI: 8068d120
> > RBP: 81017abbfc20 R08: 39f8 R09: 
> > R10: 81019cbee700 R11: 0188 R12: 8101df2a64e0
> > R13: 00011220 R14: 8101df2a6510 R15: 81017abbfc50
> > FS:  2b505b027f20() GS:81018021f300()
> > knlGS:f7da26b0
> > CS:  0010 DS: 0018 ES: 0018 CR0: 

Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-21 Thread Benny Halevy
Jens Axboe wrote:
> On Mon, May 21 2007, Jens Axboe wrote:
>> On Fri, May 18 2007, Badari Pulavarty wrote:
>>> On Fri, 2007-05-18 at 09:35 +0200, Jens Axboe wrote:
 On Thu, May 17 2007, Badari Pulavarty wrote:
> On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
>> On Wed, May 16 2007, Badari Pulavarty wrote:
>>> On Tue, 2007-05-15 at 19:50 +0200, Jens Axboe wrote:
 On Tue, May 15 2007, Badari Pulavarty wrote:
> On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
>> On Tue, May 15 2007, Badari Pulavarty wrote:
>>> On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
 Hi,

 Updated version of the patch - this time I'll just attach the patch
 file...
>>> Missing scatterlist.h inclusions..
>>>
>>> drivers/scsi/sym53c8xx_2/sym_glue.c: In function ???sym_scatter???:
>>> drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit 
>>> declaration
>>> of function ???for_each_sg???
>>> drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected ???;??? 
>>> before ???{???
>>> token
>>> drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused variable 
>>> ???tp???
>>> make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
>>>
>>>
>>> drivers/scsi/qla2xxx/qla_iocb.c: In function 
>>> ???qla24xx_build_scsi_iocbs???:
>>> drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit declaration 
>>> of
>>> function ???for_each_sg???
>>> drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ???;??? before 
>>> ???{???
>>> token
>> Thanks, will fix those. What arch? I tested it here.
> I am playing with them on ppc64.
 Ah ok, you need the updated patch series for ppc64 support. Builds fine
 here on ppc64. See the #sglist branch of the block repo:

 git://git.kernel.dk/data/git/linux-2.6-block.git

 I can mail you an updated patch, if you want.
>>>
>>> Here is the whole panic stack..
>> Thanks will fix that up, the IDE part is totally untested. Can you try
>> and backout this patch and see if it boots?
> I increased max_segments to 1024 on my qla2200 attached disks and
> simple "dd" (direct read) resulted in following:
>
> elm3b29:/sys/block/sdd/queue # echo 1024 > max_segments
> elm3b29:/sys/block/sdd/queue # cat max_hw_sectors_kb > max_sectors_kb
> elm3b29:/mnt # dd iflag=direct if=./z of=/dev/null bs=512M
>
> Unable to handle kernel paging request at 1008 RIP:
>  [] __rmqueue+0x6f/0x120
 Auch, that's a bug. I don't think the oom path has been tested yet,
 perhaps this is hitting it.

 Can you try with this debug patch, plus enable the slab debugging
 helpers (like poisoning)?

 diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
 index 7456992..a479d1e 100644
 --- a/drivers/scsi/scsi_lib.c
 +++ b/drivers/scsi/scsi_lib.c
 @@ -793,6 +793,7 @@ struct scatterlist *scsi_alloc_sgtable(struct 
 scsi_cmnd *cmd, gfp_t gfp_mask)
return ret;
  enomem:
if (ret) {
 +  printk(KERN_ERR "scsi: failed to allocate sg table\n");
/*
 * Free entries chained off ret. Since we were trying to
 * allocate another sglist, we know that all entries are of

>>> Not much help. I get all kinds of weird panics.. This time I got (with
>>> the above debug).
>>>
>>> general protection fault:  [1] SMP
>>> CPU 1
>>> Modules linked in: jfs sg sd_mod qla2xxx firmware_class
>>> scsi_transport_fc scsi_mod vfat fat ipv6 thermal processor fan button
>>> battery ac dm_mod floppy parport_pc lp parport
>>> Pid: 56, comm: kblockd/1 Not tainted 2.6.22-rc1-sg #8
>>> RIP: 0010:[]  [] kmem_cache_alloc
>>> +0x36/0x70
>>> RSP: 0018:81017abbfc10  EFLAGS: 00010002
>>> RAX:  RBX: 0082 RCX: 0664
>>> RDX: 81019ff2b8a0 RSI: 00011220 RDI: 8068d120
>>> RBP: 81017abbfc20 R08: 39f8 R09: 
>>> R10: 81019cbee700 R11: 0188 R12: 8101df2a64e0
>>> R13: 00011220 R14: 8101df2a6510 R15: 81017abbfc50
>>> FS:  2b505b027f20() GS:81018021f300()
>>> knlGS:f7da26b0
>>> CS:  0010 DS: 0018 ES: 0018 CR0: 8005003b
>>> CR2: 2b505b029008 CR3: 00019af73000 CR4: 06e0
>>> Process kblockd/1 (pid: 56, threadinfo 81017abbe000, task
>>> 81017a571440)
>>> Stack:  7abbfc30  81017abbfc30
>>> 8025d001
>>>  81017abbfcb0 8025d122 81017abbfc60 80219dc0
>>>  880e5da6 00ad 81017abbfcd0 8021a366
>>> Call Trace:
>>>  [] mempool_alloc_slab+0x11/0x20
>>>  [] mempool_alloc+0x42/0x110
>>>  [] flush_gart+0x40/0x50

Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-20 Thread Jens Axboe
On Mon, May 21 2007, Jens Axboe wrote:
> On Fri, May 18 2007, Badari Pulavarty wrote:
> > On Fri, 2007-05-18 at 09:35 +0200, Jens Axboe wrote:
> > > On Thu, May 17 2007, Badari Pulavarty wrote:
> > > > On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
> > > > > On Wed, May 16 2007, Badari Pulavarty wrote:
> > > > > > On Tue, 2007-05-15 at 19:50 +0200, Jens Axboe wrote:
> > > > > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > > > > On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> > > > > > > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > > > > > > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > > > > > > > > > Hi,
> > > > > > > > > > > 
> > > > > > > > > > > Updated version of the patch - this time I'll just attach 
> > > > > > > > > > > the patch
> > > > > > > > > > > file...
> > > > > > > > > > 
> > > > > > > > > > Missing scatterlist.h inclusions..
> > > > > > > > > > 
> > > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c: In function 
> > > > > > > > > > ???sym_scatter???:
> > > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit 
> > > > > > > > > > declaration
> > > > > > > > > > of function ???for_each_sg???
> > > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected 
> > > > > > > > > > ???;??? before ???{???
> > > > > > > > > > token
> > > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused 
> > > > > > > > > > variable ???tp???
> > > > > > > > > > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c: In function 
> > > > > > > > > > ???qla24xx_build_scsi_iocbs???:
> > > > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit 
> > > > > > > > > > declaration of
> > > > > > > > > > function ???for_each_sg???
> > > > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected 
> > > > > > > > > > ???;??? before ???{???
> > > > > > > > > > token
> > > > > > > > > 
> > > > > > > > > Thanks, will fix those. What arch? I tested it here.
> > > > > > > > 
> > > > > > > > I am playing with them on ppc64.
> > > > > > > 
> > > > > > > Ah ok, you need the updated patch series for ppc64 support. 
> > > > > > > Builds fine
> > > > > > > here on ppc64. See the #sglist branch of the block repo:
> > > > > > > 
> > > > > > > git://git.kernel.dk/data/git/linux-2.6-block.git
> > > > > > > 
> > > > > > > I can mail you an updated patch, if you want.
> > > > > > 
> > > > > > 
> > > > > > Here is the whole panic stack..
> > > > > 
> > > > > Thanks will fix that up, the IDE part is totally untested. Can you try
> > > > > and backout this patch and see if it boots?
> > > > 
> > > > I increased max_segments to 1024 on my qla2200 attached disks and
> > > > simple "dd" (direct read) resulted in following:
> > > > 
> > > > elm3b29:/sys/block/sdd/queue # echo 1024 > max_segments
> > > > elm3b29:/sys/block/sdd/queue # cat max_hw_sectors_kb > max_sectors_kb
> > > > elm3b29:/mnt # dd iflag=direct if=./z of=/dev/null bs=512M
> > > > 
> > > > Unable to handle kernel paging request at 1008 RIP:
> > > >  [] __rmqueue+0x6f/0x120
> > > 
> > > Auch, that's a bug. I don't think the oom path has been tested yet,
> > > perhaps this is hitting it.
> > > 
> > > Can you try with this debug patch, plus enable the slab debugging
> > > helpers (like poisoning)?
> > > 
> > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> > > index 7456992..a479d1e 100644
> > > --- a/drivers/scsi/scsi_lib.c
> > > +++ b/drivers/scsi/scsi_lib.c
> > > @@ -793,6 +793,7 @@ struct scatterlist *scsi_alloc_sgtable(struct 
> > > scsi_cmnd *cmd, gfp_t gfp_mask)
> > >   return ret;
> > >  enomem:
> > >   if (ret) {
> > > + printk(KERN_ERR "scsi: failed to allocate sg table\n");
> > >   /*
> > >* Free entries chained off ret. Since we were trying to
> > >* allocate another sglist, we know that all entries are of
> > > 
> > 
> > Not much help. I get all kinds of weird panics.. This time I got (with
> > the above debug).
> > 
> > general protection fault:  [1] SMP
> > CPU 1
> > Modules linked in: jfs sg sd_mod qla2xxx firmware_class
> > scsi_transport_fc scsi_mod vfat fat ipv6 thermal processor fan button
> > battery ac dm_mod floppy parport_pc lp parport
> > Pid: 56, comm: kblockd/1 Not tainted 2.6.22-rc1-sg #8
> > RIP: 0010:[]  [] kmem_cache_alloc
> > +0x36/0x70
> > RSP: 0018:81017abbfc10  EFLAGS: 00010002
> > RAX:  RBX: 0082 RCX: 0664
> > RDX: 81019ff2b8a0 RSI: 00011220 RDI: 8068d120
> > RBP: 81017abbfc20 R08: 39f8 R09: 
> > R10: 81019cbee700 R11: 0188 R12: 8101df2a64e0
> > R13: 00011220 R14: 8101df2a6510 R15: 81017abbfc50
> > FS:  2b505b027f20() GS:81018021f300()
> > knlGS:f7da26b0
> > CS:  0010 DS: 0018 ES: 0018 CR0: 800500

Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-20 Thread Jens Axboe
On Fri, May 18 2007, Badari Pulavarty wrote:
> On Fri, 2007-05-18 at 09:35 +0200, Jens Axboe wrote:
> > On Thu, May 17 2007, Badari Pulavarty wrote:
> > > On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
> > > > On Wed, May 16 2007, Badari Pulavarty wrote:
> > > > > On Tue, 2007-05-15 at 19:50 +0200, Jens Axboe wrote:
> > > > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > > > On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> > > > > > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > > > > > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > > > > > > > > Hi,
> > > > > > > > > > 
> > > > > > > > > > Updated version of the patch - this time I'll just attach 
> > > > > > > > > > the patch
> > > > > > > > > > file...
> > > > > > > > > 
> > > > > > > > > Missing scatterlist.h inclusions..
> > > > > > > > > 
> > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c: In function 
> > > > > > > > > ???sym_scatter???:
> > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit 
> > > > > > > > > declaration
> > > > > > > > > of function ???for_each_sg???
> > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected 
> > > > > > > > > ???;??? before ???{???
> > > > > > > > > token
> > > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused 
> > > > > > > > > variable ???tp???
> > > > > > > > > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c: In function 
> > > > > > > > > ???qla24xx_build_scsi_iocbs???:
> > > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit 
> > > > > > > > > declaration of
> > > > > > > > > function ???for_each_sg???
> > > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ???;??? 
> > > > > > > > > before ???{???
> > > > > > > > > token
> > > > > > > > 
> > > > > > > > Thanks, will fix those. What arch? I tested it here.
> > > > > > > 
> > > > > > > I am playing with them on ppc64.
> > > > > > 
> > > > > > Ah ok, you need the updated patch series for ppc64 support. Builds 
> > > > > > fine
> > > > > > here on ppc64. See the #sglist branch of the block repo:
> > > > > > 
> > > > > > git://git.kernel.dk/data/git/linux-2.6-block.git
> > > > > > 
> > > > > > I can mail you an updated patch, if you want.
> > > > > 
> > > > > 
> > > > > Here is the whole panic stack..
> > > > 
> > > > Thanks will fix that up, the IDE part is totally untested. Can you try
> > > > and backout this patch and see if it boots?
> > > 
> > > I increased max_segments to 1024 on my qla2200 attached disks and
> > > simple "dd" (direct read) resulted in following:
> > > 
> > > elm3b29:/sys/block/sdd/queue # echo 1024 > max_segments
> > > elm3b29:/sys/block/sdd/queue # cat max_hw_sectors_kb > max_sectors_kb
> > > elm3b29:/mnt # dd iflag=direct if=./z of=/dev/null bs=512M
> > > 
> > > Unable to handle kernel paging request at 1008 RIP:
> > >  [] __rmqueue+0x6f/0x120
> > 
> > Auch, that's a bug. I don't think the oom path has been tested yet,
> > perhaps this is hitting it.
> > 
> > Can you try with this debug patch, plus enable the slab debugging
> > helpers (like poisoning)?
> > 
> > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> > index 7456992..a479d1e 100644
> > --- a/drivers/scsi/scsi_lib.c
> > +++ b/drivers/scsi/scsi_lib.c
> > @@ -793,6 +793,7 @@ struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd 
> > *cmd, gfp_t gfp_mask)
> > return ret;
> >  enomem:
> > if (ret) {
> > +   printk(KERN_ERR "scsi: failed to allocate sg table\n");
> > /*
> >  * Free entries chained off ret. Since we were trying to
> >  * allocate another sglist, we know that all entries are of
> > 
> 
> Not much help. I get all kinds of weird panics.. This time I got (with
> the above debug).
> 
> general protection fault:  [1] SMP
> CPU 1
> Modules linked in: jfs sg sd_mod qla2xxx firmware_class
> scsi_transport_fc scsi_mod vfat fat ipv6 thermal processor fan button
> battery ac dm_mod floppy parport_pc lp parport
> Pid: 56, comm: kblockd/1 Not tainted 2.6.22-rc1-sg #8
> RIP: 0010:[]  [] kmem_cache_alloc
> +0x36/0x70
> RSP: 0018:81017abbfc10  EFLAGS: 00010002
> RAX:  RBX: 0082 RCX: 0664
> RDX: 81019ff2b8a0 RSI: 00011220 RDI: 8068d120
> RBP: 81017abbfc20 R08: 39f8 R09: 
> R10: 81019cbee700 R11: 0188 R12: 8101df2a64e0
> R13: 00011220 R14: 8101df2a6510 R15: 81017abbfc50
> FS:  2b505b027f20() GS:81018021f300()
> knlGS:f7da26b0
> CS:  0010 DS: 0018 ES: 0018 CR0: 8005003b
> CR2: 2b505b029008 CR3: 00019af73000 CR4: 06e0
> Process kblockd/1 (pid: 56, threadinfo 81017abbe000, task
> 81017a571440)
> Stack:  7abbfc30  81017abbfc30
> 8025d001
>  810

Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-18 Thread Badari Pulavarty
On Fri, 2007-05-18 at 09:35 +0200, Jens Axboe wrote:
> On Thu, May 17 2007, Badari Pulavarty wrote:
> > On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
> > > On Wed, May 16 2007, Badari Pulavarty wrote:
> > > > On Tue, 2007-05-15 at 19:50 +0200, Jens Axboe wrote:
> > > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > > On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> > > > > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > > > > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > > > > > > > Hi,
> > > > > > > > > 
> > > > > > > > > Updated version of the patch - this time I'll just attach the 
> > > > > > > > > patch
> > > > > > > > > file...
> > > > > > > > 
> > > > > > > > Missing scatterlist.h inclusions..
> > > > > > > > 
> > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c: In function 
> > > > > > > > ???sym_scatter???:
> > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit 
> > > > > > > > declaration
> > > > > > > > of function ???for_each_sg???
> > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected 
> > > > > > > > ???;??? before ???{???
> > > > > > > > token
> > > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused 
> > > > > > > > variable ???tp???
> > > > > > > > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > > > > > > > 
> > > > > > > > 
> > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c: In function 
> > > > > > > > ???qla24xx_build_scsi_iocbs???:
> > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit 
> > > > > > > > declaration of
> > > > > > > > function ???for_each_sg???
> > > > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ???;??? 
> > > > > > > > before ???{???
> > > > > > > > token
> > > > > > > 
> > > > > > > Thanks, will fix those. What arch? I tested it here.
> > > > > > 
> > > > > > I am playing with them on ppc64.
> > > > > 
> > > > > Ah ok, you need the updated patch series for ppc64 support. Builds 
> > > > > fine
> > > > > here on ppc64. See the #sglist branch of the block repo:
> > > > > 
> > > > > git://git.kernel.dk/data/git/linux-2.6-block.git
> > > > > 
> > > > > I can mail you an updated patch, if you want.
> > > > 
> > > > 
> > > > Here is the whole panic stack..
> > > 
> > > Thanks will fix that up, the IDE part is totally untested. Can you try
> > > and backout this patch and see if it boots?
> > 
> > I increased max_segments to 1024 on my qla2200 attached disks and
> > simple "dd" (direct read) resulted in following:
> > 
> > elm3b29:/sys/block/sdd/queue # echo 1024 > max_segments
> > elm3b29:/sys/block/sdd/queue # cat max_hw_sectors_kb > max_sectors_kb
> > elm3b29:/mnt # dd iflag=direct if=./z of=/dev/null bs=512M
> > 
> > Unable to handle kernel paging request at 1008 RIP:
> >  [] __rmqueue+0x6f/0x120
> 
> Auch, that's a bug. I don't think the oom path has been tested yet,
> perhaps this is hitting it.
> 
> Can you try with this debug patch, plus enable the slab debugging
> helpers (like poisoning)?
> 
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index 7456992..a479d1e 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -793,6 +793,7 @@ struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd 
> *cmd, gfp_t gfp_mask)
>   return ret;
>  enomem:
>   if (ret) {
> + printk(KERN_ERR "scsi: failed to allocate sg table\n");
>   /*
>* Free entries chained off ret. Since we were trying to
>* allocate another sglist, we know that all entries are of
> 

Not much help. I get all kinds of weird panics.. This time I got (with
the above debug).

general protection fault:  [1] SMP
CPU 1
Modules linked in: jfs sg sd_mod qla2xxx firmware_class
scsi_transport_fc scsi_mod vfat fat ipv6 thermal processor fan button
battery ac dm_mod floppy parport_pc lp parport
Pid: 56, comm: kblockd/1 Not tainted 2.6.22-rc1-sg #8
RIP: 0010:[]  [] kmem_cache_alloc
+0x36/0x70
RSP: 0018:81017abbfc10  EFLAGS: 00010002
RAX:  RBX: 0082 RCX: 0664
RDX: 81019ff2b8a0 RSI: 00011220 RDI: 8068d120
RBP: 81017abbfc20 R08: 39f8 R09: 
R10: 81019cbee700 R11: 0188 R12: 8101df2a64e0
R13: 00011220 R14: 8101df2a6510 R15: 81017abbfc50
FS:  2b505b027f20() GS:81018021f300()
knlGS:f7da26b0
CS:  0010 DS: 0018 ES: 0018 CR0: 8005003b
CR2: 2b505b029008 CR3: 00019af73000 CR4: 06e0
Process kblockd/1 (pid: 56, threadinfo 81017abbe000, task
81017a571440)
Stack:  7abbfc30  81017abbfc30
8025d001
 81017abbfcb0 8025d122 81017abbfc60 80219dc0
 880e5da6 00ad 81017abbfcd0 8021a366
Call Trace:
 [] mempool_alloc_slab+0x11/0x20
 [] mempool_alloc+0x42/0x110
 [] flush_gart+0x40/0x50
 [] :scsi_mod:__scsi_get_command

Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-18 Thread Badari Pulavarty
On Fri, 2007-05-18 at 19:03 +0200, Jens Axboe wrote:
> On Fri, May 18 2007, Badari Pulavarty wrote:
> > On Fri, 2007-05-18 at 09:33 +0200, Jens Axboe wrote:
> > > On Thu, May 17 2007, Badari Pulavarty wrote:
> > > > On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
> > > > .. 
> > > > > > > 
> > > > > > > Ah ok, you need the updated patch series for ppc64 support. 
> > > > > > > Builds fine
> > > > > > > here on ppc64. See the #sglist branch of the block repo:
> > > > > > > 
> > > > > > > git://git.kernel.dk/data/git/linux-2.6-block.git
> > > > > > > 
> > > > > > > I can mail you an updated patch, if you want.
> > > > > > 
> > > > > > 
> > > > > > Here is the whole panic stack..
> > > > > 
> > > > > Thanks will fix that up, the IDE part is totally untested. Can you try
> > > > > and backout this patch and see if it boots?
> > > > 
> > > > Yes. It boots fine with following backed out.
> > > > 
> > > > Looking at the code ide_probe.c: hwif_init() is doing
> > > > 
> > > > hwif->sg_table = kmalloc(sizeof(struct 
> > > > scatterlist)*hwif->sg_max_nents,
> > > >  GFP_KERNEL);
> > > > 
> > > > blk_rq_map_sg() is looking for the chaining info and going over end of 
> > > > the
> > > > allocation.
> > > 
> > > Hmm, looks ok, I'm guessing it's just missing a memset (or just turn it
> > > into a kzalloc())?
> > > 
> > 
> > Even with backing out all the ide changes, I get this on boot
> > once in a while.
> 
> Yep, I think the ide changes are fine as such, the problem is the
> missing memset/kzalloc. Can you try that?

kzalloc() made it better. I haven't seen ide panics anymore. I will try
it again after applying ide patches.

Thanks
Badari


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-18 Thread Jens Axboe
On Fri, May 18 2007, Badari Pulavarty wrote:
> On Fri, 2007-05-18 at 09:33 +0200, Jens Axboe wrote:
> > On Thu, May 17 2007, Badari Pulavarty wrote:
> > > On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
> > > .. 
> > > > > > 
> > > > > > Ah ok, you need the updated patch series for ppc64 support. Builds 
> > > > > > fine
> > > > > > here on ppc64. See the #sglist branch of the block repo:
> > > > > > 
> > > > > > git://git.kernel.dk/data/git/linux-2.6-block.git
> > > > > > 
> > > > > > I can mail you an updated patch, if you want.
> > > > > 
> > > > > 
> > > > > Here is the whole panic stack..
> > > > 
> > > > Thanks will fix that up, the IDE part is totally untested. Can you try
> > > > and backout this patch and see if it boots?
> > > 
> > > Yes. It boots fine with following backed out.
> > > 
> > > Looking at the code ide_probe.c: hwif_init() is doing
> > > 
> > > hwif->sg_table = kmalloc(sizeof(struct 
> > > scatterlist)*hwif->sg_max_nents,
> > >  GFP_KERNEL);
> > > 
> > > blk_rq_map_sg() is looking for the chaining info and going over end of the
> > > allocation.
> > 
> > Hmm, looks ok, I'm guessing it's just missing a memset (or just turn it
> > into a kzalloc())?
> > 
> 
> Even with backing out all the ide changes, I get this on boot
> once in a while.

Yep, I think the ide changes are fine as such, the problem is the
missing memset/kzalloc. Can you try that?

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-18 Thread Badari Pulavarty
On Fri, 2007-05-18 at 09:33 +0200, Jens Axboe wrote:
> On Thu, May 17 2007, Badari Pulavarty wrote:
> > On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
> > .. 
> > > > > 
> > > > > Ah ok, you need the updated patch series for ppc64 support. Builds 
> > > > > fine
> > > > > here on ppc64. See the #sglist branch of the block repo:
> > > > > 
> > > > > git://git.kernel.dk/data/git/linux-2.6-block.git
> > > > > 
> > > > > I can mail you an updated patch, if you want.
> > > > 
> > > > 
> > > > Here is the whole panic stack..
> > > 
> > > Thanks will fix that up, the IDE part is totally untested. Can you try
> > > and backout this patch and see if it boots?
> > 
> > Yes. It boots fine with following backed out.
> > 
> > Looking at the code ide_probe.c: hwif_init() is doing
> > 
> > hwif->sg_table = kmalloc(sizeof(struct 
> > scatterlist)*hwif->sg_max_nents,
> >  GFP_KERNEL);
> > 
> > blk_rq_map_sg() is looking for the chaining info and going over end of the
> > allocation.
> 
> Hmm, looks ok, I'm guessing it's just missing a memset (or just turn it
> into a kzalloc())?
> 

Even with backing out all the ide changes, I get this on boot
once in a while.

Thanks,
Badari

ReiserFS: hda2: checking transaction log (hda2)
Unable to handle kernel paging request at 005e5e66 RIP:
 [] blk_rq_map_sg+0x71/0x1b0
PGD 0
Oops:  [1] SMP
CPU 3
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.22-rc1-sg #7
RIP: 0010:[]  [] blk_rq_map_sg
+0x71/0x1b0
RSP: :8101a024fcc8  EFLAGS: 00010287
RAX: 0001df33e000 RBX: 8101df2b5f70 RCX: 00019f352000
RDX:  RSI: 8101df228300 RDI: 001df33e
RBP: 8101a024fd28 R08: 04e2 R09: 
R10: 007f R11: 0001 R12: 005e5e46
R13: 1000 R14:  R15: 8101df2b5f60
FS:  () GS:8101c021f300()
knlGS:
CS:  0010 DS: 0018 ES: 0018 CR0: 8005003b
CR2: 005e5e66 CR3: 00201000 CR4: 06e0
Process swapper (pid: 1, threadinfo 8101a0238000, task
810180238000)
Stack:  0003 810179c58000 00019f352000
810179c562c0
 8101df228e80 00170082 01ff81010001 8101df3207a8
 8078a500 810179c56000 8078a500 8101df3207a8
Call Trace:
   [] ide_map_sg+0x42/0xd0
 [] ide_build_sglist+0x2a/0x90
 [] ide_build_dmatable+0x2f/0x180
 [] ide_dma_setup+0x44/0xe0
 [] ide_do_rw_disk+0x349/0x510
 [] ide_do_request+0x622/0xb40
 [] ide_end_request+0x9d/0x160
 [] ide_dma_intr+0x0/0xd0
 [] ide_dma_intr+0x0/0xd0
 [] ide_intr+0x23f/0x250
 [] handle_IRQ_event+0x35/0x70
 [] handle_edge_irq+0xcc/0x150
 [] do_IRQ+0x80/0x100
 [] ret_from_intr+0x0/0xa
   [] kmem_cache_alloc+0x40/0x70
 [] mempool_alloc_slab+0x11/0x20
 [] mempool_alloc+0x42/0x110
 [] generic_make_request+0x198/0x240
 [] bio_alloc_bioset+0x2e/0x120
 [] bio_alloc+0x10/0x20
 [] submit_bh+0x6b/0x140
 [] ll_rw_block+0xd0/0xe0
 [] journal_read+0xb5e/0xec0
 [] zone_statistics+0x61/0xa0
 [] get_page_from_freelist+0x3c8/0x510
 [] __alloc_pages+0x6e/0x330
 [] alloc_page_interleave+0x8d/0xa0
 [] alloc_pages_current+0x86/0x90
 [] get_zeroed_page+0x20/0x40
 [] __pte_alloc_kernel+0x64/0x80
 [] map_vm_area+0x1dc/0x2e0
 [] __vmalloc_area_node+0x157/0x1a0
 [] journal_init+0x819/0x990
 [] __vmalloc_area_node+0x157/0x1a0
 [] __vmalloc_node+0x6f/0x80
 [] __vmalloc+0xe/0x10
 [] reiserfs_fill_super+0x2ba/0xc20
 [] vsnprintf+0x2e7/0x680
 [] snprintf+0x59/0x60
 [] __down_write_nested+0x17/0xc0
 [] strlcpy+0x4f/0x70
 [] test_bdev_super+0x0/0x20
 [] get_sb_bdev+0x13c/0x170
 [] reiserfs_fill_super+0x0/0xc20
 [] get_super_block+0x13/0x20
 [] vfs_kern_mount+0xd8/0x160
 [] do_kern_mount+0x4e/0x100
 [] do_mount+0x4e2/0x790
 [] __d_lookup+0x9c/0x130
 [] do_lookup+0x84/0x200
 [] do_lookup+0x84/0x200
 [] dput+0x24/0x140
 [] __link_path_walk+0x469/0xec0
 [] zone_statistics+0x7d/0xa0
 [] __alloc_pages+0x6e/0x330
 [] alloc_page_interleave+0x8d/0xa0
 [] alloc_pages_current+0x86/0x90
 [] __get_free_pages+0x1b/0x40
 [] copy_mount_options+0x52/0x180
 [] sys_mount+0x94/0xf0
 [] do_mount_root+0x21/0xa0
 [] mount_block_root+0x90/0x220
 [] sys_rmdir+0x11/0x20
 [] mount_root+0xe6/0xf0
 [] prepare_namespace+0xad/0x160
 [] kernel_init+0x23a/0x330
 [] child_rip+0xa/0x12
 [] kernel_init+0x0/0x330
 [] child_rip+0x0/0x12


Code: 49 8b 44 24 20 49 8d 4c 24 20 48 89 c2 48 83 e2 fe a8 01 48
RIP  [] blk_rq_map_sg+0x71/0x1b0
 RSP 
CR2: 005e5e66


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-18 Thread Jens Axboe
On Thu, May 17 2007, Badari Pulavarty wrote:
> On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
> > On Wed, May 16 2007, Badari Pulavarty wrote:
> > > On Tue, 2007-05-15 at 19:50 +0200, Jens Axboe wrote:
> > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> > > > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > > > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > > > > > > Hi,
> > > > > > > > 
> > > > > > > > Updated version of the patch - this time I'll just attach the 
> > > > > > > > patch
> > > > > > > > file...
> > > > > > > 
> > > > > > > Missing scatterlist.h inclusions..
> > > > > > > 
> > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c: In function 
> > > > > > > ???sym_scatter???:
> > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit 
> > > > > > > declaration
> > > > > > > of function ???for_each_sg???
> > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected ???;??? 
> > > > > > > before ???{???
> > > > > > > token
> > > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused variable 
> > > > > > > ???tp???
> > > > > > > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > > > > > > 
> > > > > > > 
> > > > > > > drivers/scsi/qla2xxx/qla_iocb.c: In function 
> > > > > > > ???qla24xx_build_scsi_iocbs???:
> > > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit 
> > > > > > > declaration of
> > > > > > > function ???for_each_sg???
> > > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ???;??? 
> > > > > > > before ???{???
> > > > > > > token
> > > > > > 
> > > > > > Thanks, will fix those. What arch? I tested it here.
> > > > > 
> > > > > I am playing with them on ppc64.
> > > > 
> > > > Ah ok, you need the updated patch series for ppc64 support. Builds fine
> > > > here on ppc64. See the #sglist branch of the block repo:
> > > > 
> > > > git://git.kernel.dk/data/git/linux-2.6-block.git
> > > > 
> > > > I can mail you an updated patch, if you want.
> > > 
> > > 
> > > Here is the whole panic stack..
> > 
> > Thanks will fix that up, the IDE part is totally untested. Can you try
> > and backout this patch and see if it boots?
> 
> I increased max_segments to 1024 on my qla2200 attached disks and
> simple "dd" (direct read) resulted in following:
> 
> elm3b29:/sys/block/sdd/queue # echo 1024 > max_segments
> elm3b29:/sys/block/sdd/queue # cat max_hw_sectors_kb > max_sectors_kb
> elm3b29:/mnt # dd iflag=direct if=./z of=/dev/null bs=512M
> 
> Unable to handle kernel paging request at 1008 RIP:
>  [] __rmqueue+0x6f/0x120

Auch, that's a bug. I don't think the oom path has been tested yet,
perhaps this is hitting it.

Can you try with this debug patch, plus enable the slab debugging
helpers (like poisoning)?

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 7456992..a479d1e 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -793,6 +793,7 @@ struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd 
*cmd, gfp_t gfp_mask)
return ret;
 enomem:
if (ret) {
+   printk(KERN_ERR "scsi: failed to allocate sg table\n");
/*
 * Free entries chained off ret. Since we were trying to
 * allocate another sglist, we know that all entries are of

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-18 Thread Jens Axboe
On Thu, May 17 2007, Badari Pulavarty wrote:
> On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
> .. 
> > > > 
> > > > Ah ok, you need the updated patch series for ppc64 support. Builds fine
> > > > here on ppc64. See the #sglist branch of the block repo:
> > > > 
> > > > git://git.kernel.dk/data/git/linux-2.6-block.git
> > > > 
> > > > I can mail you an updated patch, if you want.
> > > 
> > > 
> > > Here is the whole panic stack..
> > 
> > Thanks will fix that up, the IDE part is totally untested. Can you try
> > and backout this patch and see if it boots?
> 
> Yes. It boots fine with following backed out.
> 
> Looking at the code ide_probe.c: hwif_init() is doing
> 
> hwif->sg_table = kmalloc(sizeof(struct 
> scatterlist)*hwif->sg_max_nents,
>  GFP_KERNEL);
> 
> blk_rq_map_sg() is looking for the chaining info and going over end of the
> allocation.

Hmm, looks ok, I'm guessing it's just missing a memset (or just turn it
into a kzalloc())?

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-17 Thread Badari Pulavarty
On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
> On Wed, May 16 2007, Badari Pulavarty wrote:
> > On Tue, 2007-05-15 at 19:50 +0200, Jens Axboe wrote:
> > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> > > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > > > > > Hi,
> > > > > > > 
> > > > > > > Updated version of the patch - this time I'll just attach the 
> > > > > > > patch
> > > > > > > file...
> > > > > > 
> > > > > > Missing scatterlist.h inclusions..
> > > > > > 
> > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c: In function ???sym_scatter???:
> > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit 
> > > > > > declaration
> > > > > > of function ???for_each_sg???
> > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected ???;??? 
> > > > > > before ???{???
> > > > > > token
> > > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused variable 
> > > > > > ???tp???
> > > > > > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > > > > > 
> > > > > > 
> > > > > > drivers/scsi/qla2xxx/qla_iocb.c: In function 
> > > > > > ???qla24xx_build_scsi_iocbs???:
> > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit declaration 
> > > > > > of
> > > > > > function ???for_each_sg???
> > > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ???;??? before 
> > > > > > ???{???
> > > > > > token
> > > > > 
> > > > > Thanks, will fix those. What arch? I tested it here.
> > > > 
> > > > I am playing with them on ppc64.
> > > 
> > > Ah ok, you need the updated patch series for ppc64 support. Builds fine
> > > here on ppc64. See the #sglist branch of the block repo:
> > > 
> > > git://git.kernel.dk/data/git/linux-2.6-block.git
> > > 
> > > I can mail you an updated patch, if you want.
> > 
> > 
> > Here is the whole panic stack..
> 
> Thanks will fix that up, the IDE part is totally untested. Can you try
> and backout this patch and see if it boots?

I increased max_segments to 1024 on my qla2200 attached disks and
simple "dd" (direct read) resulted in following:

elm3b29:/sys/block/sdd/queue # echo 1024 > max_segments
elm3b29:/sys/block/sdd/queue # cat max_hw_sectors_kb > max_sectors_kb
elm3b29:/mnt # dd iflag=direct if=./z of=/dev/null bs=512M

Unable to handle kernel paging request at 1008 RIP:
 [] __rmqueue+0x6f/0x120
PGD 100921067 PUD 1057f9067 PMD 0
Oops: 0002 [1] SMP
CPU 0
Modules linked in: jfs hfs vfat fat sg sd_mod qla2xxx firmware_class
scsi_transport_fc scsi_mod ipv6 thermal processor fan button battery ac
dm_mod floppy parport_pc lp parport
Pid: 4329, comm: dd Tainted: G   M   2.6.22-rc1 #4
RIP: 0010:[]  [] __rmqueue
+0x6f/0x120
RSP: 0018:8101bdcab948  EFLAGS: 00010093
RAX: 81017e644148 RBX: 0002 RCX: 1000
RDX: 81011c80 RSI:  RDI: 81011a00
RBP: 8101bdcab968 R08: 81017a801142 R09: 
R10: 00078e7a R11: 0002 R12: 81011c80
R13:  R14: 81017e644120 R15: 81011a00
FS:  2b53c78cef20() GS:8063b000()
knlGS:
CS:  0010 DS:  ES:  CR0: 8005003b
CR2: 1008 CR3: 000102707000 CR4: 06e0
Process dd (pid: 4329, threadinfo 8101bdcaa000, task
8101bf4ff440)
Stack:  81017a801110 0012 0012
81017a801100
 8101bdcaba08 8025f47d 0001 81012e68
 00445f7ebe38 81012e60 000280d2 81012e68
Call Trace:
 [] get_page_from_freelist+0x31d/0x510
 [] __alloc_pages+0x6e/0x330
 [] alloc_page_vma+0x4a/0xa0
 [] __handle_mm_fault+0x9b7/0xba0
 [] follow_page+0x1b6/0x250
 [] get_user_pages+0x10c/0x3d0
 [] bio_add_page+0x2e/0x30
 [] dio_get_page+0xbb/0x1b0
 [] __blockdev_direct_IO+0x478/0xc20
 [] :jfs:jfs_direct_IO+0x50/0x60
 [] :jfs:jfs_get_block+0x0/0x230
 [] generic_file_direct_IO+0x73/0x150
 [] generic_file_aio_read+0x131/0x170
 [] page_add_new_anon_rmap+0x10/0x20
 [] __handle_mm_fault+0xa67/0xba0
 [] do_sync_read+0xf1/0x130
 [] up_read+0x9/0x10
 [] autoremove_wake_function+0x0/0x40
 [] __up_write+0xd0/0x130
 [] vfs_read+0xe1/0x190
 [] sys_read+0x50/0x90
 [] system_call+0x7e/0x83


Code: 48 89 51 08 48 89 0a 48 c7 40 08 00 02 20 00 48 c7 00 00 01
RIP  [] __rmqueue+0x6f/0x120
 RSP 
CR2: 1008
Unable to handle kernel paging request<0>Eeek! page_mapcount(page) went
negative! (-1)
  page pfn = 10a738
  page->flags = 14
  page->count = 80287910
  page->mapping = 
  vma->vm_ops = _stext+0x7fdf9000/0x60
 at 2018 RIP:
 [] task_rq_lock+0x35/0x90
PGD 0
Oops:  [2] SMP
CPU 2
Modules linked in: jfs hfs vfat fat sg sd_mod qla2xxx firmware_class
scsi_transport_fc scsi_mod ipv6 thermal processor fan button battery ac
dm_mod floppy parport_pc lp parport
Pid: 0, comm: swapper Tainted: G   M   2.6.22-rc1 #4

Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-17 Thread Badari Pulavarty
On Thu, 2007-05-17 at 08:27 +0200, Jens Axboe wrote:
.. 
> > > 
> > > Ah ok, you need the updated patch series for ppc64 support. Builds fine
> > > here on ppc64. See the #sglist branch of the block repo:
> > > 
> > > git://git.kernel.dk/data/git/linux-2.6-block.git
> > > 
> > > I can mail you an updated patch, if you want.
> > 
> > 
> > Here is the whole panic stack..
> 
> Thanks will fix that up, the IDE part is totally untested. Can you try
> and backout this patch and see if it boots?

Yes. It boots fine with following backed out.

Looking at the code ide_probe.c: hwif_init() is doing

hwif->sg_table = kmalloc(sizeof(struct scatterlist)*hwif->sg_max_nents,
 GFP_KERNEL);

blk_rq_map_sg() is looking for the chaining info and going over end of the
allocation.


Thanks,
Badari



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-16 Thread Jens Axboe
On Wed, May 16 2007, Badari Pulavarty wrote:
> On Tue, 2007-05-15 at 19:50 +0200, Jens Axboe wrote:
> > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> > > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > > > > Hi,
> > > > > > 
> > > > > > Updated version of the patch - this time I'll just attach the patch
> > > > > > file...
> > > > > 
> > > > > Missing scatterlist.h inclusions..
> > > > > 
> > > > > drivers/scsi/sym53c8xx_2/sym_glue.c: In function ???sym_scatter???:
> > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit declaration
> > > > > of function ???for_each_sg???
> > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected ???;??? 
> > > > > before ???{???
> > > > > token
> > > > > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused variable 
> > > > > ???tp???
> > > > > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > > > > 
> > > > > 
> > > > > drivers/scsi/qla2xxx/qla_iocb.c: In function 
> > > > > ???qla24xx_build_scsi_iocbs???:
> > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit declaration of
> > > > > function ???for_each_sg???
> > > > > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ???;??? before 
> > > > > ???{???
> > > > > token
> > > > 
> > > > Thanks, will fix those. What arch? I tested it here.
> > > 
> > > I am playing with them on ppc64.
> > 
> > Ah ok, you need the updated patch series for ppc64 support. Builds fine
> > here on ppc64. See the #sglist branch of the block repo:
> > 
> > git://git.kernel.dk/data/git/linux-2.6-block.git
> > 
> > I can mail you an updated patch, if you want.
> 
> 
> Here is the whole panic stack..

Thanks will fix that up, the IDE part is totally untested. Can you try
and backout this patch and see if it boots?

diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index ca0341c..3565c76 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -951,7 +951,8 @@ static int cris_ide_build_dmatable (ide_drive_t *drive)
/* group sequential buffers into one large buffer */
addr = page_to_phys(sg->page) + sg->offset;
size = sg_dma_len(sg);
-   while (sg++, --i) {
+   while (--i) {
+   sg = sg_next(sg);
if ((addr + size) != page_to_phys(sg->page) + 
sg->offset)
break;
size += sg_dma_len(sg);
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index b77b7d1..aa13309 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -292,7 +292,7 @@ int ide_build_dmatable (ide_drive_t *drive, struct request 
*rq)
}
}
 
-   sg++;
+   sg = sg_next(sg);
i--;
}
 
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 30175c7..412ba5e 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -259,6 +259,7 @@ static void ide_pio_sector(ide_drive_t *drive, unsigned int 
write)
 {
ide_hwif_t *hwif = drive->hwif;
struct scatterlist *sg = hwif->sg_table;
+   struct scatterlist *cursg = hwif->cursg;
struct page *page;
 #ifdef CONFIG_HIGHMEM
unsigned long flags;
@@ -266,8 +267,14 @@ static void ide_pio_sector(ide_drive_t *drive, unsigned 
int write)
unsigned int offset;
u8 *buf;
 
-   page = sg[hwif->cursg].page;
-   offset = sg[hwif->cursg].offset + hwif->cursg_ofs * SECTOR_SIZE;
+   cursg = hwif->cursg;
+   if (!cursg) {
+   cursg = sg;
+   hwif->cursg = sg;
+   }
+
+   page = cursg->page;
+   offset = cursg->offset + hwif->cursg_ofs * SECTOR_SIZE;
 
/* get the current page and offset */
page = nth_page(page, (offset >> PAGE_SHIFT));
@@ -281,8 +288,8 @@ static void ide_pio_sector(ide_drive_t *drive, unsigned int 
write)
hwif->nleft--;
hwif->cursg_ofs++;
 
-   if ((hwif->cursg_ofs * SECTOR_SIZE) == sg[hwif->cursg].length) {
-   hwif->cursg++;
+   if ((hwif->cursg_ofs * SECTOR_SIZE) == cursg->length) {
+   hwif->cursg = sg_next(hwif->cursg);
hwif->cursg_ofs = 0;
}
 
@@ -363,6 +370,8 @@ static ide_startstop_t task_error(ide_drive_t *drive, 
struct request *rq,
 
 static void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat)
 {
+   HWIF(drive)->cursg = NULL;
+
if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
ide_task_t *task = rq->special;
 
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index ca95e99..35b0d1e 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -324,7 +324,7 @@ static int auide_build_dmatable(ide_drive_t *drive)
cur_addr += tc;
   

Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-16 Thread Badari Pulavarty
On Tue, 2007-05-15 at 19:50 +0200, Jens Axboe wrote:
> On Tue, May 15 2007, Badari Pulavarty wrote:
> > On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > > > Hi,
> > > > > 
> > > > > Updated version of the patch - this time I'll just attach the patch
> > > > > file...
> > > > 
> > > > Missing scatterlist.h inclusions..
> > > > 
> > > > drivers/scsi/sym53c8xx_2/sym_glue.c: In function ???sym_scatter???:
> > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit declaration
> > > > of function ???for_each_sg???
> > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected ???;??? before 
> > > > ???{???
> > > > token
> > > > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused variable 
> > > > ???tp???
> > > > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > > > 
> > > > 
> > > > drivers/scsi/qla2xxx/qla_iocb.c: In function 
> > > > ???qla24xx_build_scsi_iocbs???:
> > > > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit declaration of
> > > > function ???for_each_sg???
> > > > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ???;??? before 
> > > > ???{???
> > > > token
> > > 
> > > Thanks, will fix those. What arch? I tested it here.
> > 
> > I am playing with them on ppc64.
> 
> Ah ok, you need the updated patch series for ppc64 support. Builds fine
> here on ppc64. See the #sglist branch of the block repo:
> 
> git://git.kernel.dk/data/git/linux-2.6-block.git
> 
> I can mail you an updated patch, if you want.


Here is the whole panic stack..

VFS: Mounted root (reiserfs filesystem) readonly.
Freeing unused kernel memory: 356k freed
Unable to handle kernel paging request at 464b7948 RIP:
 [] blk_rq_map_sg+0x71/0x1b0
PGD 1df350067 PUD 0
Oops:  [1] SMP
CPU 3
Modules linked in:
Pid: 1, comm: init Not tainted 2.6.22-rc1 #2
RIP: 0010:[]  [] blk_rq_map_sg
+0x71/0x1b0
RSP: :8101a02390e8  EFLAGS: 00010206
RAX: 0001df36a000 RBX: 8101df2efce0 RCX: 0001df446000
RDX:  RSI: 8101df2eb780 RDI: 001df36a
RBP: 8101a0239148 R08: 04e2 R09: 
R10: 8101df2eb780 R11: 0001 R12: 464b7928
R13: 1000 R14: 000e R15: 8101df2efcd0
FS:  () GS:8101c0223300()
knlGS:
CS:  0010 DS: 0018 ES: 0018 CR0: 8005003b
CR2: 464b7948 CR3: 00017a397000 CR4: 06e0
Process init (pid: 1, threadinfo 8101a0238000, task
81018023a000)
Stack:  0001 810179c58000 0001df446000
810179c56060
 8101df2eb780 0004a02393b8 0101 8101df2b4000
 8078a500 810179c56000 8078a500 8101df2b4000
Call Trace:
 [] ide_map_sg+0x42/0xd0
 [] ide_build_sglist+0x2a/0x90
 [] ide_build_dmatable+0x2f/0x1a0
 [] ide_dma_setup+0x44/0xe0
 [] ide_do_rw_disk+0x349/0x510
 [] ide_do_request+0x622/0xb40
 [] lock_timer_base+0x36/0x70
 [] del_timer+0x6b/0x70
 [] do_ide_request+0x1d/0x20
 [] __generic_unplug_device+0x25/0x30
 [] blk_start_queueing+0x25/0x30
 [] cfq_insert_request+0x36b/0x380
 [] elv_insert+0x130/0x1a0
 [] __elv_add_request+0x68/0xc0
 [] __make_request+0xd3/0x590
 [] generic_make_request+0x198/0x240
 [] bio_alloc_bioset+0xa9/0x120
 [] submit_bio+0x62/0xe0
 [] mpage_bio_submit+0x22/0x30
 [] do_mpage_readpage+0x49d/0x590
 [] __inc_zone_page_state+0x2a/0x30
 [] mpage_readpages+0x88/0x160
 [] reiserfs_get_block+0x0/0x1250
 [] reiserfs_get_block+0x0/0x1250
 [] reiserfs_readpages+0x1a/0x20
 [] __do_page_cache_readahead+0x1af/0x2c0
 [] __alloc_pages+0x6e/0x330
 [] do_page_cache_readahead+0x59/0x80
 [] filemap_nopage+0x239/0x2f0
 [] __handle_mm_fault+0x1d0/0xba0
 [] do_page_fault+0x1dc/0x950
 [] __alloc_pages+0x6e/0x330
 [] vma_prio_tree_insert+0x2d/0x50
 [] vma_link+0xb2/0x140
 [] __vma_link_rb+0x2b/0x30
 [] error_exit+0x0/0x84
 [] __clear_user+0x1a/0x40
 [] clear_user+0x2b/0x40
 [] padzero+0x21/0x30
 [] load_elf_binary+0xbbf/0x1ec0
 [] __alloc_pages+0x6e/0x330
 [] __alloc_pages+0x6e/0x330
 [] alloc_pages_current+0x5a/0x90
 [] copy_strings+0x122/0x220
 [] search_binary_handler+0xaf/0x210
 [] do_execve+0x25f/0x290
 [] strncpy_from_user+0x3a/0x50
 [] sys_execve+0x46/0xb0
 [] kernel_execve+0x64/0xd0
 [] run_init_process+0x1e/0x20
 [] init_post+0x9f/0xf0
 [] kernel_init+0x23f/0x330
 [] child_rip+0xa/0x12
 [] kernel_init+0x0/0x330
 [] child_rip+0x0/0x12


Code: 49 8b 44 24 20 49 8d 4c 24 20 48 89 c2 48 83 e2 fe a8 01 48
RIP  [] blk_rq_map_sg+0x71/0x1b0
 RSP 
CR2: 464b7948
Kernel panic - not syncing: Attempted to kill init!

Thanks,
Badari

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-16 Thread Badari Pulavarty
On Tue, 2007-05-15 at 19:50 +0200, Jens Axboe wrote:
> On Tue, May 15 2007, Badari Pulavarty wrote:
> > On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > > > Hi,
> > > > > 
> > > > > Updated version of the patch - this time I'll just attach the patch
> > > > > file...
> > > > 
> > > > Missing scatterlist.h inclusions..
> > > > 
> > > > drivers/scsi/sym53c8xx_2/sym_glue.c: In function ???sym_scatter???:
> > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit declaration
> > > > of function ???for_each_sg???
> > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected ???;??? before 
> > > > ???{???
> > > > token
> > > > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused variable 
> > > > ???tp???
> > > > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > > > 
> > > > 
> > > > drivers/scsi/qla2xxx/qla_iocb.c: In function 
> > > > ???qla24xx_build_scsi_iocbs???:
> > > > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit declaration of
> > > > function ???for_each_sg???
> > > > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ???;??? before 
> > > > ???{???
> > > > token
> > > 
> > > Thanks, will fix those. What arch? I tested it here.
> > 
> > I am playing with them on ppc64.
> 
> Ah ok, you need the updated patch series for ppc64 support. Builds fine
> here on ppc64. See the #sglist branch of the block repo:
> 
> git://git.kernel.dk/data/git/linux-2.6-block.git
> 
> I can mail you an updated patch, if you want.
> 

paniced my amd64 box on boot :(

Unable to handle kernel NULL pointer dereference at 001e
RIP:
 [] blk_rq_map_sg+0x71/0x1b0
PGD 0
Oops:  [1] SMP
CPU 0
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.22-rc1 #2
RIP: 0010:[]  [] blk_rq_map_sg
+0x71/0x1b0
RSP: :810180239330  EFLAGS: 00010287
RAX: 000179d0 RBX: 8101bf204320 RCX: 1000
RDX: 810179c62000 RSI: 8101df507780 RDI: 00179d00


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-15 Thread Jens Axboe
On Tue, May 15 2007, Jens Axboe wrote:
> On Tue, May 15 2007, Badari Pulavarty wrote:
> > On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> > > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > > > Hi,
> > > > > 
> > > > > Updated version of the patch - this time I'll just attach the patch
> > > > > file...
> > > > 
> > > > Missing scatterlist.h inclusions..
> > > > 
> > > > drivers/scsi/sym53c8xx_2/sym_glue.c: In function ???sym_scatter???:
> > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit declaration
> > > > of function ???for_each_sg???
> > > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected ???;??? before 
> > > > ???{???
> > > > token
> > > > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused variable 
> > > > ???tp???
> > > > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > > > 
> > > > 
> > > > drivers/scsi/qla2xxx/qla_iocb.c: In function 
> > > > ???qla24xx_build_scsi_iocbs???:
> > > > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit declaration of
> > > > function ???for_each_sg???
> > > > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ???;??? before 
> > > > ???{???
> > > > token
> > > 
> > > Thanks, will fix those. What arch? I tested it here.
> > 
> > I am playing with them on ppc64.
> 
> Ah ok, you need the updated patch series for ppc64 support. Builds fine
> here on ppc64. See the #sglist branch of the block repo:

A little teaser for those that haven't tried it yet. This is the
blktrace stats of doing a dd from a device and piping to md5sum. Just
meant to test that I got the same data back with chained sglists.

Snips from the blktrace data:

  8,16   2 130214.958707808 0  C   R 983040 + 10240 [0]
  8,16   2 130314.959619712 0  D   R 1005568 + 13312 [swapper]
  8,16   2 130415.066257952 0  C   R 993280 + 12288 [0]
  8,16   2 130515.067238272 0  D   R 1018880 + 13312 [swapper]

That's completion of a 5120kb request, dispatch of a 6656kb request,
completion of a 6144kb request, and finally dispatch of a 6656kb request
again. Average io size for reading half a gig of data:

 Read Dispatches:  110,  524,288KiB

or ~4766kb average IO size. 6656 are the largest requests in this test,
it's running into the hw sg limit at that point. Just doing a plain
O_DIRECT dd from the device makes basically all requests reach the max,
giving an average io size above 6mb/request.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-15 Thread Jens Axboe
On Tue, May 15 2007, Badari Pulavarty wrote:
> On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> > On Tue, May 15 2007, Badari Pulavarty wrote:
> > > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > > Hi,
> > > > 
> > > > Updated version of the patch - this time I'll just attach the patch
> > > > file...
> > > 
> > > Missing scatterlist.h inclusions..
> > > 
> > > drivers/scsi/sym53c8xx_2/sym_glue.c: In function ???sym_scatter???:
> > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit declaration
> > > of function ???for_each_sg???
> > > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected ???;??? before 
> > > ???{???
> > > token
> > > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused variable ???tp???
> > > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > > 
> > > 
> > > drivers/scsi/qla2xxx/qla_iocb.c: In function 
> > > ???qla24xx_build_scsi_iocbs???:
> > > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit declaration of
> > > function ???for_each_sg???
> > > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ???;??? before 
> > > ???{???
> > > token
> > 
> > Thanks, will fix those. What arch? I tested it here.
> 
> I am playing with them on ppc64.

Ah ok, you need the updated patch series for ppc64 support. Builds fine
here on ppc64. See the #sglist branch of the block repo:

git://git.kernel.dk/data/git/linux-2.6-block.git

I can mail you an updated patch, if you want.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-15 Thread Badari Pulavarty
On Tue, 2007-05-15 at 19:20 +0200, Jens Axboe wrote:
> On Tue, May 15 2007, Badari Pulavarty wrote:
> > On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > > Hi,
> > > 
> > > Updated version of the patch - this time I'll just attach the patch
> > > file...
> > 
> > Missing scatterlist.h inclusions..
> > 
> > drivers/scsi/sym53c8xx_2/sym_glue.c: In function ???sym_scatter???:
> > drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit declaration
> > of function ???for_each_sg???
> > drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected ???;??? before 
> > ???{???
> > token
> > drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused variable ???tp???
> > make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> > 
> > 
> > drivers/scsi/qla2xxx/qla_iocb.c: In function ???qla24xx_build_scsi_iocbs???:
> > drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit declaration of
> > function ???for_each_sg???
> > drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ???;??? before ???{???
> > token
> 
> Thanks, will fix those. What arch? I tested it here.

I am playing with them on ppc64.

Thanks,
Badari


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-15 Thread Jens Axboe
On Tue, May 15 2007, Badari Pulavarty wrote:
> On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> > Hi,
> > 
> > Updated version of the patch - this time I'll just attach the patch
> > file...
> 
> Missing scatterlist.h inclusions..
> 
> drivers/scsi/sym53c8xx_2/sym_glue.c: In function ???sym_scatter???:
> drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit declaration
> of function ???for_each_sg???
> drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected ???;??? before 
> ???{???
> token
> drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused variable ???tp???
> make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1
> 
> 
> drivers/scsi/qla2xxx/qla_iocb.c: In function ???qla24xx_build_scsi_iocbs???:
> drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit declaration of
> function ???for_each_sg???
> drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ???;??? before ???{???
> token

Thanks, will fix those. What arch? I tested it here.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Chaining sg lists for big IO commands v5

2007-05-15 Thread Badari Pulavarty
On Fri, 2007-05-11 at 15:51 +0200, Jens Axboe wrote:
> Hi,
> 
> Updated version of the patch - this time I'll just attach the patch
> file...

Missing scatterlist.h inclusions..

drivers/scsi/sym53c8xx_2/sym_glue.c: In function ‘sym_scatter’:
drivers/scsi/sym53c8xx_2/sym_glue.c:385: warning: implicit declaration
of function ‘for_each_sg’
drivers/scsi/sym53c8xx_2/sym_glue.c:385: error: expected ‘;’ before ‘{’
token
drivers/scsi/sym53c8xx_2/sym_glue.c:375: warning: unused variable ‘tp’
make[3]: *** [drivers/scsi/sym53c8xx_2/sym_glue.o] Error 1


drivers/scsi/qla2xxx/qla_iocb.c: In function ‘qla24xx_build_scsi_iocbs’:
drivers/scsi/qla2xxx/qla_iocb.c:678: warning: implicit declaration of
function ‘for_each_sg’
drivers/scsi/qla2xxx/qla_iocb.c:678: error: expected ‘;’ before ‘{’
token



Thanks,
Badari

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/