Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block
Browse files Browse the repository at this point in the history
* 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block: (63 commits)
  Fix memory leak in dm-crypt
  SPARC64: sg chaining support
  SPARC: sg chaining support
  PPC: sg chaining support
  PS3: sg chaining support
  IA64: sg chaining support
  x86-64: enable sg chaining
  x86-64: update pci-gart iommu to sg helpers
  x86-64: update nommu to sg helpers
  x86-64: update calgary iommu to sg helpers
  swiotlb: sg chaining support
  i386: enable sg chaining
  i386 dma_map_sg: convert to using sg helpers
  mmc: need to zero sglist on init
  Panic in blk_rq_map_sg() from CCISS driver
  remove sglist_len
  remove blk_queue_max_phys_segments in libata
  revert sg segment size ifdefs
  Fixup u14-34f ENABLE_SG_CHAINING
  qla1280: enable use_sg_chaining option
  ...
  • Loading branch information
Linus Torvalds committed Oct 16, 2007
2 parents f20bf61 + 644bd2f commit 92d15c2
Show file tree
Hide file tree
Showing 142 changed files with 1,186 additions and 1,115 deletions.
4 changes: 2 additions & 2 deletions Documentation/DMA-mapping.txt
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ With scatterlists, you map a region gathered from several regions by:
int i, count = pci_map_sg(dev, sglist, nents, direction);
struct scatterlist *sg;

