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

bug.h

Blame
  • zsmalloc.c 60.42 KiB
    /*
     * zsmalloc memory allocator
     *
     * Copyright (C) 2011  Nitin Gupta
     * Copyright (C) 2012, 2013 Minchan Kim
     *
     * This code is released using a dual license strategy: BSD/GPL
     * You can choose the license that better fits your requirements.
     *
     * Released under the terms of 3-clause BSD License
     * Released under the terms of GNU General Public License Version 2.0
     */
    
    /*
     * Following is how we use various fields and flags of underlying
     * struct page(s) to form a zspage.
     *
     * Usage of struct page fields:
     *	page->private: points to zspage
     *	page->freelist(index): links together all component pages of a zspage
     *		For the huge page, this is always 0, so we use this field
     *		to store handle.
     *
     * Usage of struct page flags:
     *	PG_private: identifies the first component page
     *	PG_private2: identifies the last component page
     *	PG_owner_priv_1: indentifies the huge component page
     *
     */
    
    #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    
    #include <linux/module.h>
    #include <linux/kernel.h>
    #include <linux/sched.h>
    #include <linux/bitops.h>
    #include <linux/errno.h>
    #include <linux/highmem.h>
    #include <linux/string.h>
    #include <linux/slab.h>
    #include <asm/tlbflush.h>
    #include <asm/pgtable.h>
    #include <linux/cpumask.h>
    #include <linux/cpu.h>
    #include <linux/vmalloc.h>
    #include <linux/preempt.h>
    #include <linux/spinlock.h>
    #include <linux/types.h>
    #include <linux/debugfs.h>
    #include <linux/zsmalloc.h>
    #include <linux/zpool.h>
    #include <linux/mount.h>
    #include <linux/compaction.h>
    #include <linux/pagemap.h>
    
    #define ZSPAGE_MAGIC	0x58
    
    /*
     * This must be power of 2 and greater than of equal to sizeof(link_free).
     * These two conditions ensure that any 'struct link_free' itself doesn't
     * span more than 1 page which avoids complex case of mapping 2 pages simply
     * to restore link_free pointer values.
     */
    #define ZS_ALIGN		8
    
    /*
     * A single 'zspage' is composed of up to 2^N discontiguous 0-order (single)
     * pages. ZS_MAX_ZSPAGE_ORDER defines upper limit on N.
     */
    #define ZS_MAX_ZSPAGE_ORDER 2