15 Jun, 2017

1 commit


28 Feb, 2017

2 commits

  • Commit 50bed2e2862a ("sg: disable interrupts inside sg_copy_buffer")
    introduced disabling interrupts in sg_copy_buffer() since atomic uses of
    miter required it due to use of kmap_atomic().

    However, as commit 8290e2d2dcbf ("scatterlist: atomic sg_mapping_iter()
    no longer needs disabled IRQs") acknowledges disabling interrupts is no
    longer needed for calls to kmap_atomic() and therefore unneeded for
    miter ops either, so remove it from sg_copy_buffer().

    Link: http://lkml.kernel.org/r/1486040150-14109-3-git-send-email-gilad@benyossef.com
    Signed-off-by: Gilad Ben-Yossef
    Cc: Jens Axboe
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gilad Ben-Yossef
     
  • Test the cheaper boolean expression with no side effects first.

    Link: http://lkml.kernel.org/r/1486040150-14109-2-git-send-email-gilad@benyossef.com
    Signed-off-by: Gilad Ben-Yossef
    Cc: Jens Axboe
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gilad Ben-Yossef
     

09 Feb, 2016

1 commit


17 Aug, 2015

1 commit

  • There are a couple of uses of struct scatterlist that never go to
    the dma_map_sg() helper and thus don't care about ARCH_HAS_SG_CHAIN
    which indicates that we can map chained S/G list.

    The most important one is the crypto code, which currently has
    to open code a few helpers to always allow chaining. This patch
    removes a few #ifdef ARCH_HAS_SG_CHAIN statements so that we can
    switch the crypto code to these common helpers.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

01 Jul, 2015

3 commits

  • do_device_access() takes a separate parameter to indicate the direction of
    data transfer, which it used to use to select the appropriate function out
    of sg_pcopy_{to,from}_buffer(). However these two functions now have

    So this patch makes it bypass these wrappers and call the underlying
    function sg_copy_buffer() directly; this has the same calling style as
    do_device_access() i.e. a separate direction-of-transfer parameter and no
    pointers-to-const, so skipping the wrappers not only eliminates the
    warning, it also make the code simpler :)

    [akpm@linux-foundation.org: fix very broken build]
    Signed-off-by: Dave Gordon
    Acked-by: Arnd Bergmann
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Gordon
     
  • The 'buf' parameter of sg(p)copy_from_buffer() can and should be
    const-qualified, although because of the shared implementation of
    _to_buffer() and _from_buffer(), we have to cast this away internally.

    This means that callers who have a 'const' buffer containing the data to
    be copied to the sg-list no longer have to cast away the const-ness
    themselves. It also enables improved coverage by code analysis tools.

    Signed-off-by: Dave Gordon
    Cc: Akinobu Mita
    Cc: "Martin K. Petersen"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Gordon
     
  • The kerneldoc for the functions doesn't match the code; the last two
    parameters (buflen, skip) have been transposed, which is confusing,
    especially as they're both integral types and the compiler won't warn
    about swapping them.

    These functions and the kerneldoc were introduced in commit:
    df642cea lib/scatterlist: introduce sg_pcopy_from_buffer() ...
    Author: Akinobu Mita
    Date: Mon Jul 8 16:01:54 2013 -0700

    The only difference between sg_pcopy_{from,to}_buffer() and
    sg_copy_{from,to}_buffer() is an additional argument that
    specifies the number of bytes to skip the SG list before
    copying.

    The functions have the extra argument at the end, but the kerneldoc
    lists it in penultimate position.

    Signed-off-by: Dave Gordon
    Reviewed-by: Akinobu Mita
    Cc: "Martin K. Petersen"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Gordon
     

03 Jun, 2015

