1. 25 5月, 2011 2 次提交
    • K
      mm: per-node vmstat: show proper vmstats · fa25c503
      KOSAKI Motohiro 提交于
      commit 2ac39037 ("writeback: add
      /sys/devices/system/node/<node>/vmstat") added vmstat entry.  But
      strangely it only show nr_written and nr_dirtied.
      
              # cat /sys/devices/system/node/node20/vmstat
              nr_written 0
              nr_dirtied 0
      
      Of course, It's not adequate.  With this patch, the vmstat show all vm
      stastics as /proc/vmstat.
      
              # cat /sys/devices/system/node/node0/vmstat
      	nr_free_pages 899224
      	nr_inactive_anon 201
      	nr_active_anon 17380
      	nr_inactive_file 31572
      	nr_active_file 28277
      	nr_unevictable 0
      	nr_mlock 0
      	nr_anon_pages 17321
      	nr_mapped 8640
      	nr_file_pages 60107
      	nr_dirty 33
      	nr_writeback 0
      	nr_slab_reclaimable 6850
      	nr_slab_unreclaimable 7604
      	nr_page_table_pages 3105
      	nr_kernel_stack 175
      	nr_unstable 0
      	nr_bounce 0
      	nr_vmscan_write 0
      	nr_writeback_temp 0
      	nr_isolated_anon 0
      	nr_isolated_file 0
      	nr_shmem 260
      	nr_dirtied 1050
      	nr_written 938
      	numa_hit 962872
      	numa_miss 0
      	numa_foreign 0
      	numa_interleave 8617
      	numa_local 962872
      	numa_other 0
      	nr_anon_transparent_hugepages 0
      
      [akpm@linux-foundation.org: no externs in .c files]
      Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Michael Rubin <mrubin@google.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Cc: Randy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fa25c503
    • D
      arch, mm: filter disallowed nodes from arch specific show_mem functions · 7bf02ea2
      David Rientjes 提交于
      Architectures that implement their own show_mem() function did not pass
      the filter argument to show_free_areas() to appropriately avoid emitting
      the state of nodes that are disallowed in the current context.  This patch
      now passes the filter argument to show_free_areas() so those nodes are now
      avoided.
      
      This patch also removes the show_free_areas() wrapper around
      __show_free_areas() and converts existing callers to pass an empty filter.
      
      ia64 emits additional information for each node, so skip_free_areas_zone()
      must be made global to filter disallowed nodes and it is converted to use
      a nid argument rather than a zone for this use case.
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Helge Deller <deller@gmx.de>
      Cc: James Bottomley <jejb@parisc-linux.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7bf02ea2
  2. 24 5月, 2011 2 次提交
  3. 23 5月, 2011 18 次提交
  4. 22 5月, 2011 6 次提交
    • G
      KVM: make guest mode entry to be rcu quiescent state · 8fa22068
      Gleb Natapov 提交于
      KVM does not hold any references to rcu protected data when it switches
      CPU into a guest mode. In fact switching to a guest mode is very similar
      to exiting to userspase from rcu point of view. In addition CPU may stay
      in a guest mode for quite a long time (up to one time slice). Lets treat
      guest mode as quiescent state, just like we do with user-mode execution.
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      8fa22068
    • S
      KVM: PPC: booke: add sregs support · 5ce941ee
      Scott Wood 提交于
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      5ce941ee
    • A
      KVM: Use pci_store/load_saved_state() around VM device usage · f8fcfd77
      Alex Williamson 提交于
      Store the device saved state so that we can reload the device back
      to the original state when it's unassigned.  This has the benefit
      that the state survives across pci_reset_function() calls via
      the PCI sysfs reset interface while the VM is using the device.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Acked-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      f8fcfd77
    • A
      PCI: Add interfaces to store and load the device saved state · ffbdd3f7
      Alex Williamson 提交于
      For KVM device assignment, we'd like to save off the state of a device
      prior to passing it to the guest and restore it later.  We also want
      to allow pci_reset_funciton() to be called while the device is owned
      by the guest.  This however overwrites and invalidates the struct pci_dev
      buffers, so we can't just manually call save and restore.  Add generic
      interfaces for the saved state to be stored and reloaded back into
      struct pci_dev at a later time.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      ffbdd3f7
    • A
      PCI: Track the size of each saved capability data area · 24a4742f
      Alex Williamson 提交于
      This will allow us to store and load it later.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      24a4742f
    • Y
      PCI/e1000e: Add and use pci_disable_link_state_locked() · 9f728f53
      Yinghai Lu 提交于
      Need to use it in _e1000e_disable_aspm.  This routine is used for error
      recovery, where the pci_bus_sem is already held, and we don't want
      pci_disable_link_state to try to take it again.  So add a locked variant
      for use in cases like this.
      
      Found lock up:
      
      [ 2374.654557] kworker/32:1    D ffff881027f6b0f0     0  6075      2 0x00000000
      [ 2374.654816]  ffff88503f099a68 0000000000000046 ffff88503f098000 0000000000004000
      [ 2374.654837]  00000000001d1ec0 ffff88503f099fd8 00000000001d1ec0 ffff88503f099fd8
      [ 2374.654860]  0000000000004000 00000000001d1ec0 ffff88503dcc8000 ffff88503f090000
      [ 2374.654880] Call Trace:
      [ 2374.654898]  [<ffffffff810b1302>] ? __lock_acquired+0x3a/0x224
      [ 2374.654914]  [<ffffffff81c2b59c>] ? _raw_spin_unlock_irq+0x30/0x36
      [ 2374.654925]  [<ffffffff810b069d>] ? trace_hardirqs_on_caller+0x1f/0x178
      [ 2374.654936]  [<ffffffff81c2ab24>] rwsem_down_failed_common+0xd3/0x103
      [ 2374.654945]  [<ffffffff810b158f>] ? __lock_contended+0x3a/0x2a2
      [ 2374.654955]  [<ffffffff81c2ab7b>] rwsem_down_read_failed+0x12/0x14
      [ 2374.654967]  [<ffffffff813371e4>] call_rwsem_down_read_failed+0x14/0x30
      [ 2374.654981]  [<ffffffff8135df20>] ? pci_disable_link_state+0x5f/0xf5
      [ 2374.654990]  [<ffffffff81c2a0e6>] ? down_read+0x7e/0x91
      [ 2374.654999]  [<ffffffff8135df20>] ? pci_disable_link_state+0x5f/0xf5
      [ 2374.655008]  [<ffffffff8135df20>] pci_disable_link_state+0x5f/0xf5
      [ 2374.655024]  [<ffffffff81661796>] e1000e_disable_aspm+0x55/0x5a
      [ 2374.655037]  [<ffffffff816677eb>] e1000_io_slot_reset+0x59/0xea
      [ 2374.655048]  [<ffffffff8135fe0d>] ? report_mmio_enabled+0x5d/0x5d
      [ 2374.655057]  [<ffffffff8135fe3b>] report_slot_reset+0x2e/0x5d
      [ 2374.655072]  [<ffffffff8135369e>] pci_walk_bus+0x8a/0xb7
      [ 2374.655081]  [<ffffffff8135fe0d>] ? report_mmio_enabled+0x5d/0x5d
      [ 2374.655091]  [<ffffffff813603be>] broadcast_error_message+0xa4/0xb2
      [ 2374.655101]  [<ffffffff81352c71>] ? pci_bus_read_config_dword+0x72/0x80
      [ 2374.655110]  [<ffffffff813606df>] do_recovery+0x9e/0xf9
      [ 2374.655120]  [<ffffffff81360786>] handle_error_source+0x4c/0x51
      [ 2374.655129]  [<ffffffff81360974>] aer_isr_one_error+0x1e9/0x21a
      [ 2374.655138]  [<ffffffff81360a6c>] aer_isr+0xc7/0xcc
      [ 2374.655147]  [<ffffffff813609a5>] ? aer_isr_one_error+0x21a/0x21a
      [ 2374.655159]  [<ffffffff81096d9f>] process_one_work+0x237/0x3ec
      [ 2374.655168]  [<ffffffff81096d10>] ? process_one_work+0x1a8/0x3ec
      [ 2374.655178]  [<ffffffff8109728d>] worker_thread+0x17c/0x240
      [ 2374.655186]  [<ffffffff810b0803>] ? trace_hardirqs_on+0xd/0xf
      [ 2374.655196]  [<ffffffff81097111>] ? manage_workers+0xab/0xab
      [ 2374.655209]  [<ffffffff8109c8ed>] kthread+0xa0/0xa8
      [ 2374.655223]  [<ffffffff81c332d4>] kernel_thread_helper+0x4/0x10
      [ 2374.655232]  [<ffffffff81c2b880>] ? retint_restore_args+0xe/0xe
      [ 2374.655243]  [<ffffffff8109c84d>] ? __init_kthread_worker+0x5b/0x5b
      [ 2374.655252]  [<ffffffff81c332d0>] ? gs_change+0xb/0xb
      
      when aer happens,
      pci_walk_bus already have down_read(&pci_bus_sem)...
      then report_slot_reset
              ==> e1000_io_slot_reset
                      ==> e1000e_disable_aspm
                              ==> pci_disable_link_state...
      
      We can not use pci_disable_link_state, and it will try to hold pci_bus_sem again.
      
      Try to have __pci_disable_link_state that will not need to hold pci_bus_sem.
      
      -v2: change name to pci_disable_link_state_locked() according to Jesse.
      
      [jbarnes: make sure new function is exported for modules]
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      9f728f53
  5. 21 5月, 2011 7 次提交
    • C
      slub: Deal with hyperthetical case of PAGE_SIZE > 2M · 3e0c2ab6
      Christoph Lameter 提交于
      kmalloc_index() currently returns -1 if the PAGE_SIZE is larger than 2M
      which seems to cause some concern since the callers do not check for -1.
      
      Insert a BUG() and add a comment to the -1 explaining that the code
      cannot be reached.
      Signed-off-by: NChristoph Lameter <cl@linux.com>
      Signed-off-by: NPekka Enberg <penberg@kernel.org>
      3e0c2ab6
    • A
      [media] DVB: Add basic API support for DVB-T2 and bump minor version · 94d56ffa
      Andreas Oberritter 提交于
      [steve@stevekerrison.com: Remove private definitions from cxd2820r that existed before API was defined]
      Signed-off-by: NAndreas Oberritter <obi@linuxtv.org>
      Signed-off-by: NSteve Kerrison <steve@stevekerrison.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      94d56ffa
    • M
      ARM: 6910/1: MTD: physmap: let set_vpp() pass a platform_device instead of a map_info · 667f390b
      Marc Zyngier 提交于
      The set_vpp() method provided by physmap passes a map_info back to
      the platform code, which has little relevance as far as the platform
      is concerned (this parameter is completely unused).
      
      Instead, pass the platform_device, which can be used in the pismo
      driver to retrieve some important information in a nicer way, instead
      of the hack that was in place.
      
      The empty set_vpp function in board-at572d940hf_ek.c is left untouched,
      as the board/SoC is scheduled for removal.
      
      Cc: Andrew Victor <linux@maxim.org.za>
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Acked-by: NJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
      Cc: Philipp Zabel <philipp.zabel@gmail.com>
      Cc: Eric Miao <eric.y.miao@gmail.com>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Acked-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Acked-by: NDavid Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      667f390b
    • M
      ARM: 6904/1: MTD: Add integrator-flash feature to physmap · b7281ca2
      Marc Zyngier 提交于
      In the process of moving platforms away from integrator-flash
      (aka armflash), add to physmap the few features that make
      armflash unique:
      
      - optionnal probing for the AFS partition type
      - init() and exit() methods, used by Integrator to control
        write access to the various onboard programmable components
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Acked-by: NDavid Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      b7281ca2
    • S
      spinlock_up.h: include asm/processor.h in for cpu_relax · d974d905
      Stephen Rothwell 提交于
      Commit e66eed65 ("list: remove prefetching from regular list
      iterators") removed the include of prefetch.h from list.h and this was a
      path to including asm/processor.h.  We need to include it excplicitly
      now.
      
      Fixes this build error on sparc32 (at least):
      
        In file included from include/linux/seqlock.h:29,
                         from include/linux/time.h:8,
                         from include/linux/timex.h:56,
                         from include/linux/sched.h:57,
                         from arch/sparc/kernel/asm-offsets.c:13:
        include/linux/spinlock.h: In function 'spin_unlock_wait':
        include/linux/spinlock.h:360: error: implicit declaration of function 'cpu_relax
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d974d905
    • L
      sanitize <linux/prefetch.h> usage · 268bb0ce
      Linus Torvalds 提交于
      Commit e66eed65 ("list: remove prefetching from regular list
      iterators") removed the include of prefetch.h from list.h, which
      uncovered several cases that had apparently relied on that rather
      obscure header file dependency.
      
      So this fixes things up a bit, using
      
         grep -L linux/prefetch.h $(git grep -l '[^a-z_]prefetchw*(' -- '*.[ch]')
         grep -L 'prefetchw*(' $(git grep -l 'linux/prefetch.h' -- '*.[ch]')
      
      to guide us in finding files that either need <linux/prefetch.h>
      inclusion, or have it despite not needing it.
      
      There are more of them around (mostly network drivers), but this gets
      many core ones.
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      268bb0ce
    • J
      [media] rc: add locking to fix register/show race · 08aeb7c9
      Jarod Wilson 提交于
      When device_add is called in rc_register_device, the rc sysfs nodes show
      up, and there's a window in which ir-keytable can be launched via udev
      and trigger a show_protocols call, which runs without various rc_dev
      fields filled in yet. Add some locking around registration and
      store/show_protocols to prevent that from happening.
      
      The problem manifests thusly:
      
      [64692.957872] BUG: unable to handle kernel NULL pointer dereference at 0000000000000090
      [64692.957878] IP: [<ffffffffa036a4c1>] show_protocols+0x47/0xf1 [rc_core]
      [64692.957890] PGD 19cfc7067 PUD 19cfc6067 PMD 0
      [64692.957894] Oops: 0000 [#1] SMP
      [64692.957897] last sysfs file: /sys/devices/pci0000:00/0000:00:03.1/usb3/3-1/3-1:1.0/rc/rc2/protocols
      [64692.957902] CPU 3
      [64692.957903] Modules linked in: redrat3(+) ir_lirc_codec lirc_dev ir_sony_decoder ir_jvc_decoder ir_rc6_decoder ir_rc5_decoder rc_hauppauge ir_nec
      _decoder rc_core ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables snd_emu10k1_synth snd_emux_synth snd_seq_virmidi snd_seq_mi
      di_event snd_seq_midi_emul snd_emu10k1 snd_rawmidi snd_ac97_codec ac97_bus snd_seq snd_pcm snd_seq_device snd_timer snd_page_alloc snd_util_mem pcsp
      kr tg3 snd_hwdep emu10k1_gp snd amd64_edac_mod gameport edac_core soundcore edac_mce_amd k8temp shpchp i2c_piix4 lm63 e100 mii uinput ipv6 raid0 rai
      d1 ata_generic firewire_ohci pata_acpi firewire_core crc_itu_t sata_svw pata_serverworks floppy radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core
      [last unloaded: redrat3]
      [64692.957949] [64692.957952] Pid: 12265, comm: ir-keytable Tainted: G   M    W   2.6.39-rc6+ #2 empty empty/TYAN Thunder K8HM S3892
      [64692.957957] RIP: 0010:[<ffffffffa036a4c1>]  [<ffffffffa036a4c1>] show_protocols+0x47/0xf1 [rc_core]
      [64692.957962] RSP: 0018:ffff880194509e38  EFLAGS: 00010202
      [64692.957964] RAX: 0000000000000000 RBX: ffffffffa036d1e0 RCX: ffffffffa036a47a
      [64692.957966] RDX: ffff88019a84d000 RSI: ffffffffa036d1e0 RDI: ffff88019cf2f3f0
      [64692.957969] RBP: ffff880194509e68 R08: 0000000000000002 R09: 0000000000000000
      [64692.957971] R10: 0000000000000002 R11: 0000000000001617 R12: ffff88019a84d000
      [64692.957973] R13: 0000000000001000 R14: ffff8801944d2e38 R15: ffff88019ce5f190
      [64692.957976] FS:  00007f0a30c9a720(0000) GS:ffff88019fc00000(0000) knlGS:0000000000000000
      [64692.957979] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [64692.957981] CR2: 0000000000000090 CR3: 000000019a8e0000 CR4: 00000000000006e0
      [64692.957983] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [64692.957986] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [64692.957989] Process ir-keytable (pid: 12265, threadinfo ffff880194508000, task ffff88019a9fc720)
      [64692.957991] Stack:
      [64692.957992]  0000000000000002 ffffffffa036d1e0 ffff880194509f58 0000000000001000
      [64692.957997]  ffff8801944d2e38 ffff88019ce5f190 ffff880194509e98 ffffffff8131484b
      [64692.958001]  ffffffff8118e923 ffffffff810e9b2f ffff880194509e98 ffff8801944d2e18
      [64692.958005] Call Trace:
      [64692.958014]  [<ffffffff8131484b>] dev_attr_show+0x27/0x4e
      [64692.958014]  [<ffffffff8118e923>] ? sysfs_read_file+0x94/0x172
      [64692.958014]  [<ffffffff810e9b2f>] ? __get_free_pages+0x16/0x52
      [64692.958014]  [<ffffffff8118e94c>] sysfs_read_file+0xbd/0x172
      [64692.958014]  [<ffffffff8113205e>] vfs_read+0xac/0xf3
      [64692.958014]  [<ffffffff8113347b>] ? fget_light+0x3a/0xa1
      [64692.958014]  [<ffffffff811320f2>] sys_read+0x4d/0x74
      [64692.958014]  [<ffffffff814c19c2>] system_call_fastpath+0x16/0x1b
      
      Its a bit difficult to reproduce, but I'm fairly confident this has
      fixed the problem.
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      08aeb7c9
  6. 20 5月, 2011 5 次提交