1. 23 2月, 2013 1 次提交
  2. 11 1月, 2013 1 次提交
    • D
      drm/i915: Revert shrinker changes from "Track unbound pages" · 93927ca5
      Daniel Vetter 提交于
      This partially reverts
      
      commit 6c085a72
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Mon Aug 20 11:40:46 2012 +0200
      
          drm/i915: Track unbound pages
      
      Closer inspection of that patch revealed a bunch of unrelated changes
      in the shrinker:
      - The shrinker count is now in pages instead of objects.
      - For counting the shrinkable objects the old code only looked at the
        inactive list, the new code looks at all bounds objects (including
        pinned ones). That is obviously in addition to the new unbound list.
      - The shrinker cound is no longer scaled with
        sysctl_vfs_cache_pressure. Note though that with the default tuning
        value of vfs_cache_pressue = 100 this doesn't affect the shrinker
        behaviour.
      - When actually shrinking objects, the old code first dropped
        purgeable objects, then normal (inactive) objects. Only then did it,
        in a last-ditch effort idle the gpu and evict everything. The new
        code omits the intermediate step of evicting normal inactive
        objects.
      
      Safe for the first change, which seems benign, and the shrinker count
      scaling, which is a bit a different story, the endresult of all these
      changes is that the shrinker is _much_ more likely to fall back to the
      last-ditch resort of idling the gpu and evicting everything.  The old
      code could only do that if something else evicted lots of objects
      meanwhile (since without any other changes the nr_to_scan will be
      smaller than the object count).
      
      Reverting the vfs_cache_pressure behaviour itself is a bit bogus: Only
      dentry/inode object caches should scale their shrinker counts with
      vfs_cache_pressure. Originally I've had that change reverted, too. But
      Chris Wilson insisted that it's too bogus and shouldn't again see the
      light of day.
      
      Hence revert all these other changes and restore the old shrinker
      behaviour, with the minor adjustment that we now first scan the
      unbound list, then the inactive list for each object category
      (purgeable or normal).
      
      A similar patch has been tested by a few people affected by the gen4/5
      hangs which started to appear in 3.7, which some people bisected to
      the "drm/i915: Track unbound pages" commit. But just disabling the
      unbound logic alone didn't change things at all.
      
      Note that this patch doesn't fix the referenced bugs, it only hides
      the underlying bug(s) well enough to restore pre-3.7 behaviour. The
      key to achieve that is to massively reduce the likelyhood of going
      into a full gpu stall and evicting everything.
      
      v2: Reword commit message a bit, taking Chris Wilson's comment into
      account.
      
      v3: On Chris Wilson's insistency, do not reinstate the rather bogus
      vfs_cache_pressure change.
      Tested-by: NGreg KH <gregkh@linuxfoundation.org>
      Tested-by: NDave Kleikamp <dave.kleikamp@oracle.com>
      References: https://bugs.freedesktop.org/show_bug.cgi?id=55984
      References: https://bugs.freedesktop.org/show_bug.cgi?id=57122
      References: https://bugs.freedesktop.org/show_bug.cgi?id=56916
      References: https://bugs.freedesktop.org/show_bug.cgi?id=57136
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@vger.kernel.org
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      93927ca5
  3. 07 1月, 2013 1 次提交
  4. 20 12月, 2012 2 次提交
    • D
      drm/i915: disable shrinker lock stealing for create_mmap_offset · da494d7c
      Daniel Vetter 提交于
      The mmap offset structure is not part of the drm/i915 code, but
      provided by gem helpers. To avoid leaky abstractions (by either
      depending upon implementation details of said helper wrt to
      preallocations, or reimplementing it in our code and so fuzzing
      around in internal details of that helpr) simply disable
      the shrinker lock stealing accross calls into the helper functions.
      
      This should fix igt/gem_tiled_swapping.
      
      v2: Fix cleanup path confusion bemoaned by Chris Wilson.
      Reported-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      da494d7c
    • D
      drm/i915: optionally disable shrinker lock stealing · 677feac2
      Daniel Vetter 提交于
      commit 5774506f
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Wed Nov 21 13:04:04 2012 +0000
      
          drm/i915: Borrow our struct_mutex for the direct reclaim
      
      added a nice trick to steal the struct_mutex lock in the shrinker if
      it's the current task holding it. But this also caused the requirement
      that every place which allocates memory needs to be careful about the
      gem state of objects, since the shrinker could have pulled the rug out
      from under it. We've usually solved this by carefully preallocating
      things or ensure that buffers are pinned already.
      
      But the shrinker also reaps mmap offset, so allocating those needs to
      be careful, too. Now that code has been factored out into some common
      helpers, so either we have fragile code depending upon the common
      helper not doing something we don't want it to do. Or we need to
      reimplement the mmap offset creation and so also leak implementation
      details into our code.
      
      Since this all results in leaky abstraction, cop out by disabling the
      lock borrowing trick while calling down into the helpers. That way our
      craziness is nicely confined to files in drm/i915.
      
      v2: Split out the change to create_mmap_offset as request by Chris Wilson.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      677feac2
  5. 19 12月, 2012 1 次提交
  6. 11 12月, 2012 1 次提交
    • L
      Revert "revert "Revert "mm: remove __GFP_NO_KSWAPD""" and associated damage · caf49191
      Linus Torvalds 提交于
      This reverts commits a5091539 and
      d7c3b937.
      
      This is a revert of a revert of a revert.  In addition, it reverts the
      even older i915 change to stop using the __GFP_NO_KSWAPD flag due to the
      original commits in linux-next.
      
      It turns out that the original patch really was bogus, and that the
      original revert was the correct thing to do after all.  We thought we
      had fixed the problem, and then reverted the revert, but the problem
      really is fundamental: waking up kswapd simply isn't the right thing to
      do, and direct reclaim sometimes simply _is_ the right thing to do.
      
      When certain allocations fail, we simply should try some direct reclaim,
      and if that fails, fail the allocation.  That's the right thing to do
      for THP allocations, which can easily fail, and the GPU allocations want
      to do that too.
      
      So starting kswapd is sometimes simply wrong, and removing the flag that
      said "don't start kswapd" was a mistake.  Let's hope we never revisit
      this mistake again - and certainly not this many times ;)
      Acked-by: NMel Gorman <mgorman@suse.de>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      caf49191
  7. 04 12月, 2012 1 次提交
  8. 29 11月, 2012 5 次提交
  9. 22 11月, 2012 4 次提交
  10. 12 11月, 2012 3 次提交
    • B
      drm/i915: Move the remaining gtt code · 26b1ff35
      Ben Widawsky 提交于
      It's pretty much all consolidated now that we've killed AGP. We can move
      the one outlier, and defines too.
      
      (Kill some unused defines in the process)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      26b1ff35
    • B
      drm/i915: Stop using AGP layer for GEN6+ · e76e9aeb
      Ben Widawsky 提交于
      As a quick hack we make the old intel_gtt structure mutable so we can
      fool a bunch of the existing code which depends on elements in that data
      structure. We can/should try to remove this in a subsequent patch.
      
      This should preserve the old gtt init behavior which upon writing these
      patches seems incorrect. The next patch will fix these things.
      
      The one exception is VLV which doesn't have the preserved flush control
      write behavior. Since we want to do that for all GEN6+ stuff, we'll
      handle that in a later patch. Mainstream VLV support doesn't actually
      exist yet anyway.
      
      v2: Update the comment to remove the "voodoo"
      Check that the last pte written matches what we readback
      
      v3: actually kill cache_level_to_agp_type since most of the flags will
      disappear in an upcoming patch
      
      v4: v3 was actually not what we wanted (Daniel)
      Make the ggtt bind assertions better and stricter (Chris)
      Fix some uncaught errors at gtt init (Chris)
      Some other random stuff that Chris wanted
      
      v5: check for i==0 in gen6_ggtt_bind_object to shut up gcc (Ben)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by [v4]: Chris Wilson <chris@chris-wilson.co.uk>
      [danvet: Make the cache_level -> agp_flags conversion for pre-gen6 a
      tad more robust by mapping everything != CACHE_NONE to the cached agp
      flag - we have a 1:1 uncached mapping, but different modes of
      cacheable (at least on later generations). Suggested by Chris Wilson.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e76e9aeb
    • D
      drm/i915: extract l3_parity substruct from dev_priv · a4da4fa4
      Daniel Vetter 提交于
      Pretty astonishing how far apart these two members landed ... Especially since
      I've already removed almost 200 lines in between.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a4da4fa4
  11. 20 10月, 2012 1 次提交
  12. 17 10月, 2012 1 次提交
  13. 12 10月, 2012 2 次提交
  14. 09 10月, 2012 2 次提交
  15. 08 10月, 2012 1 次提交
    • W
      drm/i915: remove useless BUG_ON which caused a regression in 3.5. · c77d7162
      Willy Tarreau 提交于
      starting an old X server causes a kernel BUG since commit 1b50247a:
      
      ------------[ cut here ]------------
      kernel BUG at drivers/gpu/drm/i915/i915_gem.c:3661!
      invalid opcode: 0000 [#1] SMP
      Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss uvcvideo
      +videobuf2_core videodev videobuf2_vmalloc videobuf2_memops uhci_hcd ath9k mac80211 snd_hda_codec_realtek ath9k_common microcode
      +ath9k_hw psmouse serio_raw sg ath cfg80211 atl1c lpc_ich mfd_core ehci_hcd snd_hda_intel snd_hda_codec snd_hwdep snd_pcm rtc_cmos
      +snd_timer snd evdev eeepc_laptop snd_page_alloc sparse_keymap
      
      Pid: 2866, comm: X Not tainted 3.5.6-rc1-eeepc #1 ASUSTeK Computer INC. 1005HA/1005HA
      EIP: 0060:[<c12dc291>] EFLAGS: 00013297 CPU: 0
      EIP is at i915_gem_entervt_ioctl+0xf1/0x110
      EAX: f5941df4 EBX: f5940000 ECX: 00000000 EDX: 00020000
      ESI: f5835400 EDI: 00000000 EBP: f51d7e38 ESP: f51d7e20
       DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      CR0: 8005003b CR2: b760e0a0 CR3: 351b6000 CR4: 000007d0
      DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
      DR6: ffff0ff0 DR7: 00000400
      Process X (pid: 2866, ti=f51d6000 task=f61af8d0 task.ti=f51d6000)
      Stack:
       00000001 00000000 f5835414 f51d7e84 f5835400 f54f85c0 f51d7f10 c12b530b
       00000001 c151b139 c14751b6 c152e030 00000b32 00006459 00000059 0000e200
       00000001 00000000 00006459 c159ddd0 c12dc1a0 ffffffea 00000000 00000000
      Call Trace:
       [<c12b530b>] drm_ioctl+0x2eb/0x440
       [<c12dc1a0>] ? i915_gem_init+0xe0/0xe0
       [<c1052b2b>] ? enqueue_hrtimer+0x1b/0x50
       [<c1053321>] ? __hrtimer_start_range_ns+0x161/0x330
       [<c10530b3>] ? lock_hrtimer_base+0x23/0x50
       [<c1053163>] ? hrtimer_try_to_cancel+0x33/0x70
       [<c12b5020>] ? drm_version+0x90/0x90
       [<c10ca171>] vfs_ioctl+0x31/0x50
       [<c10ca2e4>] do_vfs_ioctl+0x64/0x510
       [<c10535de>] ? hrtimer_nanosleep+0x8e/0x100
       [<c1052c20>] ? update_rmtp+0x80/0x80
       [<c10ca7c9>] sys_ioctl+0x39/0x60
       [<c1433949>] syscall_call+0x7/0xb
      Code: 83 c4 0c 5b 5e 5f 5d c3 c7 44 24 04 2c 05 53 c1 c7 04 24 6f ef 47 c1 e8 6e e0 fd ff c7 83 38 1e 00 00 00 00 00 00 e9 3f ff ff
      +ff <0f> 0b eb fe 0f 0b eb fe 8d b4 26 00 00 00 00 0f 0b eb fe 8d b6
      EIP: [<c12dc291>] i915_gem_entervt_ioctl+0xf1/0x110 SS:ESP 0068:f51d7e20
      ---[ end trace dd332ec083cbd513 ]---
      
      The crash happens here in i915_gem_entervt_ioctl() :
      
          3659          BUG_ON(!list_empty(&dev_priv->mm.active_list));
          3660          BUG_ON(!list_empty(&dev_priv->mm.flushing_list));
       -> 3661          BUG_ON(!list_empty(&dev_priv->mm.inactive_list));
          3662          mutex_unlock(&dev->struct_mutex);
      
      Quoting Chris :
        "That BUG_ON there is silly and can simply be removed. The check is to
         verify that no batches were submitted to the kernel whilst the UMS/GEM
         client was suspended - to which the BUG_ONs are a crude approximation.
         Furthermore, the checks are too late, since it means we attempted to
         program the hardware whilst it was in an invalid state, the BUG_ONs are
         the least of your concerns at that point."
      
      Note that this regression has been introduced in
      
      commit 1b50247a
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Tue Apr 24 15:47:30 2012 +0100
      
          drm/i915: Remove the list of pinned inactive objects
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NWilly Tarreau <w@1wt.eu>
      [danvet: Added note about the regressing commit and cc: stable.]
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c77d7162
  16. 04 10月, 2012 2 次提交
  17. 03 10月, 2012 2 次提交
  18. 27 9月, 2012 1 次提交
  19. 26 9月, 2012 1 次提交
  20. 20 9月, 2012 6 次提交
  21. 17 9月, 2012 1 次提交