Skip to content
Snippets Groups Projects
Select Git revision
  • 2acb9bdae92d0662cd4fa11c481e80b6202b5630
  • 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

cpufreq.c

Blame
  • pageattr.c 48.04 KiB
    /*
     * Copyright 2002 Andi Kleen, SuSE Labs.
     * Thanks to Ben LaHaise for precious feedback.
     */
    #include <linux/highmem.h>
    #include <linux/bootmem.h>
    #include <linux/sched.h>
    #include <linux/mm.h>
    #include <linux/interrupt.h>
    #include <linux/seq_file.h>
    #include <linux/debugfs.h>
    #include <linux/pfn.h>
    #include <linux/percpu.h>
    #include <linux/gfp.h>
    #include <linux/pci.h>
    #include <linux/vmalloc.h>
    
    #include <asm/e820.h>
    #include <asm/processor.h>
    #include <asm/tlbflush.h>
    #include <asm/sections.h>
    #include <asm/setup.h>
    #include <linux/uaccess.h>
    #include <asm/pgalloc.h>
    #include <asm/proto.h>
    #include <asm/pat.h>
    
    /*
     * The current flushing context - we pass it instead of 5 arguments:
     */
    struct cpa_data {
    	unsigned long	*vaddr;
    	pgd_t		*pgd;
    	pgprot_t	mask_set;
    	pgprot_t	mask_clr;
    	unsigned long	numpages;
    	int		flags;
    	unsigned long	pfn;
    	unsigned	force_split : 1;
    	int		curpage;
    	struct page	**pages;
    };
    
    /*
     * Serialize cpa() (for !DEBUG_PAGEALLOC which uses large identity mappings)
     * using cpa_lock. So that we don't allow any other cpu, with stale large tlb
     * entries change the page attribute in parallel to some other cpu
     * splitting a large page entry along with changing the attribute.
     */
    static DEFINE_SPINLOCK(cpa_lock);
    
    #define CPA_FLUSHTLB 1
    #define CPA_ARRAY 2
    #define CPA_PAGES_ARRAY 4
    
    #ifdef CONFIG_PROC_FS
    static unsigned long direct_pages_count[PG_LEVEL_NUM];
    
    void update_page_count(int level, unsigned long pages)
    {
    	/* Protect against CPA */
    	spin_lock(&pgd_lock);
    	direct_pages_count[level] += pages;
    	spin_unlock(&pgd_lock);
    }
    
    static void split_page_count(int level)
    {
    	if (direct_pages_count[level] == 0)
    		return;