login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
October
»
17
Re: [PATCH] SPARC64: fix iommu sg chaining
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Jens Axboe <jens.axboe@...>
To: FUJITA Tomonori <fujita.tomonori@...>
Cc: <davem@...>, <linux-kernel@...>, <linux-scsi@...>, <tomof@...>
Subject:
Re: [PATCH] SPARC64: fix iommu sg chaining
Date: Wednesday, October 17, 2007 - 7:41 am
On Wed, Oct 17 2007, FUJITA Tomonori wrote:
quoted text
> On Wed, 17 Oct 2007 13:01:42 +0200 > Jens Axboe <jens.axboe@oracle.com> wrote: > > > On Wed, Oct 17 2007, Jens Axboe wrote: > > > On Wed, Oct 17 2007, David Miller wrote: > > > > From: Jens Axboe <jens.axboe@oracle.com> > > > > Date: Wed, 17 Oct 2007 11:16:29 +0200 > > > > > > > > > On Wed, Oct 17 2007, David Miller wrote: > > > > > > From: Jens Axboe <jens.axboe@oracle.com> > > > > > > Date: Wed, 17 Oct 2007 10:45:28 +0200 > > > > > > > > > > > > > Righto, it's invalid to call sg_next() on the last entry! > > > > > > > > > > > > Unfortunately, that's what the sparc64 code wanted to do, this > > > > > > transformation in the sparc64 sg chaining patch is not equilavent: > > > > > > > > > > > > - struct scatterlist *sg_end = sg + nelems; > > > > > > + struct scatterlist *sg_end = sg_last(sg, nelems); > > > > > > ... > > > > > > - while (sg < sg_end && > > > > > > + while (sg != sg_end && > > > > > > > > > > Auch indeed. That'd probably be better as a > > > > > > > > > > do { > > > > > ... > > > > > } while (sg != sg_end); > > > > > > > > Ok, next bug, introduced by this change: > > > > > > > > commit f565913ef8a8d0cfa46a1faaf8340cc357a46f3a > > > > Author: Jens Axboe <jens.axboe@oracle.com> > > > > Date: Fri Sep 21 10:44:19 2007 +0200 > > > > > > > > block: convert to using sg helpers > > > > > > > > Convert the main rq mapper (blk_rq_map_sg()) to the sg helper setup. > > > > > > > > Signed-off-by: Jens Axboe <jens.axboe@oracle.com> > > > > > > > > Specifically this part: > > > > > > > > new_segment: > > > > - memset(&sg[nsegs],0,sizeof(struct scatterlist)); > > > > - sg[nsegs].page = bvec->bv_page; > > > > - sg[nsegs].length = nbytes; > > > > - sg[nsegs].offset = bvec->bv_offset; > > > > + sg = next_sg; > > > > + next_sg = sg_next(sg); > > > > > > > > + sg->page = bvec->bv_page; > > > > + sg->length = nbytes; > > > > + sg->offset = bvec->bv_offset; > > > > > > > > You can't remove that memset(), it's there for a reason. The IOMMU > > > > layers depended upon the code zero'ing out the whole scatterlist > > > > struct, there might be more to it than page, length and offset :-) > > > > > > I realize that, and I was pretty worried about this specific change. But > > > there's only been one piece of fallout because if it until now - well > > > two, with the sparc64 stuff. > > > > > > The problem is that you cannot zero the entire sg entry, because then > > > you'd potentially overwrite the chain pointer. > > > > > > I'd propose just adding a > > > > > > sg_dma_address(sg) = 0; > > > sg_dma_len(sg) = 0; > > > > > > there for now, or provide an arch_clear_sg_entry() helper if we need > > > more killed. > > > > Actually, just clearing AFTER sg_next() would be fine, since we know > > that is not a link entry. Duh... > > > > diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c > > index 9eabac9..1014d34 100644 > > --- a/block/ll_rw_blk.c > > +++ b/block/ll_rw_blk.c > > @@ -1352,6 +1352,7 @@ new_segment: > > sg = next_sg; > > next_sg = sg_next(sg); > > > > + memset(sg, 0, sizeof(*sg)); > > sg->page = bvec->bv_page; > > sg->length = nbytes; > > sg->offset = bvec->bv_offset; > > > > -- > > So now how about removing zero'ing out sglist in scsi-ml? > > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index aac8a02..0c86be7 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -764,8 +764,6 @@ struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *cmd, gfp_t gfp_mask) > if (unlikely(!sgl)) > goto enomem; > > - memset(sgl, 0, sizeof(*sgl) * sgp->size); > - > /* > * first loop through, set initial index and return value > */
Sure, that should be quite alright then. I'll add it. -- Jens Axboe -
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 1:07 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 3:21 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 4:33 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 4:42 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 4:45 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 5:13 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 5:16 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 6:54 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 6:58 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 7:04 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 7:04 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 7:04 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 7:01 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 7:37 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 7:01 pm)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 7:41 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 7:57 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 8:05 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 10:36 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 7:10 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 7:11 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 7:18 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 7:27 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 5:24 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 5:45 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 7:08 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 7:13 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 7:16 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 5:27 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Zach Brown
[PATCH 3 of 4] Teach paths to wake a specific void * target instead of a whole tas...
Paul Jackson
Re: cpuset-remove-sched-domain-hooks-from-cpusets
Jeff Garzik
Re: Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series..
Greg Kroah-Hartman
[PATCH 002/196] Chinese: rephrase English introduction in HOWTO
linux-netdev
:
Eric Dumazet
Re: [PATCH] tcp: splice as many packets as possible at once
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Ingo Molnar
Re: [GIT]: Networking
Alexey Dobriyan
[PATCH 06/53] netns xfrm: per-netns xfrm_state_bysrc hash
git
:
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
2 users
and
988 guests
online.
Online users
Jeremy
maheshdm
Syndicate