1 commit

  • When performing a dma_map_sg() call, the number of sg entries to map is
    required. Using sg_nents to retrieve the number of sg entries will
    return the total number of entries in the sg list up to the entry marked
    as the end. If there happen to be unused entries in the list, these will
    still be counted. Some dma_map_sg() implementations will not handle the
    unused entries correctly (lib/swiotlb.c) and execute a BUG_ON.

    The sg_nents_for_len() function will traverse the sg list and return the
    number of entries required to satisfy the supplied length argument. This
    can then be supplied to the dma_map_sg() call to successfully map the
    sg.

    Signed-off-by: Tom Lendacky
    Signed-off-by: Herbert Xu

    Tom Lendacky
     

29 Oct, 2014

1 commit


09 Aug, 2014

1 commit

  • Rather than have architectures #define ARCH_HAS_SG_CHAIN in an
    architecture specific scatterlist.h, make it a proper Kconfig option and
    use that instead. At same time, remove the header files are are now
    mostly useless and just include asm-generic/scatterlist.h.

    [sfr@canb.auug.org.au: powerpc files now need asm/dma.h]
    Signed-off-by: Laura Abbott
    Acked-by: Thomas Gleixner [x86]
    Acked-by: Benjamin Herrenschmidt [powerpc]
    Acked-by: Heiko Carstens
    Cc: Russell King
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: "James E.J. Bottomley"
    Cc: Martin Schwidefsky
    Signed-off-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Laura Abbott
     

26 Jul, 2014

1 commit

  • Blk-mq drivers usually preallocate their S/G list as part of the request,
    but if we want to support the very large S/G lists currently supported by
    the SCSI code that would tie up a lot of memory in the preallocated request
    pool. Add support to the scatterlist code so that it can initialize a
    S/G list that uses a preallocated first chunks and dynamically allocated
    additional chunks. That way the scsi-mq code can preallocate a first
    page worth of S/G entries as part of the request, and dynamically extend
    the S/G list when needed.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Martin K. Petersen
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Webb Scales
    Acked-by: Jens Axboe
    Tested-by: Bart Van Assche
    Tested-by: Robert Elliott

    Christoph Hellwig
     

09 Dec, 2013

1 commit

  • sg_copy_buffer() can't meet demand for some drrivers(such usb
    mass storage), so we have to use the sg_miter_* APIs to access
    sg buffer, then need export sg_miter_skip() for these drivers.

    The API is needed for converting to sg_miter_* APIs in USB storage
    driver for accessing sg buffer.

    Acked-by: Andrew Morton
    Cc: FUJITA Tomonori
    Cc: Jens Axboe
    Signed-off-by: Ming Lei
    Reviewed-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     

01 Nov, 2013

