login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
October
»
17
Re: [PATCH] SPARC64: fix iommu sg chaining
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Jens Axboe
Subject:
Re: [PATCH] SPARC64: fix iommu sg chaining
Date: Wednesday, October 17, 2007 - 4: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
, (Tue Oct 16, 10:07 pm)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 12:21 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 1:33 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 1:42 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 1:45 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 2:13 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 2:16 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 2:24 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 2:27 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 2:45 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 3:54 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 3:58 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 4:01 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 4:04 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 4:04 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 4:04 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 4:08 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 4:10 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 4:11 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 4:13 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 4:16 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, David Miller
, (Wed Oct 17, 4:18 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 4:27 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 4:37 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 4:41 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 4:57 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 5:05 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, Jens Axboe
, (Wed Oct 17, 7:36 am)
Re: [PATCH] SPARC64: fix iommu sg chaining
, FUJITA Tomonori
, (Wed Oct 17, 4:01 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
FUJITA Tomonori
Re: [Scst-devel] Integration of SCST in the mainstream Linux kernel
Uwe Kleine-König
Re: [PATCH v2] ARM: allow, but warn, when issuing ioremap() on RAM
Ingo Molnar
Re: [RFC/RFT PATCH] sched: automated per tty task groups
Rafael J. Wysocki
Re: Why do so many machines need "noapic"?
Matthew Garrett
Re: [RFC][PATCH -mm 3/3] PM: Disable _request_firmware before hibernation/suspend
git
:
Mike Miller
git message
Junio C Hamano
Re: [PATCH] Detached HEAD (experimental)
Stefan Richter
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
A Large Angry SCM
Re: [RFC] origin link for cherry-pick and revert
Petr Baudis
Re: PPC SHA-1 Updates in "pu"
git-commits-head
:
Linux Kernel Mailing List
libata: disable ATAPI AN by default
Linux Kernel Mailing List
ARM: 5905/1: ARM: Global ASID allocation on SMP
Linux Kernel Mailing List
timer: Try to survive timer callback preempt_count leak
Linux Kernel Mailing List
Documentation/timers/hpet_example.c: only build on X86
Linux Kernel Mailing List
ALSA: hda - Enable beep on Realtek codecs with PCI SSID override
linux-netdev
:
Arnaldo Carvalho de Melo
Re: [PATCH 06/37] dccp: Limit feature negotiation to connection setup phase
Gerrit Renker
[PATCH 1/5] dccp: Initialisation framework for feature negotiation
Daniel Lezcano
getsockopt(TCP_DEFER_ACCEPT) value change
David Miller
Re: 2.6.27.18: bnx2/tg3: BUG: "scheduling while atomic" trying to ifenslave a seco...
Badalian Vyacheslav
Re: tc filter flow hash question
openbsd-misc
:
Stuart Henderson
Re: Kuro5hin: OpenBSD Founder Theo deRaadt Has Conflict of Interest With AMD
Christian Weisgerber
Re: CARP with a single public IP address
Darrin Chandler
Re: strange output on openbsd C code
Marco Peereboom
Re: OpenBSD culture?
KURS ENGLESKOG JEZIKA NA 10 CD-a
AUDIO-VIZUELNA METODA UCENJA ENGLESKOG JEZIKA na 10 CD-a
Colocation donated by:
Syndicate