29 Aug, 2011

1 commit


21 Jul, 2011

1 commit

  • Btrfs needs to be able to control how filemap_write_and_wait_range() is called
    in fsync to make it less of a painful operation, so push down taking i_mutex and
    the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some
    file systems can drop taking the i_mutex altogether it seems, like ext3 and
    ocfs2. For correctness sake I just pushed everything down in all cases to make
    sure that we keep the current behavior the same for everybody, and then each
    individual fs maintainer can make up their mind about what to do from there.
    Thanks,

    Acked-by: Jan Kara
    Signed-off-by: Josef Bacik
    Signed-off-by: Al Viro

    Josef Bacik
     

16 Jun, 2011

1 commit


15 Dec, 2010

1 commit

  • cancel_rearming_delayed_work[queue]() has been superceded by
    cancel_delayed_work_sync() quite some time ago. Convert all the
    in-kernel users. The conversions are completely equivalent and
    trivial.

    Signed-off-by: Tejun Heo
    Acked-by: "David S. Miller"
    Acked-by: Greg Kroah-Hartman
    Acked-by: Evgeniy Polyakov
    Cc: Jeff Garzik
    Cc: Benjamin Herrenschmidt
    Cc: Mauro Carvalho Chehab
    Cc: netdev@vger.kernel.org
    Cc: Anton Vorontsov
    Cc: David Woodhouse
    Cc: "J. Bruce Fields"
    Cc: Neil Brown
    Cc: Alex Elder
    Cc: xfs-masters@oss.sgi.com
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: Andrew Morton
    Cc: netfilter-devel@vger.kernel.org
    Cc: Trond Myklebust
    Cc: linux-nfs@vger.kernel.org

    Tejun Heo
     

05 Jun, 2010

