1. 07 12月, 2017 7 次提交
  2. 30 11月, 2017 1 次提交
  3. 24 11月, 2017 1 次提交
    • D
      drm/ttm: don't attempt to use hugepages if dma32 requested (v2) · 33d22c2e
      Dave Airlie 提交于
      The commit below introduced thp support for ttm allocations, however it didn't
      take into account the case where dma32 was requested. Some drivers always request
      dma32, and the bochs driver is one of those.
      
      This fixes an oops:
      
      [   30.108507] ------------[ cut here ]------------
      [   30.108920] kernel BUG at ./include/linux/gfp.h:408!
      [   30.109356] invalid opcode: 0000 [#1] SMP
      [   30.109700] Modules linked in: fuse nf_conntrack_netbios_ns nf_conntrack_broadcast xt_CT ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack devlink ip_set nfnetlink ebtable_nat ebtable_broute bridge ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack libcrc32c iptable_mangle iptable_raw iptable_security ebtable_filter ebtables ip6table_filter ip6_tables snd_hda_codec_generic kvm_intel kvm snd_hda_intel snd_hda_codec irqbypass ppdev snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm bochs_drm ttm joydev drm_kms_helper virtio_balloon snd_timer snd parport_pc drm soundcore parport i2c_piix4 nls_utf8 isofs squashfs zstd_decompress xxhash 8021q garp mrp stp llc virtio_net
      [   30.115605]  virtio_console virtio_scsi crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel serio_raw virtio_pci virtio_ring virtio ata_generic pata_acpi qemu_fw_cfg sunrpc scsi_transport_iscsi loop
      [   30.117425] CPU: 0 PID: 1347 Comm: gnome-shell Not tainted 4.15.0-0.rc0.git6.1.fc28.x86_64 #1
      [   30.118141] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014
      [   30.118866] task: ffff923a77e03380 task.stack: ffffa78182228000
      [   30.119366] RIP: 0010:__alloc_pages_nodemask+0x35e/0x430
      [   30.119810] RSP: 0000:ffffa7818222bba8 EFLAGS: 00010202
      [   30.120250] RAX: 0000000000000001 RBX: 00000000014382c6 RCX: 0000000000000006
      [   30.120840] RDX: 0000000000000000 RSI: 0000000000000009 RDI: 0000000000000000
      [   30.121443] RBP: ffff923a760d6000 R08: 0000000000000000 R09: 0000000000000006
      [   30.122039] R10: 0000000000000040 R11: 0000000000000300 R12: ffff923a729273c0
      [   30.122629] R13: 0000000000000000 R14: 0000000000000000 R15: ffff923a7483d400
      [   30.123223] FS:  00007fe48da7dac0(0000) GS:ffff923a7cc00000(0000) knlGS:0000000000000000
      [   30.123896] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   30.124373] CR2: 00007fe457b73000 CR3: 0000000078313000 CR4: 00000000000006f0
      [   30.124968] Call Trace:
      [   30.125186]  ttm_pool_populate+0x19b/0x400 [ttm]
      [   30.125578]  ttm_bo_vm_fault+0x325/0x570 [ttm]
      [   30.125964]  __do_fault+0x19/0x11e
      [   30.126255]  __handle_mm_fault+0xcd3/0x1260
      [   30.126609]  handle_mm_fault+0x14c/0x310
      [   30.126947]  __do_page_fault+0x28c/0x530
      [   30.127282]  do_page_fault+0x32/0x270
      [   30.127593]  async_page_fault+0x22/0x30
      [   30.127922] RIP: 0033:0x7fe48aae39a8
      [   30.128225] RSP: 002b:00007ffc21c4d928 EFLAGS: 00010206
      [   30.128664] RAX: 00007fe457b73000 RBX: 000055cd4c1041a0 RCX: 00007fe457b73040
      [   30.129259] RDX: 0000000000300000 RSI: 0000000000000000 RDI: 00007fe457b73000
      [   30.129855] RBP: 0000000000000300 R08: 000000000000000c R09: 0000000100000000
      [   30.130457] R10: 0000000000000001 R11: 0000000000000246 R12: 000055cd4c1041a0
      [   30.131054] R13: 000055cd4bdfe990 R14: 000055cd4c104110 R15: 0000000000000400
      [   30.131648] Code: 11 01 00 0f 84 a9 00 00 00 65 ff 0d 6d cc dd 44 e9 0f ff ff ff 40 80 cd 80 e9 99 fe ff ff 48 89 c7 e8 e7 f6 01 00 e9 b7 fe ff ff <0f> 0b 0f ff e9 40 fd ff ff 65 48 8b 04 25 80 d5 00 00 8b 40 4c
      [   30.133245] RIP: __alloc_pages_nodemask+0x35e/0x430 RSP: ffffa7818222bba8
      [   30.133836] ---[ end trace d4f1deb60784f40a ]---
      
      v2: handle free path as well.
      Reported-by: NLaura Abbott <labbott@redhat.com>
      Reported-by: NAdam Williamson <awilliam@redhat.com>
      Fixes: 0284f1ea (drm/ttm: add transparent huge page support for cached allocations v2)
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      33d22c2e
  4. 04 11月, 2017 1 次提交
  5. 20 10月, 2017 5 次提交
  6. 10 10月, 2017 2 次提交
  7. 07 10月, 2017 2 次提交
  8. 13 9月, 2017 1 次提交
  9. 30 8月, 2017 1 次提交
  10. 18 8月, 2017 1 次提交
  11. 09 5月, 2017 1 次提交
  12. 30 3月, 2016 1 次提交
  13. 20 11月, 2014 1 次提交
    • T
      drm/ttm: Avoid memory allocation from shrinker functions. · 881fdaa5
      Tetsuo Handa 提交于
      Andrew Morton wrote:
      > On Wed, 12 Nov 2014 13:08:55 +0900 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote:
      >
      > > Andrew Morton wrote:
      > > > Poor ttm guys - this is a bit of a trap we set for them.
      > >
      > > Commit a91576d7 ("drm/ttm: Pass GFP flags in order to avoid deadlock.")
      > > changed to use sc->gfp_mask rather than GFP_KERNEL.
      > >
      > > -       pages_to_free = kmalloc(npages_to_free * sizeof(struct page *),
      > > -                       GFP_KERNEL);
      > > +       pages_to_free = kmalloc(npages_to_free * sizeof(struct page *), gfp);
      > >
      > > But this bug is caused by sc->gfp_mask containing some flags which are not
      > > in GFP_KERNEL, right? Then, I think
      > >
      > > -       pages_to_free = kmalloc(npages_to_free * sizeof(struct page *), gfp);
      > > +       pages_to_free = kmalloc(npages_to_free * sizeof(struct page *), gfp & GFP_KERNEL);
      > >
      > > would hide this bug.
      > >
      > > But I think we should use GFP_ATOMIC (or drop __GFP_WAIT flag)
      >
      > Well no - ttm_page_pool_free() should stop calling kmalloc altogether.
      > Just do
      >
      > 	struct page *pages_to_free[16];
      >
      > and rework the code to free 16 pages at a time.  Easy.
      
      Well, ttm code wants to process 512 pages at a time for performance.
      Memory footprint increased by 512 * sizeof(struct page *) buffer is
      only 4096 bytes. What about using static buffer like below?
      ----------
      >From d3cb5393c9c8099d6b37e769f78c31af1541fe8c Mon Sep 17 00:00:00 2001
      From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Date: Thu, 13 Nov 2014 22:21:54 +0900
      Subject: [PATCH] drm/ttm: Avoid memory allocation from shrinker functions.
      
      Commit a91576d7 ("drm/ttm: Pass GFP flags in order to avoid
      deadlock.") caused BUG_ON() due to sc->gfp_mask containing flags
      which are not in GFP_KERNEL.
      
        https://bugzilla.kernel.org/show_bug.cgi?id=87891
      
      Changing from sc->gfp_mask to (sc->gfp_mask & GFP_KERNEL) would
      avoid the BUG_ON(), but avoiding memory allocation from shrinker
      function is better and reliable fix.
      
      Shrinker function is already serialized by global lock, and
      clean up function is called after shrinker function is unregistered.
      Thus, we can use static buffer when called from shrinker function
      and clean up function.
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: stable <stable@kernel.org> [2.6.35+]
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      881fdaa5
  14. 05 8月, 2014 2 次提交
  15. 22 7月, 2014 1 次提交
  16. 11 9月, 2013 1 次提交
    • D
      drivers: convert shrinkers to new count/scan API · 7dc19d5a
      Dave Chinner 提交于
      Convert the driver shrinkers to the new API.  Most changes are compile
      tested only because I either don't have the hardware or it's staging
      stuff.
      
      FWIW, the md and android code is pretty good, but the rest of it makes me
      want to claw my eyes out.  The amount of broken code I just encountered is
      mind boggling.  I've added comments explaining what is broken, but I fear
      that some of the code would be best dealt with by being dragged behind the
      bike shed, burying in mud up to it's neck and then run over repeatedly
      with a blunt lawn mower.
      
      Special mention goes to the zcache/zcache2 drivers.  They can't co-exist
      in the build at the same time, they are under different menu options in
      menuconfig, they only show up when you've got the right set of mm
      subsystem options configured and so even compile testing is an exercise in
      pulling teeth.  And that doesn't even take into account the horrible,
      broken code...
      
      [glommer@openvz.org: fixes for i915, android lowmem, zcache, bcache]
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Signed-off-by: NGlauber Costa <glommer@openvz.org>
      Acked-by: NMel Gorman <mgorman@suse.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Kent Overstreet <koverstreet@google.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Cc: Arve Hjønnevåg <arve@android.com>
      Cc: Carlos Maiolino <cmaiolino@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Chuck Lever <chuck.lever@oracle.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Gleb Natapov <gleb@redhat.com>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: J. Bruce Fields <bfields@redhat.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Kent Overstreet <koverstreet@google.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      7dc19d5a
  17. 16 11月, 2012 1 次提交
  18. 03 10月, 2012 1 次提交
  19. 20 3月, 2012 1 次提交
  20. 06 12月, 2011 3 次提交
  21. 27 7月, 2011 1 次提交
  22. 21 6月, 2011 1 次提交
  23. 25 5月, 2011 1 次提交
  24. 13 4月, 2011 1 次提交
  25. 23 2月, 2011 1 次提交