for (i = 0, sg = sglist; i < count; i++, sg++) {
for_each_sg(sglist, sg, count, i) {
hw_address[i] = sg_dma_address(sg);
hw_len[i] = sg_dma_len(sg);
}
Expand Down Expand Up @@ -782,5 +782,5 @@ following people:
Jay Estabrook <[email protected]>
Thomas Sailer <[email protected]>
Andrea Arcangeli <[email protected]>
Jens Axboe <axboe@suse.de>
Jens Axboe <jens.axboe@oracle.com>
David Mosberger-Tang <[email protected]>
2 changes: 1 addition & 1 deletion Documentation/HOWTO
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ Here is a list of some of the different kernel trees available:
- ACPI development tree, Len Brown <[email protected]>
git.kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git

- Block development tree, Jens Axboe <axboe@suse.de>
- Block development tree, Jens Axboe <jens.axboe@oracle.com>
git.kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git

- DRM development tree, Dave Airlie <[email protected]>
Expand Down
20 changes: 20 additions & 0 deletions Documentation/block/00-INDEX
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
00-INDEX
- This file
as-iosched.txt
- Anticipatory IO scheduler
barrier.txt
- I/O Barriers
biodoc.txt
- Notes on the Generic Block Layer Rewrite in Linux 2.5
capability.txt
- Generic Block Device Capability (/sys/block/<disk>/capability)
deadline-iosched.txt
- Deadline IO scheduler tunables
ioprio.txt
- Block io priorities (in CFQ scheduler)
request.txt
- The members of struct request (in include/linux/blkdev.h)
stat.txt
- Block layer statistics in /sys/block/<dev>/stat
switching-sched.txt
- Switching I/O schedulers at runtime
21 changes: 13 additions & 8 deletions Documentation/block/as-iosched.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ actually has a head for each physical device in the logical RAID device.
However, setting the antic_expire (see tunable parameters below) produces
very similar behavior to the deadline IO scheduler.


Selecting IO schedulers
-----------------------
To choose IO schedulers at boot time, use the argument 'elevator=deadline'.
'noop', 'as' and 'cfq' (the default) are also available. IO schedulers are
assigned globally at boot time only presently. It's also possible to change
the IO scheduler for a determined device on the fly, as described in
Documentation/block/switching-sched.txt.

Refer to Documentation/block/switching-sched.txt for information on
selecting an io scheduler on a per-device basis.

Anticipatory IO scheduler Policies
----------------------------------
Expand Down Expand Up @@ -115,7 +110,7 @@ statistics (average think time, average seek distance) on the process
that submitted the just completed request are examined. If it seems
likely that that process will submit another request soon, and that
request is likely to be near the just completed request, then the IO
scheduler will stop dispatching more read requests for up time (antic_expire)
scheduler will stop dispatching more read requests for up to (antic_expire)
milliseconds, hoping that process will submit a new request near the one
that just completed. If such a request is made, then it is dispatched
immediately. If the antic_expire wait time expires, then the IO scheduler
Expand Down Expand Up @@ -165,3 +160,13 @@ The parameters are:
for big seek time devices though not a linear correspondence - most
processes have only a few ms thinktime.

In addition to the tunables above there is a read-only file named est_time
which, when read, will show:

- The probability of a task exiting without a cooperating task
submitting an anticipated IO.

- The current mean think time.

- The seek distance used to determine if an incoming IO is better.

4 changes: 2 additions & 2 deletions Documentation/block/biodoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
=====================================================

Notes Written on Jan 15, 2002:
Jens Axboe <axboe@suse.de>
Jens Axboe <jens.axboe@oracle.com>
Suparna Bhattacharya <[email protected]>

Last Updated May 2, 2002
Expand All @@ -21,7 +21,7 @@ Credits:
---------

2.5 bio rewrite:
Jens Axboe <axboe@suse.de>
Jens Axboe <jens.axboe@oracle.com>

Many aspects of the generic block layer redesign were driven by and evolved
over discussions, prior patches and the collective experience of several
Expand Down
25 changes: 8 additions & 17 deletions Documentation/block/deadline-iosched.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@ This little file attempts to document how the deadline io scheduler works.
In particular, it will clarify the meaning of the exposed tunables that may be
of interest to power users.

Each io queue has a set of io scheduler tunables associated with it. These
tunables control how the io scheduler works. You can find these entries
in:

/sys/block/<device>/queue/iosched

assuming that you have sysfs mounted on /sys. If you don't have sysfs mounted,
you can do so by typing:

# mount none /sys -t sysfs
Selecting IO schedulers
-----------------------
Refer to Documentation/block/switching-sched.txt for information on
selecting an io scheduler on a per-device basis.


********************************************************************************
Expand All @@ -41,14 +35,11 @@ fifo_batch

When a read request expires its deadline, we must move some requests from
the sorted io scheduler list to the block device dispatch queue. fifo_batch
controls how many requests we move, based on the cost of each request. A
request is either qualified as a seek or a stream. The io scheduler knows
the last request that was serviced by the drive (or will be serviced right
before this one). See seek_cost and stream_unit.
controls how many requests we move.


write_starved (number of dispatches)
-------------
writes_starved (number of dispatches)
--------------

When we have to move requests from the io scheduler queue to the block
device dispatch queue, we always give a preference to reads. However, we
Expand All @@ -73,6 +64,6 @@ that comes at basically 0 cost we leave that on. We simply disable the
rbtree front sector lookup when the io scheduler merge function is called.


Nov 11 2002, Jens Axboe <axboe@suse.de>
Nov 11 2002, Jens Axboe <jens.axboe@oracle.com>


2 changes: 1 addition & 1 deletion Documentation/block/ioprio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@ int main(int argc, char *argv[])
---> snip ionice.c tool <---


March 11 2005, Jens Axboe <axboe@suse.de>
March 11 2005, Jens Axboe <jens.axboe@oracle.com>
2 changes: 1 addition & 1 deletion Documentation/block/request.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

struct request documentation

Jens Axboe <axboe@suse.de> 27/05/02
Jens Axboe <jens.axboe@oracle.com> 27/05/02

1.0
Index
Expand Down
21 changes: 21 additions & 0 deletions Documentation/block/switching-sched.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
To choose IO schedulers at boot time, use the argument 'elevator=deadline'.
'noop', 'as' and 'cfq' (the default) are also available. IO schedulers are
assigned globally at boot time only presently.

Each io queue has a set of io scheduler tunables associated with it. These
tunables control how the io scheduler works. You can find these entries
in:

/sys/block/<device>/queue/iosched

assuming that you have sysfs mounted on /sys. If you don't have sysfs mounted,
you can do so by typing:

# mount none /sys -t sysfs

As of the Linux 2.6.10 kernel, it is now possible to change the
IO scheduler for a given block device on the fly (thus making it possible,
for instance, to set the CFQ scheduler for the system default, but
Expand All @@ -20,3 +35,9 @@ noop anticipatory deadline [cfq]
# echo anticipatory > /sys/block/hda/queue/scheduler
# cat /sys/block/hda/queue/scheduler
noop [anticipatory] deadline cfq

Each io queue has a set of io scheduler tunables associated with it. These
tunables control how the io scheduler works. You can find these entries
in:

/sys/block/<device>/queue/iosched
14 changes: 7 additions & 7 deletions arch/ia64/hp/common/sba_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ sba_dump_sg( struct ioc *ioc, struct scatterlist *startsg, int nents)
printk(KERN_DEBUG " %d : DMA %08lx/%05x CPU %p\n", nents,
startsg->dma_address, startsg->dma_length,
sba_sg_address(startsg));
startsg++;
startsg = sg_next(startsg);
}
}

Expand All @@ -409,7 +409,7 @@ sba_check_sg( struct ioc *ioc, struct scatterlist *startsg, int nents)
while (the_nents-- > 0) {
if (sba_sg_address(the_sg) == 0x0UL)
sba_dump_sg(NULL, startsg, nents);
the_sg++;
the_sg = sg_next(the_sg);
}
}

