Skip to content
Snippets Groups Projects
Select Git revision
  • 3c3caae4cd6e122472efcf64759ff6392fb6bce2
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

dwc3-pci.c

Blame
  • vmstat.c 47.33 KiB
    /*
     *  linux/mm/vmstat.c
     *
     *  Manages VM statistics
     *  Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
     *
     *  zoned VM statistics
     *  Copyright (C) 2006 Silicon Graphics, Inc.,
     *		Christoph Lameter <christoph@lameter.com>
     *  Copyright (C) 2008-2014 Christoph Lameter
     */
    #include <linux/fs.h>
    #include <linux/mm.h>
    #include <linux/err.h>
    #include <linux/module.h>
    #include <linux/slab.h>
    #include <linux/cpu.h>
    #include <linux/cpumask.h>
    #include <linux/vmstat.h>
    #include <linux/proc_fs.h>
    #include <linux/seq_file.h>
    #include <linux/debugfs.h>
    #include <linux/sched.h>
    #include <linux/math64.h>
    #include <linux/writeback.h>
    #include <linux/compaction.h>
    #include <linux/mm_inline.h>
    #include <linux/page_ext.h>
    #include <linux/page_owner.h>
    
    #include "internal.h"
    
    #ifdef CONFIG_VM_EVENT_COUNTERS
    DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}};
    EXPORT_PER_CPU_SYMBOL(vm_event_states);
    
    static void sum_vm_events(unsigned long *ret)
    {
    	int cpu;
    	int i;
    
    	memset(ret, 0, NR_VM_EVENT_ITEMS * sizeof(unsigned long));
    
    	for_each_online_cpu(cpu) {
    		struct vm_event_state *this = &per_cpu(vm_event_states, cpu);
    
    		for (i = 0; i < NR_VM_EVENT_ITEMS; i++)
    			ret[i] += this->event[i];
    	}
    }
    
    /*
     * Accumulate the vm event counters across all CPUs.
     * The result is unavoidably approximate - it can change
     * during and after execution of this function.
    */
    void all_vm_events(unsigned long *ret)
    {
    	get_online_cpus();
    	sum_vm_events(ret);
    	put_online_cpus();
    }
    EXPORT_SYMBOL_GPL(all_vm_events);
    
    /*
     * Fold the foreign cpu events into our own.
     *
     * This is adding to the events on one processor
     * but keeps the global counts constant.
     */