1 commit

  • Commit b1adaf65ba03 ("[SCSI] block: add sg buffer copy helper
    functions") introduces two sg buffer copy helpers, and calls
    flush_kernel_dcache_page() on pages in SG list after these pages are
    written to.

    Unfortunately, the commit may introduce a potential bug:

    - Before sending some SCSI commands, kmalloc() buffer may be passed to
    block layper, so flush_kernel_dcache_page() can see a slab page
    finally

    - According to cachetlb.txt, flush_kernel_dcache_page() is only called
    on "a user page", which surely can't be a slab page.

    - ARCH's implementation of flush_kernel_dcache_page() may use page
    mapping information to do optimization so page_mapping() will see the
    slab page, then VM_BUG_ON() is triggered.

    Aaro Koskinen reported the bug on ARM/kirkwood when DEBUG_VM is enabled,
    and this patch fixes the bug by adding test of '!PageSlab(miter->page)'
    before calling flush_kernel_dcache_page().

    Signed-off-by: Ming Lei
    Reported-by: Aaro Koskinen
    Tested-by: Simon Baatz
    Cc: Russell King - ARM Linux
    Cc: Will Deacon
    Cc: Aaro Koskinen
    Acked-by: Catalin Marinas
    Cc: FUJITA Tomonori
    Cc: Tejun Heo
    Cc: "James E.J. Bottomley"
    Cc: Jens Axboe
    Cc: [3.2+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ming Lei
     

10 Jul, 2013

3 commits

  • I was reviewing code which I suspected might allocate a zero size SG
    table. That will cause memory corruption. Also we can't return before
    doing the memset or we could end up using uninitialized memory in the
    cleanup path.

    Signed-off-by: Dan Carpenter
    Cc: Akinobu Mita
    Cc: Imre Deak
    Cc: Tejun Heo
    Cc: Daniel Vetter
    Cc: Maxim Levitsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Carpenter
     
  • The only difference between sg_pcopy_{from,to}_buffer() and
    sg_copy_{from,to}_buffer() is an additional argument that specifies the
    number of bytes to skip the SG list before copying.

    Signed-off-by: Akinobu Mita
    Cc: "David S. Miller"
    Cc: "James E.J. Bottomley"
    Cc: Douglas Gilbert
    Cc: Herbert Xu
    Cc: Horia Geanta
    Cc: Imre Deak
    Acked-by: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patchset introduces sg_pcopy_from_buffer() and sg_pcopy_to_buffer(),
    which copy data between a linear buffer and an SG list.

    The only difference between sg_pcopy_{from,to}_buffer() and
    sg_copy_{from,to}_buffer() is an additional argument that specifies the
    number of bytes to skip the SG list before copying.

    The main reason for introducing these functions is to fix a problem in
    scsi_debug module. And there is a local function in crypto/talitos
    module, which can be replaced by sg_pcopy_to_buffer().

    This patch:

    sg_miter_get_next_page() is used to proceed page iterator to the next page
    if necessary, and will be used to implement the variants of
    sg_copy_{from,to}_buffer() later.

    Signed-off-by: Akinobu Mita
    Acked-by: Tejun Heo
    Cc: Tejun Heo
    Cc: Imre Deak
    Cc: Herbert Xu
    Cc: "David S. Miller"
    Cc: "James E.J. Bottomley"
    Cc: Douglas Gilbert
    Cc: Horia Geanta
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

28 Mar, 2013

1 commit

  • The i915 driver uses sg lists for memory without backing 'struct page'
    pages, similarly to other IO memory regions, setting only the DMA
    address for these. It does this, so that it can program the HW MMU
    tables in a uniform way both for sg lists with and without backing pages.

    Without a valid page pointer we can't call nth_page to get the current
    page in __sg_page_iter_next, so add a helper that relevant users can
    call separately. Also add a helper to get the DMA address of the current
    page (idea from Daniel).

    Convert all places in i915, to use the new API.

    Signed-off-by: Imre Deak
    Reviewed-by: Damien Lespiau
    Signed-off-by: Daniel Vetter

    Imre Deak
     

28 Feb, 2013

2 commits

  • For better code reuse use the newly added page iterator to iterate
    through the pages. The offset, length within the page is still
    calculated by the mapping iterator as well as the actual mapping. Idea
    from Tejun Heo.

    Signed-off-by: Imre Deak
    Cc: Maxim Levitsky
    Cc: Tejun Heo
    Cc: Daniel Vetter
    Cc: James Hogan
    Cc: Stephen Warren
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Imre Deak
     
  • Add an iterator to walk through a scatter list a page at a time starting
    at a specific page offset. As opposed to the mapping iterator this is
    meant to be small, performing well even in simple loops like collecting
    all pages on the scatterlist into an array or setting up an iommu table
    based on the pages' DMA address.

    Signed-off-by: Imre Deak
    Cc: Maxim Levitsky
    Cc: Tejun Heo
    Cc: Daniel Vetter
    Tested-by: Stephen Warren
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Imre Deak
     

18 Dec, 2012

1 commit

  • There is absolutely no reason to crash the kernel when we have a
    perfectly good return value already available to use for conveying
    failure status.

    Let's return an error code instead of crashing the kernel: that sounds
    like a much better plan.

    [akpm@linux-foundation.org: s/E2BIG/EINVAL/]
    Signed-off-by: Nick Bowler
    Cc: Maxim Levitsky
    Cc: Tejun Heo
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Bowler
     

11 Oct, 2012

1 commit

  • Pull block IO update from Jens Axboe:
    "Core block IO bits for 3.7. Not a huge round this time, it contains:

    - First series from Kent cleaning up and generalizing bio allocation
    and freeing.

    - WRITE_SAME support from Martin.

    - Mikulas patches to prevent O_DIRECT crashes when someone changes
    the block size of a device.

    - Make bio_split() work on data-less bio's (like trim/discards).

    - A few other minor fixups."

    Fixed up silent semantic mis-merge as per Mikulas Patocka and Andrew
    Morton. It is due to the VM no longer using a prio-tree (see commit
    6b2dbba8b6ac: "mm: replace vma prio_tree with an interval tree").

    So make set_blocksize() use mapping_mapped() instead of open-coding the
    internal VM knowledge that has changed.

    * 'for-3.7/core' of git://git.kernel.dk/linux-block: (26 commits)
    block: makes bio_split support bio without data
    scatterlist: refactor the sg_nents
    scatterlist: add sg_nents
    fs: fix include/percpu-rwsem.h export error
    percpu-rw-semaphore: fix documentation typos
    fs/block_dev.c:1644:5: sparse: symbol 'blkdev_mmap' was not declared
    blockdev: turn a rw semaphore into a percpu rw semaphore
    Fix a crash when block device is read and block size is changed at the same time
    block: fix request_queue->flags initialization
    block: lift the initial queue bypass mode on blk_register_queue() instead of blk_init_allocated_queue()
    block: ioctl to zero block ranges
    block: Make blkdev_issue_zeroout use WRITE SAME
    block: Implement support for WRITE SAME
    block: Consolidate command flag and queue limit checks for merges
    block: Clean up special command handling logic
    block/blk-tag.c: Remove useless kfree
    block: remove the duplicated setting for congestion_threshold
    block: reject invalid queue attribute values
    block: Add bio_clone_bioset(), bio_clone_kmalloc()
    block: Consolidate bio_alloc_bioset(), bio_kmalloc()
    ...

    Linus Torvalds
     

06 Oct, 2012

1 commit

  • SG mapping iterator w/ SG_MITER_ATOMIC set required IRQ disabled because
    it originally used KM_BIO_SRC_IRQ to allow use from IRQ handlers.
    kmap_atomic() has long been updated to handle stacking atomic mapping
    requests on per-cpu basis and only requires not sleeping while mapped.

    Update sg_mapping_iter such that atomic iterators only require disabling
    preemption instead of disabling IRQ.

    While at it, convert wte weird @ARG@ notations to @ARG in the comment of
    sg_miter_start().

    Signed-off-by: Tejun Heo
    Cc: Maxim Levitsky
    Cc: Alex Dubov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     

28 Sep, 2012

1 commit


27 Sep, 2012

1 commit


31 Jul, 2012

2 commits

  • Merge Andrew's first set of patches:
    "Non-MM patches:

    - lots of misc bits

    - tree-wide have_clk() cleanups

    - quite a lot of printk tweaks. I draw your attention to "printk:
    convert the format for KERN_ to a 2 byte pattern" which
    looks a bit scary. But afaict it's solid.

    - backlight updates

    - lib/ feature work (notably the addition and use of memweight())

    - checkpatch updates

    - rtc updates

    - nilfs updates

    - fatfs updates (partial, still waiting for acks)

    - kdump, proc, fork, IPC, sysctl, taskstats, pps, etc

    - new fault-injection feature work"

    * Merge emailed patches from Andrew Morton : (128 commits)
    drivers/misc/lkdtm.c: fix missing allocation failure check
    lib/scatterlist: do not re-write gfp_flags in __sg_alloc_table()
    fault-injection: add tool to run command with failslab or fail_page_alloc
    fault-injection: add selftests for cpu and memory hotplug
    powerpc: pSeries reconfig notifier error injection module
    memory: memory notifier error injection module
    PM: PM notifier error injection module
    cpu: rewrite cpu-notifier-error-inject module
    fault-injection: notifier error injection
    c/r: fcntl: add F_GETOWNER_UIDS option
    resource: make sure requested range is included in the root range
    include/linux/aio.h: cpp->C conversions
    fs: cachefiles: add support for large files in filesystem caching
    pps: return PTR_ERR on error in device_create
    taskstats: check nla_reserve() return
    sysctl: suppress kmemleak messages
    ipc: use Kconfig options for __ARCH_WANT_[COMPAT_]IPC_PARSE_VERSION
    ipc: compat: use signed size_t types for msgsnd and msgrcv
    ipc: allow compat IPC version field parsing if !ARCH_WANT_OLD_COMPAT_IPC
    ipc: add COMPAT_SHMLBA support
    ...

    Linus Torvalds
     
  • We are seeing a lot of sg_alloc_table allocation failures using the new
    drm prime infrastructure. We isolated the cause to code in
    __sg_alloc_table that was re-writing the gfp_flags.

    There is a comment in the code that suggest that there is an assumption
    about the allocation coming from a memory pool. This was likely true
    when sg lists were primarily used for disk I/O.

    Signed-off-by: Mandeep Singh Baines
    Cc: Jens Axboe
    Cc: Paul Gortmaker
    Cc: Cong Wang
    Cc: Daniel Vetter
    Cc: Rob Clark
    Cc: Sumit Semwal
    Cc: Inki Dae
    Cc: Dave Airlie
    Cc: Sonny Rao
    Cc: Olof Johansson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mandeep Singh Baines
     

30 Jul, 2012

1 commit

  • This patch adds a new constructor for an sg table. The table is constructed
    from an array of struct pages. All contiguous chunks of the pages are merged
    into a single sg nodes. A user may provide an offset and a size of a buffer if
    the buffer is not page-aligned.

    The function is dedicated for DMABUF exporters which often perform conversion
    from an page array to a scatterlist. Moreover the scatterlist should be
    squashed in order to save memory and to speed-up the process of DMA mapping
    using dma_map_sg.

    The code is based on the patch 'v4l: vb2-dma-contig: add support for
    scatterlist in userptr mode' and hints from Laurent Pinchart.

    Signed-off-by: Tomasz Stanislawski
    Signed-off-by: Kyungmin Park
    Acked-by: Daniel Vetter
    Acked-by: Laurent Pinchart
    Signed-off-by: Marek Szyprowski
    CC: Andrew Morton

    Tomasz Stanislawski
     

25 Mar, 2012

1 commit

  • Pull cleanup of fs/ and lib/ users of module.h from Paul Gortmaker:
    "Fix up files in fs/ and lib/ dirs to only use module.h if they really
    need it.

    These are trivial in scope vs the work done previously. We now have
    things where any few remaining cleanups can be farmed out to arch or
    subsystem maintainers, and I have done so when possible. What is
    remaining here represents the bits that don't clearly lie within a
    single arch/subsystem boundary, like the fs dir and the lib dir.

    Some duplicate includes arising from overlapping fixes from
    independent subsystem maintainer submissions are also quashed."

    Fix up trivial conflicts due to clashes with other include file cleanups
    (including some due to the previous bug.h cleanup pull).

    * tag 'module-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
    lib: reduce the use of module.h wherever possible
    fs: reduce the use of module.h wherever possible
    includecheck: delete any duplicate instances of module.h

    Linus Torvalds
     

20 Mar, 2012

1 commit


08 Mar, 2012

1 commit


31 Aug, 2010

1 commit

  • When alloc fails, free_table is being called. Depending on the number of
    bytes requested, we determine if we are going to call _get_free_page()
    or kmalloc(). When alloc fails, our math is wrong (due to sg_size - 1),
    and the last buffer is wrongfully assumed to have been allocated by
    kmalloc. Hence, kfree gets called and a panic occurs.

    Signed-off-by: Jeffrey Carlyle
    Signed-off-by: Olusanya Soyannwo
    Acked-by: Tejun Heo
    Signed-off-by: Jens Axboe

    Jeffrey Carlyle
     

29 Jul, 2010

1 commit

  • kmemleak ignores page_alloc() and so believes the final sub-page
    allocation using the plain kmalloc is decoupled and lost. This leads to
    lots of false-positives with code that uses scatterlists.

    The options seem to be either to tell kmemleak that the kmalloc is not
    leaked or to notify kmemleak of the page allocations. The danger of the
    first approach is that we may hide a real leak, so choose the latter
    approach (of which I am not sure of the downsides).

    v2: Added comments on the suggestion of Catalin.

    Signed-off-by: Chris Wilson
    Cc: Tejun Heo
    Cc: Jens Axboe
    Signed-off-by: Catalin Marinas

    Chris Wilson
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

31 Jul, 2009

1 commit

  • sg_miter_start() is currently unaware of the direction of the copy
    process (to or from the scatter list). It is important to know the
    direction because the page has to be flushed in case the data written
    is seen on a different mapping in user land on cache incoherent
    architectures.

    Signed-off-by: Sebastian Andrzej Siewior
    Acked-by: FUJITA Tomonori
    Acked-by: Tejun Heo
    Signed-off-by: Pierre Ossman

    Sebastian Andrzej Siewior
     

22 Apr, 2009

1 commit


20 Nov, 2008

1 commit

  • kunmap() takes as argument the struct page that orginally got kmap()'d,
    however the sg_miter_stop() function passed it the kernel virtual address
    instead, resulting in weird stuff.

    Somehow I ended up fixing this bug by accident while looking for a bug in
    the same area.

    Reported-by: kerneloops.org
    Acked-by: Tejun Heo
    Signed-off-by: Arjan van de Ven
    Cc: Hugh Dickins
    Cc: [2.6.27.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

12 Sep, 2008

1 commit

  • The callers of sg_copy_buffer must disable interrupts before calling
    it (since it uses kmap_atomic). Some callers use it on
    interrupt-disabled code but some need to take the trouble to disable
    interrupts just for this. No wonder they forget about it and we hit a
    bug like:

    http://bugzilla.kernel.org/show_bug.cgi?id=11529

    James said that it might be better to disable interrupts inside the
    function rather than risk the callers getting it wrong.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Jens Axboe

    FUJITA Tomonori
     

23 Jul, 2008

1 commit

  • This is alternative implementation of sg content iterator introduced
    by commit 83e7d317... from Pierre Ossman in next-20080716. As there's
    already an sg iterator which iterates over sg entries themselves, name
    this sg_mapping_iterator.

    Slightly edited description from the original implementation follows.

    Iteration over a sg list is not that trivial when you take into
    account that memory pages might have to be mapped before being used.
    Unfortunately, that means that some parts of the kernel restrict
    themselves to directly accesible memory just to not have to deal with
    the mess.

    This patch adds a simple iterator system that allows any code to
    easily traverse an sg list and not have to deal with all the details.
    The user can decide to consume part of the iteration. Also, iteration
    can be stopped and resumed later if releasing the kmap between
    iteration steps is necessary. These features are useful to implement
    piecemeal sg copying for interrupt drive PIO for example.

    Signed-off-by: Tejun Heo
    Signed-off-by: Pierre Ossman

    Tejun Heo
     

08 Apr, 2008

1 commit

  • This patch adds new three helper functions to copy data between an SG
    list and a linear buffer.

    - sg_copy_from_buffer copies data from linear buffer to an SG list

    - sg_copy_to_buffer copies data from an SG list to a linear buffer

    When the APIs copy data from a linear buffer to an SG list,
    flush_kernel_dcache_page is called. It's not necessary for everyone
    but it's a no-op on most architectures and in general the API is not
    used in performance critical path.

    Signed-off-by: FUJITA Tomonori
    Acked-by: Jens Axboe
    Signed-off-by: James Bottomley

    FUJITA Tomonori