2 commits

  • As pointed by Nick Piggin, ->page_mkwrite provides a way to keep a page
    locked until the associated PTE is marked dirty.

    Re-implement the fix by using this mechanism.

    Signed-off-by: Albert Herranz
    Acked-by: Jaya Kumar
    Acked-by: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Albert Herranz
     
  • This reverts commit 49bbd815fd8ba26d0354900b783b767c7f47c816 ("fb_defio:
    fix for non-dirty ptes").

    Although the fix provided is correct, it's been suggested to avoid the
    underlying race in the same way as it is currently done in filesystems
    like NFS, for maintainability.

    A following patch "fb_defio: redo fix for non-dirty ptes" will provide
    such an alternate fix.

    Signed-off-by: Albert Herranz
    Cc: Jaya Kumar
    Cc: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Albert Herranz
     

28 May, 2010

1 commit


25 May, 2010

1 commit

  • Fix a problem observed while using fb_defio with a short delay on a
    PowerPC platform.

    It is possible that page_mkclean() is invoked in the deferred io work
    function _before_ a PTE has been marked dirty. In this case, the page is
    removed from the defio pagelist but page_mkclean() does not write-protect
    the page again. The end result is that defio ignores all subsequent
    writes to the page and the corresponding portions of the framebuffer never
    get updated.

    The fix consists in keeping track of the pages with non-dirty PTEs,
    re-checking them again on the next deferred io work iteration. Note that
    those pages are not passed to the defio callback as they are not written
    by userspace yet.

    Signed-off-by: Albert Herranz
    Acked-by: Jaya Kumar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Albert Herranz
     

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
     

11 Dec, 2009

1 commit


04 Dec, 2009

2 commits


28 Sep, 2009

1 commit


01 Apr, 2009

1 commit

  • Change the page_mkwrite prototype to take a struct vm_fault, and return
    VM_FAULT_xxx flags. There should be no functional change.

    This makes it possible to return much more detailed error information to
    the VM (and also can provide more information eg. virtual_address to the
    driver, which might be important in some special cases).

    This is required for a subsequent fix. And will also make it easier to
    merge page_mkwrite() with fault() in future.

    Signed-off-by: Nick Piggin
    Cc: Chris Mason
    Cc: Trond Myklebust
    Cc: Miklos Szeredi
    Cc: Steven Whitehouse
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Artem Bityutskiy
    Cc: Felix Blyakher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

22 Dec, 2008

3 commits

  • Extend the deferred io code from only supporting vmalloc()ed frame
    buffer memory to support both vmalloc()ed and physically contiguous
    frame buffer memory.

    The sh_mobile_lcdcfb hardware does not support scatter gather so
    we need physically contiguous memory to back our frame buffer.

    Signed-off-by: Magnus Damm
    Acked-by: Jaya Kumar
    Signed-off-by: Paul Mundt

    Magnus Damm
     
  • Make sure the mmap callback is set to NULL in the deferred io
    cleanup function. This way we can enable and disable deferred
    io on the fly.

    Signed-off-by: Magnus Damm
    Acked-by: Jaya Kumar
    Signed-off-by: Paul Mundt

    Magnus Damm
     
  • If CONFIG_FB_DEFERRED_IO is set, but there are framebuffers
    registered that does not make use of deferred io, then fsync()
    on those framebuffers will result in a crash. Fix that.

    This is needed for sh_mobile_lcdcfb since we always enable
    deferred io at compile time but we may disable deferred io
    for some types of hardware configurations.

    Signed-off-by: Magnus Damm
    Acked-by: Jaya Kumar
    Signed-off-by: Paul Mundt

    Magnus Damm
     

21 Aug, 2008

1 commit

  • Fixes kernel BUG at lib/radix-tree.c:473.

    Previously the handler was incidentally provided by tmpfs but this was
    removed with:

    commit 14fcc23fdc78e9d32372553ccf21758a9bd56fa1
    Author: Hugh Dickins
    Date: Mon Jul 28 15:46:19 2008 -0700

    tmpfs: fix kernel BUG in shmem_delete_inode

    relying on this behaviour was incorrect in any case and the BUG also
    appeared when the device node was on an ext3 filesystem.

    v2: override a_ops at open() time rather than mmap() time to minimise
    races per AKPM's concerns.

    Signed-off-by: Ian Campbell
    Cc: Jaya Kumar
    Cc: Nick Piggin
    Cc: Peter Zijlstra
    Cc: Hugh Dickins
    Cc: Johannes Weiner
    Cc: Jeremy Fitzhardinge
    Cc: Kel Modderman
    Cc: Markus Armbruster
    Cc: Krzysztof Helt
    Cc: [14fcc23fd is in 2.6.25.14 and 2.6.26.1]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Campbell
     

13 Jul, 2008

1 commit

  • This patch is a bugfix for how defio handles multiple processes manipulating
    the same framebuffer.

    Thanks to Bernard Blackham for identifying this bug.

    It occurs when two applications mmap the same framebuffer and concurrently
    write to the same page. Normally, this doesn't occur since only a single
    process mmaps the framebuffer. The symptom of the bug is that the mapping
    applications will hang. The cause is that defio incorrectly tries to add the
    same page twice to the pagelist. The solution I have is to walk the pagelist
    and check for a duplicate before adding. Since I needed to walk the pagelist,
    I now also keep the pagelist in sorted order.

    Signed-off-by: Jaya Kumar
    Cc: Bernard Blackham
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jaya Kumar
     

20 Mar, 2008

1 commit

  • Implement support for the E-Ink Metronome controller. It provides an mmapable
    interface to the controller using defio support. It was tested with a gumstix
    pxa255 with Vizplex media using Xfbdev and various X clients such as xeyes,
    xpdf, xloadimage.

    This patch also fixes the following bug: Defio would cause a hang on write
    access to the framebuffer as the page fault would be called ad-infinitum. It
    fixes fb_defio by setting the mapping to be used by page_mkclean.

    Signed-off-by: Jaya Kumar
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jaya Kumar
     

07 Feb, 2008

1 commit

  • Convert fb defio from nopage to fault.
    Switch from OOM to SIGBUS if the resource is not available.

    Signed-off-by: Nick Piggin
    Cc: "Antonino A. Daplas"
    Cc: Paul Mundt
    Cc: Jaya Kumar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

17 Oct, 2007

1 commit


09 May, 2007

4 commits

  • Kill the following in fb_defio.c:

    drivers/video/fb_defio.c:40:43: warning: incorrect type in argument 1 (different address spaces)
    drivers/video/fb_defio.c:40:43: expected void *addr
    drivers/video/fb_defio.c:40:43: got char [noderef] *screen_base

    The framebuffer memory of these types of devices are allocated from system
    RAM.

    Signed-off-by: Antonino Daplas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Antonino A. Daplas
     
  • There are cases when we do not want to wait on the delay for automatically
    updating the "real" framebuffer, this implements a simple ->fsync() hook
    for explicitly flushing the deferred I/O work. The ->page_mkwrite()
    handler will rearm the work queue normally.

    (akpm: nuke unneeded ifdefs, forward-delcare struct dentry)

    Signed-off-by: Paul Mundt
    Cc: Jaya Kumar
    Acked-by: Antonino Daplas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Mundt
     
  • Signed-off-by: Adrian Bunk
    Cc: Jaya Kumar
    Cc: Antonino Daplas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • This implements deferred IO support in fbdev. Deferred IO is a way to delay
    and repurpose IO. This implementation is done using mm's page_mkwrite and
    page_mkclean hooks in order to detect, delay and then rewrite IO. This
    functionality is used by hecubafb.

    [adaplas]
    This is useful for graphics hardware with no directly addressable/mappable
    framebuffer. Implementing this will allow the "framebuffer" to be accesible
    from user space via mmap().

    Signed-off-by: Jaya Kumar
    Signed-off-by: Antonino Daplas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jaya Kumar