Expand Down Expand Up @@ -1201,7 +1201,7 @@ sba_fill_pdir(
u32 pide = startsg->dma_address & ~PIDE_FLAG;
dma_offset = (unsigned long) pide & ~iovp_mask;
startsg->dma_address = 0;
dma_sg++;
dma_sg = sg_next(dma_sg);
dma_sg->dma_address = pide | ioc->ibase;
pdirp = &(ioc->pdir_base[pide >> iovp_shift]);
n_mappings++;
Expand All @@ -1228,7 +1228,7 @@ sba_fill_pdir(
pdirp++;
} while (cnt > 0);
}
startsg++;
startsg = sg_next(startsg);
}
/* force pdir update */
wmb();
Expand Down Expand Up @@ -1297,7 +1297,7 @@ sba_coalesce_chunks( struct ioc *ioc,
while (--nents > 0) {
unsigned long vaddr; /* tmp */

startsg++;
startsg = sg_next(startsg);

/* PARANOID */
startsg->dma_address = startsg->dma_length = 0;
Expand Down Expand Up @@ -1407,7 +1407,7 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di
#ifdef ALLOW_IOV_BYPASS_SG
ASSERT(to_pci_dev(dev)->dma_mask);
if (likely((ioc->dma_mask & ~to_pci_dev(dev)->dma_mask) == 0)) {
for (sg = sglist ; filled < nents ; filled++, sg++){
for_each_sg(sglist, sg, nents, filled) {
sg->dma_length = sg->length;
sg->dma_address = virt_to_phys(sba_sg_address(sg));
}
Expand Down Expand Up @@ -1501,7 +1501,7 @@ void sba_unmap_sg (struct device *dev, struct scatterlist *sglist, int nents, in
while (nents && sglist->dma_length) {

sba_unmap_single(dev, sglist->dma_address, sglist->dma_length, dir);
sglist++;
sglist = sg_next(sglist);
nents--;
}

Expand Down
1 change: 1 addition & 0 deletions arch/ia64/hp/sim/simscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ static struct scsi_host_template driver_template = {
.max_sectors = 1024,
.cmd_per_lun = SIMSCSI_REQ_QUEUE_LEN,
.use_clustering = DISABLE_CLUSTERING,
.use_sg_chaining = ENABLE_SG_CHAINING,
};

static int __init
Expand Down
11 changes: 6 additions & 5 deletions arch/ia64/sn/pci/pci_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,17 @@ EXPORT_SYMBOL(sn_dma_unmap_single);
*
* Unmap a set of streaming mode DMA translations.
*/
void sn_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
void sn_dma_unmap_sg(struct device *dev, struct scatterlist *sgl,
int nhwentries, int direction)
{
int i;
struct pci_dev *pdev = to_pci_dev(dev);
struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
struct scatterlist *sg;

BUG_ON(dev->bus != &pci_bus_type);

for (i = 0; i < nhwentries; i++, sg++) {
for_each_sg(sgl, sg, nhwentries, i) {
provider->dma_unmap(pdev, sg->dma_address, direction);
sg->dma_address = (dma_addr_t) NULL;
sg->dma_length = 0;
Expand All @@ -244,11 +245,11 @@ EXPORT_SYMBOL(sn_dma_unmap_sg);
*
* Maps each entry of @sg for DMA.
*/
int sn_dma_map_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl, int nhwentries,
int direction)
{
unsigned long phys_addr;
struct scatterlist *saved_sg = sg;
struct scatterlist *saved_sg = sgl, *sg;
struct pci_dev *pdev = to_pci_dev(dev);
struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
int i;
Expand All @@ -258,7 +259,7 @@ int sn_dma_map_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
/*
* Setup a DMA address for each entry in the scatterlist.
*/
for (i = 0; i < nhwentries; i++, sg++) {
for_each_sg(sgl, sg, nhwentries, i) {
phys_addr = SG_ENT_PHYS_ADDRESS(sg);
sg->dma_address = provider->dma_map(pdev,
phys_addr, sg->length,
Expand Down
5 changes: 3 additions & 2 deletions arch/powerpc/kernel/dma_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,13 @@ static void dma_direct_unmap_single(struct device *dev, dma_addr_t dma_addr,
{
}

static int dma_direct_map_sg(struct device *dev, struct scatterlist *sg,
static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl,
int nents, enum dma_data_direction direction)
{
struct scatterlist *sg;
int i;

for (i = 0; i < nents; i++, sg++) {
for_each_sg(sgl, sg, nents, i) {
sg->dma_address = (page_to_phys(sg->page) + sg->offset) |
dma_direct_offset;
sg->dma_length = sg->length;
Expand Down
11 changes: 6 additions & 5 deletions arch/powerpc/kernel/ibmebus.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,16 @@ static void ibmebus_unmap_single(struct device *dev,
}

static int ibmebus_map_sg(struct device *dev,
struct scatterlist *sg,
struct scatterlist *sgl,
int nents, enum dma_data_direction direction)
{
struct scatterlist *sg;
int i;

for (i = 0; i < nents; i++) {
sg[i].dma_address = (dma_addr_t)page_address(sg[i].page)
+ sg[i].offset;
sg[i].dma_length = sg[i].length;
for_each_sg(sgl, sg, nents, i) {
sg->dma_address = (dma_addr_t)page_address(sg->page)
+ sg->offset;
sg->dma_length = sg->length;
}

return nents;
Expand Down
Loading

0 comments on commit 92d15c2

Please sign in to comment.