1. 15 1月, 2013 3 次提交
  2. 08 1月, 2013 1 次提交
  3. 20 12月, 2012 1 次提交
    • M
      drm/ttm: fix delayed ttm_bo_cleanup_refs_and_unlock delayed handling · 0953e76e
      Maarten Lankhorst 提交于
      Fix regression introduced by 85b144f8
      "drm/ttm: call ttm_bo_cleanup_refs with reservation and lru lock held, v3"
      
      Slowpath ttm_bo_cleanup_refs_and_unlock accidentally tried to increase
      refcount on &bo->sync_obj instead of bo->sync_obj.
      
      The compiler didn't complain since sync_obj_ref takes a void pointer,
      so it was still valid c.
      
      This could result in lockups, memory corruptions, and warnings like
      these when graphics card VRAM usage is high:
      
      ------------[ cut here ]------------
      WARNING: at include/linux/kref.h:42 radeon_fence_ref+0x2c/0x40()
      Hardware name: System Product Name
      Pid: 157, comm: X Not tainted 3.7.0-rc7-00520-g85b144f8-dirty #174
      Call Trace:
      [<ffffffff81058c84>] ? warn_slowpath_common+0x74/0xb0
      [<ffffffff8129273c>] ? radeon_fence_ref+0x2c/0x40
      [<ffffffff8125e95c>] ? ttm_bo_cleanup_refs_and_unlock+0x18c/0x2d0
      [<ffffffff8125f17c>] ? ttm_mem_evict_first+0x1dc/0x2a0
      [<ffffffff81264452>] ? ttm_bo_man_get_node+0x62/0xb0
      [<ffffffff8125f4ce>] ? ttm_bo_mem_space+0x28e/0x340
      [<ffffffff8125fb0c>] ? ttm_bo_move_buffer+0xfc/0x170
      [<ffffffff810de172>] ? kmem_cache_alloc+0xb2/0xc0
      [<ffffffff8125fc15>] ? ttm_bo_validate+0x95/0x110
      [<ffffffff8125ff7c>] ? ttm_bo_init+0x2ec/0x3b0
      [<ffffffff8129419a>] ? radeon_bo_create+0x18a/0x200
      [<ffffffff81293e80>] ? radeon_bo_clear_va+0x40/0x40
      [<ffffffff812a5342>] ? radeon_gem_object_create+0x92/0x160
      [<ffffffff812a575c>] ? radeon_gem_create_ioctl+0x6c/0x150
      [<ffffffff812a529f>] ? radeon_gem_object_free+0x2f/0x40
      [<ffffffff81246b60>] ? drm_ioctl+0x420/0x4f0
      [<ffffffff812a56f0>] ? radeon_gem_pwrite_ioctl+0x20/0x20
      [<ffffffff810f53a4>] ? do_vfs_ioctl+0x2e4/0x4e0
      [<ffffffff810e5588>] ? vfs_read+0x118/0x160
      [<ffffffff810f55ec>] ? sys_ioctl+0x4c/0xa0
      [<ffffffff810e5851>] ? sys_read+0x51/0xa0
      [<ffffffff814b0612>] ? system_call_fastpath+0x16/0x1b
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Reported-by: NMarkus Trippelsdorf <markus@trippelsdorf.de>
      Acked-by: NPaul Menzel <paulepanter@users.sourceforge.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      0953e76e
  4. 10 12月, 2012 5 次提交
  5. 28 11月, 2012 3 次提交
  6. 20 11月, 2012 9 次提交
  7. 16 11月, 2012 2 次提交
  8. 07 11月, 2012 1 次提交
  9. 23 10月, 2012 2 次提交
    • T
      drm/ttm: Fix a theoretical race in ttm_bo_cleanup_refs() · b8e902f2
      Thomas Hellstrom 提交于
      In theory, that function could release the lru lock between
      checking for bo on ddestroy list and a successful reserve if the bo
      was already reserved, and the function was called with waiting reserves
      allowed.
      However, all current reservers of a bo on the ddestroy list would
      atomically take the bo off the list after a successful reserve so this
      race should not have been hit, so no need to backport for stable.
      
      This patch also fixes a case found by Maarten Lankhorst where
      ttm_mem_evict_first called with no_wait_gpu would incorrectly
      spin waiting for bo idle if trying to evict a busy buffer that
      also sits on the ddestroy list.
      Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b8e902f2
    • T
      drm/ttm: Fix a theoretical race · 7bc17a78
      Thomas Hellstrom 提交于
      The ttm_mem_evict_first function could theoretically drop the
      lru lock without retrying if a reservation from off the LRU list
      ended up waiting.
      However, since currently there are no users that could cause a wait
      in that situation so this is not suitable for stable
      Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      7bc17a78
  10. 09 10月, 2012 1 次提交
    • K
      mm: kill vma flag VM_RESERVED and mm->reserved_vm counter · 314e51b9
      Konstantin Khlebnikov 提交于
      A long time ago, in v2.4, VM_RESERVED kept swapout process off VMA,
      currently it lost original meaning but still has some effects:
      
       | effect                 | alternative flags
      -+------------------------+---------------------------------------------
      1| account as reserved_vm | VM_IO
      2| skip in core dump      | VM_IO, VM_DONTDUMP
      3| do not merge or expand | VM_IO, VM_DONTEXPAND, VM_HUGETLB, VM_PFNMAP
      4| do not mlock           | VM_IO, VM_DONTEXPAND, VM_HUGETLB, VM_PFNMAP
      
      This patch removes reserved_vm counter from mm_struct.  Seems like nobody
      cares about it, it does not exported into userspace directly, it only
      reduces total_vm showed in proc.
      
      Thus VM_RESERVED can be replaced with VM_IO or pair VM_DONTEXPAND | VM_DONTDUMP.
      
      remap_pfn_range() and io_remap_pfn_range() set VM_IO|VM_DONTEXPAND|VM_DONTDUMP.
      remap_vmalloc_range() set VM_DONTEXPAND | VM_DONTDUMP.
      
      [akpm@linux-foundation.org: drivers/vfio/pci/vfio_pci.c fixup]
      Signed-off-by: NKonstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Carsten Otte <cotte@de.ibm.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Morris <james.l.morris@oracle.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Kentaro Takeda <takedakn@nttdata.co.jp>
      Cc: Matt Helsley <matthltc@us.ibm.com>
      Cc: Nick Piggin <npiggin@kernel.dk>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Suresh Siddha <suresh.b.siddha@intel.com>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Venkatesh Pallipadi <venki@google.com>
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      314e51b9
  11. 03 10月, 2012 1 次提交
  12. 02 10月, 2012 2 次提交
  13. 24 8月, 2012 1 次提交
  14. 12 6月, 2012 1 次提交
    • T
      drm/ttm: Fix buffer object metadata accounting regression v2 · a393c730
      Thomas Hellstrom 提交于
      A regression was introduced in the 3.3 rc series, commit
      "drm/ttm: simplify memory accounting for ttm user v2",
      causing the metadata of buffer objects created using the ttm_bo_create()
      function to be accounted twice.
      That causes massive leaks with the vmwgfx driver running for example
      SpecViewperf Catia-03 test 2, eventually killing the app.
      
      Furthermore, the same commit introduces a regression where
      metadata accounting is leaked if a buffer object is
      initialized with an illegal size. This is also fixed with this commit.
      
      v2: Fixed an error path and removed an unused variable.
      Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
      Reviewed-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      a393c730
  15. 02 6月, 2012 1 次提交
  16. 23 5月, 2012 1 次提交
  17. 20 3月, 2012 2 次提交
  18. 26 1月, 2012 1 次提交
    • B
      drm/ttm: fix two regressions since move_notify changes · 9f1feed2
      Ben Skeggs 提交于
      Both changes in dc97b340 cause serious
      regressions in the nouveau driver.
      
      move_notify() was originally able to presume that bo->mem is the old node,
      and new_mem is the new node.  The above commit moves the call to
      move_notify() to after move() has been done, which means that now, sometimes,
      new_mem isn't the new node at all, bo->mem is, and new_mem points at a
      stale, possibly-just-been-killed-by-move node.
      
      This is clearly not a good situation.  This patch reverts this change, and
      replaces it with a cleanup in the move() failure path instead.
      
      The second issue is that the call to move_notify() from cleanup_memtype_use()
      causes the TTM ghost objects to get passed into the driver.  This is clearly
      bad as the driver knows nothing about these "fake" TTM BOs, and ends up
      accessing uninitialised memory.
      
      I worked around this in nouveau's move_notify() hook by ensuring the BO
      destructor was nouveau's.  I don't particularly like this solution, and
      would rather TTM never pass the driver these objects.  However, I don't
      clearly understand the reason why we're calling move_notify() here anyway
      and am happy to work around the problem in nouveau instead of breaking the
      behaviour expected by other drivers.
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      Reviewed-by: NThomas Hellstrom <thellstrom@vmware.com>
      Cc: Jerome Glisse <j.glisse@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      9f1feed2
  19. 13 1月, 2012 1 次提交
    • K
      ttm/dma: Remove the WARN() which is not useful. · 0e113315
      Konrad Rzeszutek Wilk 提交于
      . It was useful during development, but now on a production system
      we can get this (if the user forgot to upload the firmware):
      
      [drm] radeon: irq initialized.
      [drm] GART: num cpu pages 131072, num gpu pages 131072
      [drm] radeon: ib pool ready.
      [drm] Loading SUMO Microcode
      r600_cp: Failed to load firmware "radeon/SUMO_pfp.bin"
      atl1c 0000:03:00.0: version 1.0.1.0-NAPI.213057] [drm:evergreen_startup] *ERROR* Failed to load firmware!
      radeon 0000:00:01.0: disabling GPU acceleration
      88] radeon 0000:00:01.0: ffff8801bb782400 unpin not necessary
      ------------[ cut here ]------------
      WARNING: at /home/konrad/linux-linus/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c:956 ttm_dma_unpopulate+0x79/0x300 [ttm]()
      Hardware name: System Product Name
      Modules linked in: e1000e atl1c radeon(+) ahci libahci libata scsi_mod fbcon tileblit font ttm bitblit softcursor drm_kms_helper wmi xen_blkfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea xenfs xen_privcmd
      Pid: 1600, comm: modprobe Not tainted 3.2.0-06100-ge343a895 #1
      Call Trace:
       [<ffffffff8108973a>] warn_slowpath_common+0x7a/0xb0
       [<ffffffff81089785>] warn_slowpath_null+0x15/0x20
       [<ffffffffa0060309>] ttm_dma_unpopulate+0x79/0x300 [ttm]
       [<ffffffffa01341c0>] radeon_ttm_tt_unpopulate+0x120/0x130 [radeon]
       [<ffffffffa0056e0c>] ttm_tt_destroy+0x2c/0x70 [ttm]
       [<ffffffffa0057a4e>] ttm_bo_cleanup_memtype_use+0x3e/0x80 [ttm]
       [<ffffffffa00595a1>] ttm_bo_release+0x251/0x280 [ttm]
       [<ffffffffa0059610>] ttm_bo_unref+0x40/0x60 [ttm]
       [<ffffffffa0134d02>] radeon_bo_unref+0x42/0x80 [radeon]
       [<ffffffffa0186dfb>] radeon_sa_bo_manager_fini+0x6b/0x80 [radeon]
       [<ffffffffa0146b8f>] radeon_ib_pool_fini+0x6f/0x90 [radeon]
       [<ffffffffa014be49>] r100_ib_fini+0x19/0x20 [radeon]
       [<ffffffffa017b47e>] evergreen_init+0x1ee/0x2d0 [radeon]
      
      The big WARN() has nothing to do with the culprit - which is that
      the firmware was not loaded. So lets remove the WARN() from the TTM DMA code.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: NJerome Glisse <jglisse@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      0e113315
  20. 10 1月, 2012 1 次提交