You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'akpm' (patches from Andrew)
Merge first patch-bomb from Andrew Morton: - some misc things - ofs2 updates - about half of MM - checkpatch updates - autofs4 update * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (120 commits) autofs4: fix string.h include in auto_dev-ioctl.h autofs4: use pr_xxx() macros directly for logging autofs4: change log print macros to not insert newline autofs4: make autofs log prints consistent autofs4: fix some white space errors autofs4: fix invalid ioctl return in autofs4_root_ioctl_unlocked() autofs4: fix coding style line length in autofs4_wait() autofs4: fix coding style problem in autofs4_get_set_timeout() autofs4: coding style fixes autofs: show pipe inode in mount options kallsyms: add support for relative offsets in kallsyms address table kallsyms: don't overload absolute symbol type for percpu symbols x86: kallsyms: disable absolute percpu symbols on !SMP checkpatch: fix another left brace warning checkpatch: improve UNSPECIFIED_INT test for bare signed/unsigned uses checkpatch: warn on bare unsigned or signed declarations without int checkpatch: exclude asm volatile from complex macro check mm: memcontrol: drop unnecessary lru locking from mem_cgroup_migrate() mm: migrate: consolidate mem_cgroup_migrate() calls mm/compaction: speed up pageblock_pfn_to_page() when zone is contiguous ...
This commit is contained in:
@@ -1759,7 +1759,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
|||||||
|
|
||||||
keepinitrd [HW,ARM]
|
keepinitrd [HW,ARM]
|
||||||
|
|
||||||
kernelcore=nn[KMG] [KNL,X86,IA-64,PPC] This parameter
|
kernelcore= [KNL,X86,IA-64,PPC]
|
||||||
|
Format: nn[KMGTPE] | "mirror"
|
||||||
|
This parameter
|
||||||
specifies the amount of memory usable by the kernel
|
specifies the amount of memory usable by the kernel
|
||||||
for non-movable allocations. The requested amount is
|
for non-movable allocations. The requested amount is
|
||||||
spread evenly throughout all nodes in the system. The
|
spread evenly throughout all nodes in the system. The
|
||||||
@@ -1775,6 +1777,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
|||||||
use the HighMem zone if it exists, and the Normal
|
use the HighMem zone if it exists, and the Normal
|
||||||
zone if it does not.
|
zone if it does not.
|
||||||
|
|
||||||
|
Instead of specifying the amount of memory (nn[KMGTPE]),
|
||||||
|
you can specify "mirror" option. In case "mirror"
|
||||||
|
option is specified, mirrored (reliable) memory is used
|
||||||
|
for non-movable allocations and remaining memory is used
|
||||||
|
for Movable pages. nn[KMGTPE] and "mirror" are exclusive,
|
||||||
|
so you can NOT specify nn[KMGTPE] and "mirror" at the same
|
||||||
|
time.
|
||||||
|
|
||||||
kgdbdbgp= [KGDB,HW] kgdb over EHCI usb debug port.
|
kgdbdbgp= [KGDB,HW] kgdb over EHCI usb debug port.
|
||||||
Format: <Controller#>[,poll interval]
|
Format: <Controller#>[,poll interval]
|
||||||
The controller # is the number of the ehci usb debug
|
The controller # is the number of the ehci usb debug
|
||||||
@@ -2732,6 +2742,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
|||||||
we can turn it on.
|
we can turn it on.
|
||||||
on: enable the feature
|
on: enable the feature
|
||||||
|
|
||||||
|
page_poison= [KNL] Boot-time parameter changing the state of
|
||||||
|
poisoning on the buddy allocator.
|
||||||
|
off: turn off poisoning
|
||||||
|
on: turn on poisoning
|
||||||
|
|
||||||
panic= [KNL] Kernel behaviour on panic: delay <timeout>
|
panic= [KNL] Kernel behaviour on panic: delay <timeout>
|
||||||
timeout > 0: seconds before rebooting
|
timeout > 0: seconds before rebooting
|
||||||
timeout = 0: wait forever
|
timeout = 0: wait forever
|
||||||
|
|||||||
@@ -256,10 +256,27 @@ If the memory block is offline, you'll read "offline".
|
|||||||
|
|
||||||
5.2. How to online memory
|
5.2. How to online memory
|
||||||
------------
|
------------
|
||||||
Even if the memory is hot-added, it is not at ready-to-use state.
|
When the memory is hot-added, the kernel decides whether or not to "online"
|
||||||
For using newly added memory, you have to "online" the memory block.
|
it according to the policy which can be read from "auto_online_blocks" file:
|
||||||
|
|
||||||
For onlining, you have to write "online" to the memory block's state file as:
|
% cat /sys/devices/system/memory/auto_online_blocks
|
||||||
|
|
||||||
|
The default is "offline" which means the newly added memory is not in a
|
||||||
|
ready-to-use state and you have to "online" the newly added memory blocks
|
||||||
|
manually. Automatic onlining can be requested by writing "online" to
|
||||||
|
"auto_online_blocks" file:
|
||||||
|
|
||||||
|
% echo online > /sys/devices/system/memory/auto_online_blocks
|
||||||
|
|
||||||
|
This sets a global policy and impacts all memory blocks that will subsequently
|
||||||
|
be hotplugged. Currently offline blocks keep their state. It is possible, under
|
||||||
|
certain circumstances, that some memory blocks will be added but will fail to
|
||||||
|
online. User space tools can check their "state" files
|
||||||
|
(/sys/devices/system/memory/memoryXXX/state) and try to online them manually.
|
||||||
|
|
||||||
|
If the automatic onlining wasn't requested, failed, or some memory block was
|
||||||
|
offlined it is possible to change the individual block's state by writing to the
|
||||||
|
"state" file:
|
||||||
|
|
||||||
% echo online > /sys/devices/system/memory/memoryXXX/state
|
% echo online > /sys/devices/system/memory/memoryXXX/state
|
||||||
|
|
||||||
|
|||||||
@@ -298,6 +298,24 @@ bitmap and its derivatives such as cpumask and nodemask:
|
|||||||
|
|
||||||
Passed by reference.
|
Passed by reference.
|
||||||
|
|
||||||
|
Flags bitfields such as page flags, gfp_flags:
|
||||||
|
|
||||||
|
%pGp referenced|uptodate|lru|active|private
|
||||||
|
%pGg GFP_USER|GFP_DMA32|GFP_NOWARN
|
||||||
|
%pGv read|exec|mayread|maywrite|mayexec|denywrite
|
||||||
|
|
||||||
|
For printing flags bitfields as a collection of symbolic constants that
|
||||||
|
would construct the value. The type of flags is given by the third
|
||||||
|
character. Currently supported are [p]age flags, [v]ma_flags (both
|
||||||
|
expect unsigned long *) and [g]fp_flags (expects gfp_t *). The flag
|
||||||
|
names and print order depends on the particular type.
|
||||||
|
|
||||||
|
Note that this format should not be used directly in TP_printk() part
|
||||||
|
of a tracepoint. Instead, use the show_*_flags() functions from
|
||||||
|
<trace/events/mmflags.h>.
|
||||||
|
|
||||||
|
Passed by reference.
|
||||||
|
|
||||||
Network device features:
|
Network device features:
|
||||||
|
|
||||||
%pNF 0x000000000000c000
|
%pNF 0x000000000000c000
|
||||||
|
|||||||
@@ -28,10 +28,11 @@ with page owner and page owner is disabled in runtime due to no enabling
|
|||||||
boot option, runtime overhead is marginal. If disabled in runtime, it
|
boot option, runtime overhead is marginal. If disabled in runtime, it
|
||||||
doesn't require memory to store owner information, so there is no runtime
|
doesn't require memory to store owner information, so there is no runtime
|
||||||
memory overhead. And, page owner inserts just two unlikely branches into
|
memory overhead. And, page owner inserts just two unlikely branches into
|
||||||
the page allocator hotpath and if it returns false then allocation is
|
the page allocator hotpath and if not enabled, then allocation is done
|
||||||
done like as the kernel without page owner. These two unlikely branches
|
like as the kernel without page owner. These two unlikely branches should
|
||||||
would not affect to allocation performance. Following is the kernel's
|
not affect to allocation performance, especially if the static keys jump
|
||||||
code size change due to this facility.
|
label patching functionality is available. Following is the kernel's code
|
||||||
|
size change due to this facility.
|
||||||
|
|
||||||
- Without page owner
|
- Without page owner
|
||||||
text data bss dec hex filename
|
text data bss dec hex filename
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ slub_debug=<Debug-Options>,<slab name>
|
|||||||
Enable options only for select slabs
|
Enable options only for select slabs
|
||||||
|
|
||||||
Possible debug options are
|
Possible debug options are
|
||||||
F Sanity checks on (enables SLAB_DEBUG_FREE. Sorry
|
F Sanity checks on (enables SLAB_DEBUG_CONSISTENCY_CHECKS
|
||||||
SLAB legacy issues)
|
Sorry SLAB legacy issues)
|
||||||
Z Red zoning
|
Z Red zoning
|
||||||
P Poisoning (object and padding)
|
P Poisoning (object and padding)
|
||||||
U User tracking (free and alloc)
|
U User tracking (free and alloc)
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ extern unsigned long get_fb_unmapped_area(struct file *filp, unsigned long,
|
|||||||
unsigned long);
|
unsigned long);
|
||||||
#define HAVE_ARCH_FB_UNMAPPED_AREA
|
#define HAVE_ARCH_FB_UNMAPPED_AREA
|
||||||
|
|
||||||
|
#define pgprot_writecombine pgprot_noncached
|
||||||
|
|
||||||
#include <asm-generic/pgtable.h>
|
#include <asm-generic/pgtable.h>
|
||||||
|
|
||||||
#endif /* _BLACKFIN_PGTABLE_H */
|
#endif /* _BLACKFIN_PGTABLE_H */
|
||||||
|
|||||||
+14
-11
@@ -59,21 +59,24 @@ void free_initrd_mem(unsigned long, unsigned long);
|
|||||||
void __init zone_sizes_init(void)
|
void __init zone_sizes_init(void)
|
||||||
{
|
{
|
||||||
unsigned long zones_size[MAX_NR_ZONES] = {0, };
|
unsigned long zones_size[MAX_NR_ZONES] = {0, };
|
||||||
unsigned long max_dma;
|
|
||||||
unsigned long low;
|
|
||||||
unsigned long start_pfn;
|
unsigned long start_pfn;
|
||||||
|
|
||||||
#ifdef CONFIG_MMU
|
#ifdef CONFIG_MMU
|
||||||
start_pfn = START_PFN(0);
|
{
|
||||||
max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
|
unsigned long low;
|
||||||
low = MAX_LOW_PFN(0);
|
unsigned long max_dma;
|
||||||
|
|
||||||
if (low < max_dma){
|
start_pfn = START_PFN(0);
|
||||||
zones_size[ZONE_DMA] = low - start_pfn;
|
max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
|
||||||
zones_size[ZONE_NORMAL] = 0;
|
low = MAX_LOW_PFN(0);
|
||||||
} else {
|
|
||||||
zones_size[ZONE_DMA] = low - start_pfn;
|
if (low < max_dma) {
|
||||||
zones_size[ZONE_NORMAL] = low - max_dma;
|
zones_size[ZONE_DMA] = low - start_pfn;
|
||||||
|
zones_size[ZONE_NORMAL] = 0;
|
||||||
|
} else {
|
||||||
|
zones_size[ZONE_DMA] = low - start_pfn;
|
||||||
|
zones_size[ZONE_NORMAL] = low - max_dma;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
zones_size[ZONE_DMA] = 0 >> PAGE_SHIFT;
|
zones_size[ZONE_DMA] = 0 >> PAGE_SHIFT;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <linux/export.h>
|
#include <linux/export.h>
|
||||||
#include <linux/kdebug.h>
|
#include <linux/kdebug.h>
|
||||||
#include <linux/ptrace.h>
|
#include <linux/ptrace.h>
|
||||||
|
#include <linux/mm.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
@@ -189,9 +190,8 @@ void die(struct pt_regs *regs, const char *str)
|
|||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
printk("SMP ");
|
printk("SMP ");
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_DEBUG_PAGEALLOC
|
if (debug_pagealloc_enabled())
|
||||||
printk("DEBUG_PAGEALLOC");
|
printk("DEBUG_PAGEALLOC");
|
||||||
#endif
|
|
||||||
printk("\n");
|
printk("\n");
|
||||||
notify_die(DIE_OOPS, str, regs, 0, regs->int_code & 0xffff, SIGSEGV);
|
notify_die(DIE_OOPS, str, regs, 0, regs->int_code & 0xffff, SIGSEGV);
|
||||||
print_modules();
|
print_modules();
|
||||||
|
|||||||
+4
-6
@@ -94,16 +94,15 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
|
|||||||
pgd_populate(&init_mm, pg_dir, pu_dir);
|
pgd_populate(&init_mm, pg_dir, pu_dir);
|
||||||
}
|
}
|
||||||
pu_dir = pud_offset(pg_dir, address);
|
pu_dir = pud_offset(pg_dir, address);
|
||||||
#ifndef CONFIG_DEBUG_PAGEALLOC
|
|
||||||
if (MACHINE_HAS_EDAT2 && pud_none(*pu_dir) && address &&
|
if (MACHINE_HAS_EDAT2 && pud_none(*pu_dir) && address &&
|
||||||
!(address & ~PUD_MASK) && (address + PUD_SIZE <= end)) {
|
!(address & ~PUD_MASK) && (address + PUD_SIZE <= end) &&
|
||||||
|
!debug_pagealloc_enabled()) {
|
||||||
pud_val(*pu_dir) = __pa(address) |
|
pud_val(*pu_dir) = __pa(address) |
|
||||||
_REGION_ENTRY_TYPE_R3 | _REGION3_ENTRY_LARGE |
|
_REGION_ENTRY_TYPE_R3 | _REGION3_ENTRY_LARGE |
|
||||||
(ro ? _REGION_ENTRY_PROTECT : 0);
|
(ro ? _REGION_ENTRY_PROTECT : 0);
|
||||||
address += PUD_SIZE;
|
address += PUD_SIZE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (pud_none(*pu_dir)) {
|
if (pud_none(*pu_dir)) {
|
||||||
pm_dir = vmem_pmd_alloc();
|
pm_dir = vmem_pmd_alloc();
|
||||||
if (!pm_dir)
|
if (!pm_dir)
|
||||||
@@ -111,9 +110,9 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
|
|||||||
pud_populate(&init_mm, pu_dir, pm_dir);
|
pud_populate(&init_mm, pu_dir, pm_dir);
|
||||||
}
|
}
|
||||||
pm_dir = pmd_offset(pu_dir, address);
|
pm_dir = pmd_offset(pu_dir, address);
|
||||||
#ifndef CONFIG_DEBUG_PAGEALLOC
|
|
||||||
if (MACHINE_HAS_EDAT1 && pmd_none(*pm_dir) && address &&
|
if (MACHINE_HAS_EDAT1 && pmd_none(*pm_dir) && address &&
|
||||||
!(address & ~PMD_MASK) && (address + PMD_SIZE <= end)) {
|
!(address & ~PMD_MASK) && (address + PMD_SIZE <= end) &&
|
||||||
|
!debug_pagealloc_enabled()) {
|
||||||
pmd_val(*pm_dir) = __pa(address) |
|
pmd_val(*pm_dir) = __pa(address) |
|
||||||
_SEGMENT_ENTRY | _SEGMENT_ENTRY_LARGE |
|
_SEGMENT_ENTRY | _SEGMENT_ENTRY_LARGE |
|
||||||
_SEGMENT_ENTRY_YOUNG |
|
_SEGMENT_ENTRY_YOUNG |
|
||||||
@@ -121,7 +120,6 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
|
|||||||
address += PMD_SIZE;
|
address += PMD_SIZE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (pmd_none(*pm_dir)) {
|
if (pmd_none(*pm_dir)) {
|
||||||
pt_dir = vmem_pte_alloc(address);
|
pt_dir = vmem_pte_alloc(address);
|
||||||
if (!pt_dir)
|
if (!pt_dir)
|
||||||
|
|||||||
@@ -265,9 +265,8 @@ int __die(const char *str, struct pt_regs *regs, long err)
|
|||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
printk("SMP ");
|
printk("SMP ");
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_DEBUG_PAGEALLOC
|
if (debug_pagealloc_enabled())
|
||||||
printk("DEBUG_PAGEALLOC ");
|
printk("DEBUG_PAGEALLOC ");
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_KASAN
|
#ifdef CONFIG_KASAN
|
||||||
printk("KASAN");
|
printk("KASAN");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+19
-17
@@ -150,13 +150,14 @@ static int page_size_mask;
|
|||||||
|
|
||||||
static void __init probe_page_size_mask(void)
|
static void __init probe_page_size_mask(void)
|
||||||
{
|
{
|
||||||
#if !defined(CONFIG_DEBUG_PAGEALLOC) && !defined(CONFIG_KMEMCHECK)
|
#if !defined(CONFIG_KMEMCHECK)
|
||||||
/*
|
/*
|
||||||
* For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
|
* For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will
|
||||||
|
* use small pages.
|
||||||
* This will simplify cpa(), which otherwise needs to support splitting
|
* This will simplify cpa(), which otherwise needs to support splitting
|
||||||
* large pages into small in interrupt context, etc.
|
* large pages into small in interrupt context, etc.
|
||||||
*/
|
*/
|
||||||
if (cpu_has_pse)
|
if (cpu_has_pse && !debug_pagealloc_enabled())
|
||||||
page_size_mask |= 1 << PG_LEVEL_2M;
|
page_size_mask |= 1 << PG_LEVEL_2M;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -666,21 +667,22 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
|
|||||||
* mark them not present - any buggy init-section access will
|
* mark them not present - any buggy init-section access will
|
||||||
* create a kernel page fault:
|
* create a kernel page fault:
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_DEBUG_PAGEALLOC
|
if (debug_pagealloc_enabled()) {
|
||||||
printk(KERN_INFO "debug: unmapping init [mem %#010lx-%#010lx]\n",
|
pr_info("debug: unmapping init [mem %#010lx-%#010lx]\n",
|
||||||
begin, end - 1);
|
begin, end - 1);
|
||||||
set_memory_np(begin, (end - begin) >> PAGE_SHIFT);
|
set_memory_np(begin, (end - begin) >> PAGE_SHIFT);
|
||||||
#else
|
} else {
|
||||||
/*
|
/*
|
||||||
* We just marked the kernel text read only above, now that
|
* We just marked the kernel text read only above, now that
|
||||||
* we are going to free part of that, we need to make that
|
* we are going to free part of that, we need to make that
|
||||||
* writeable and non-executable first.
|
* writeable and non-executable first.
|
||||||
*/
|
*/
|
||||||
set_memory_nx(begin, (end - begin) >> PAGE_SHIFT);
|
set_memory_nx(begin, (end - begin) >> PAGE_SHIFT);
|
||||||
set_memory_rw(begin, (end - begin) >> PAGE_SHIFT);
|
set_memory_rw(begin, (end - begin) >> PAGE_SHIFT);
|
||||||
|
|
||||||
free_reserved_area((void *)begin, (void *)end, POISON_FREE_INITMEM, what);
|
free_reserved_area((void *)begin, (void *)end,
|
||||||
#endif
|
POISON_FREE_INITMEM, what);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_initmem(void)
|
void free_initmem(void)
|
||||||
|
|||||||
+4
-10
@@ -106,12 +106,6 @@ static inline unsigned long highmap_end_pfn(void)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_PAGEALLOC
|
|
||||||
# define debug_pagealloc 1
|
|
||||||
#else
|
|
||||||
# define debug_pagealloc 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
within(unsigned long addr, unsigned long start, unsigned long end)
|
within(unsigned long addr, unsigned long start, unsigned long end)
|
||||||
{
|
{
|
||||||
@@ -714,10 +708,10 @@ static int split_large_page(struct cpa_data *cpa, pte_t *kpte,
|
|||||||
{
|
{
|
||||||
struct page *base;
|
struct page *base;
|
||||||
|
|
||||||
if (!debug_pagealloc)
|
if (!debug_pagealloc_enabled())
|
||||||
spin_unlock(&cpa_lock);
|
spin_unlock(&cpa_lock);
|
||||||
base = alloc_pages(GFP_KERNEL | __GFP_NOTRACK, 0);
|
base = alloc_pages(GFP_KERNEL | __GFP_NOTRACK, 0);
|
||||||
if (!debug_pagealloc)
|
if (!debug_pagealloc_enabled())
|
||||||
spin_lock(&cpa_lock);
|
spin_lock(&cpa_lock);
|
||||||
if (!base)
|
if (!base)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@@ -1339,10 +1333,10 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
|
|||||||
if (cpa->flags & (CPA_ARRAY | CPA_PAGES_ARRAY))
|
if (cpa->flags & (CPA_ARRAY | CPA_PAGES_ARRAY))
|
||||||
cpa->numpages = 1;
|
cpa->numpages = 1;
|
||||||
|
|
||||||
if (!debug_pagealloc)
|
if (!debug_pagealloc_enabled())
|
||||||
spin_lock(&cpa_lock);
|
spin_lock(&cpa_lock);
|
||||||
ret = __change_page_attr(cpa, checkalias);
|
ret = __change_page_attr(cpa, checkalias);
|
||||||
if (!debug_pagealloc)
|
if (!debug_pagealloc_enabled())
|
||||||
spin_unlock(&cpa_lock);
|
spin_unlock(&cpa_lock);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -217,10 +217,21 @@ static void part_release(struct device *dev)
|
|||||||
kfree(p);
|
kfree(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int part_uevent(struct device *dev, struct kobj_uevent_env *env)
|
||||||
|
{
|
||||||
|
struct hd_struct *part = dev_to_part(dev);
|
||||||
|
|
||||||
|
add_uevent_var(env, "PARTN=%u", part->partno);
|
||||||
|
if (part->info && part->info->volname[0])
|
||||||
|
add_uevent_var(env, "PARTNAME=%s", part->info->volname);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
struct device_type part_type = {
|
struct device_type part_type = {
|
||||||
.name = "partition",
|
.name = "partition",
|
||||||
.groups = part_attr_groups,
|
.groups = part_attr_groups,
|
||||||
.release = part_release,
|
.release = part_release,
|
||||||
|
.uevent = part_uevent,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void delete_partition_rcu_cb(struct rcu_head *head)
|
static void delete_partition_rcu_cb(struct rcu_head *head)
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ module_param(latency_factor, uint, 0644);
|
|||||||
|
|
||||||
static DEFINE_PER_CPU(struct cpuidle_device *, acpi_cpuidle_device);
|
static DEFINE_PER_CPU(struct cpuidle_device *, acpi_cpuidle_device);
|
||||||
|
|
||||||
static DEFINE_PER_CPU(struct acpi_processor_cx * [CPUIDLE_STATE_MAX],
|
static
|
||||||
acpi_cstate);
|
DEFINE_PER_CPU(struct acpi_processor_cx * [CPUIDLE_STATE_MAX], acpi_cstate);
|
||||||
|
|
||||||
static int disabled_by_idle_boot_param(void)
|
static int disabled_by_idle_boot_param(void)
|
||||||
{
|
{
|
||||||
|
|||||||
+33
-1
@@ -251,7 +251,7 @@ memory_block_action(unsigned long phys_index, unsigned long action, int online_t
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int memory_block_change_state(struct memory_block *mem,
|
int memory_block_change_state(struct memory_block *mem,
|
||||||
unsigned long to_state, unsigned long from_state_req)
|
unsigned long to_state, unsigned long from_state_req)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@@ -438,6 +438,37 @@ print_block_size(struct device *dev, struct device_attribute *attr,
|
|||||||
|
|
||||||
static DEVICE_ATTR(block_size_bytes, 0444, print_block_size, NULL);
|
static DEVICE_ATTR(block_size_bytes, 0444, print_block_size, NULL);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Memory auto online policy.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static ssize_t
|
||||||
|
show_auto_online_blocks(struct device *dev, struct device_attribute *attr,
|
||||||
|
char *buf)
|
||||||
|
{
|
||||||
|
if (memhp_auto_online)
|
||||||
|
return sprintf(buf, "online\n");
|
||||||
|
else
|
||||||
|
return sprintf(buf, "offline\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static ssize_t
|
||||||
|
store_auto_online_blocks(struct device *dev, struct device_attribute *attr,
|
||||||
|
const char *buf, size_t count)
|
||||||
|
{
|
||||||
|
if (sysfs_streq(buf, "online"))
|
||||||
|
memhp_auto_online = true;
|
||||||
|
else if (sysfs_streq(buf, "offline"))
|
||||||
|
memhp_auto_online = false;
|
||||||
|
else
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DEVICE_ATTR(auto_online_blocks, 0644, show_auto_online_blocks,
|
||||||
|
store_auto_online_blocks);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some architectures will have custom drivers to do this, and
|
* Some architectures will have custom drivers to do this, and
|
||||||
* will not need to do it from userspace. The fake hot-add code
|
* will not need to do it from userspace. The fake hot-add code
|
||||||
@@ -746,6 +777,7 @@ static struct attribute *memory_root_attrs[] = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
&dev_attr_block_size_bytes.attr,
|
&dev_attr_block_size_bytes.attr,
|
||||||
|
&dev_attr_auto_online_blocks.attr,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
static bool verbose = 0;
|
static int verbose = 0;
|
||||||
static int major = PD_MAJOR;
|
static int major = PD_MAJOR;
|
||||||
static char *name = PD_NAME;
|
static char *name = PD_NAME;
|
||||||
static int cluster = 64;
|
static int cluster = 64;
|
||||||
@@ -161,7 +161,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_GEO, D_SBY, D_DLY, D_SLV};
|
|||||||
static DEFINE_MUTEX(pd_mutex);
|
static DEFINE_MUTEX(pd_mutex);
|
||||||
static DEFINE_SPINLOCK(pd_lock);
|
static DEFINE_SPINLOCK(pd_lock);
|
||||||
|
|
||||||
module_param(verbose, bool, 0);
|
module_param(verbose, int, 0);
|
||||||
module_param(major, int, 0);
|
module_param(major, int, 0);
|
||||||
module_param(name, charp, 0);
|
module_param(name, charp, 0);
|
||||||
module_param(cluster, int, 0);
|
module_param(cluster, int, 0);
|
||||||
|
|||||||
@@ -117,7 +117,7 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static bool verbose = 0;
|
static int verbose = 0;
|
||||||
static int major = PT_MAJOR;
|
static int major = PT_MAJOR;
|
||||||
static char *name = PT_NAME;
|
static char *name = PT_NAME;
|
||||||
static int disable = 0;
|
static int disable = 0;
|
||||||
@@ -152,7 +152,7 @@ static int (*drives[4])[6] = {&drive0, &drive1, &drive2, &drive3};
|
|||||||
|
|
||||||
#include <asm/uaccess.h>
|
#include <asm/uaccess.h>
|
||||||
|
|
||||||
module_param(verbose, bool, 0);
|
module_param(verbose, int, 0);
|
||||||
module_param(major, int, 0);
|
module_param(major, int, 0);
|
||||||
module_param(name, charp, 0);
|
module_param(name, charp, 0);
|
||||||
module_param_array(drive0, int, NULL, 0);
|
module_param_array(drive0, int, NULL, 0);
|
||||||
|
|||||||
+15
-8
@@ -37,24 +37,31 @@ config XEN_BALLOON_MEMORY_HOTPLUG
|
|||||||
|
|
||||||
Memory could be hotplugged in following steps:
|
Memory could be hotplugged in following steps:
|
||||||
|
|
||||||
1) dom0: xl mem-max <domU> <maxmem>
|
1) target domain: ensure that memory auto online policy is in
|
||||||
|
effect by checking /sys/devices/system/memory/auto_online_blocks
|
||||||
|
file (should be 'online').
|
||||||
|
|
||||||
|
2) control domain: xl mem-max <target-domain> <maxmem>
|
||||||
where <maxmem> is >= requested memory size,
|
where <maxmem> is >= requested memory size,
|
||||||
|
|
||||||
2) dom0: xl mem-set <domU> <memory>
|
3) control domain: xl mem-set <target-domain> <memory>
|
||||||
where <memory> is requested memory size; alternatively memory
|
where <memory> is requested memory size; alternatively memory
|
||||||
could be added by writing proper value to
|
could be added by writing proper value to
|
||||||
/sys/devices/system/xen_memory/xen_memory0/target or
|
/sys/devices/system/xen_memory/xen_memory0/target or
|
||||||
/sys/devices/system/xen_memory/xen_memory0/target_kb on dumU,
|
/sys/devices/system/xen_memory/xen_memory0/target_kb on the
|
||||||
|
target domain.
|
||||||
|
|
||||||
3) domU: for i in /sys/devices/system/memory/memory*/state; do \
|
Alternatively, if memory auto onlining was not requested at step 1
|
||||||
[ "`cat "$i"`" = offline ] && echo online > "$i"; done
|
the newly added memory can be manually onlined in the target domain
|
||||||
|
by doing the following:
|
||||||
|
|
||||||
Memory could be onlined automatically on domU by adding following line to udev rules:
|
for i in /sys/devices/system/memory/memory*/state; do \
|
||||||
|
[ "`cat "$i"`" = offline ] && echo online > "$i"; done
|
||||||
|
|
||||||
|
or by adding the following line to udev rules:
|
||||||
|
|
||||||
SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f /sys$devpath/state ] && echo online > /sys$devpath/state'"
|
SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f /sys$devpath/state ] && echo online > /sys$devpath/state'"
|
||||||
|
|
||||||
In that case step 3 should be omitted.
|
|
||||||
|
|
||||||
config XEN_BALLOON_MEMORY_HOTPLUG_LIMIT
|
config XEN_BALLOON_MEMORY_HOTPLUG_LIMIT
|
||||||
int "Hotplugged memory limit (in GiB) for a PV guest"
|
int "Hotplugged memory limit (in GiB) for a PV guest"
|
||||||
default 512 if X86_64
|
default 512 if X86_64
|
||||||
|
|||||||
+10
-1
@@ -338,7 +338,16 @@ static enum bp_state reserve_additional_memory(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rc = add_memory_resource(nid, resource);
|
/*
|
||||||
|
* add_memory_resource() will call online_pages() which in its turn
|
||||||
|
* will call xen_online_page() callback causing deadlock if we don't
|
||||||
|
* release balloon_mutex here. Unlocking here is safe because the
|
||||||
|
* callers drop the mutex before trying again.
|
||||||
|
*/
|
||||||
|
mutex_unlock(&balloon_mutex);
|
||||||
|
rc = add_memory_resource(nid, resource, memhp_auto_online);
|
||||||
|
mutex_lock(&balloon_mutex);
|
||||||
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
pr_warn("Cannot add additional memory (%i)\n", rc);
|
pr_warn("Cannot add additional memory (%i)\n", rc);
|
||||||
goto err;
|
goto err;
|
||||||
|
|||||||
@@ -38,8 +38,9 @@
|
|||||||
/* Find the first set bit in a evtchn mask */
|
/* Find the first set bit in a evtchn mask */
|
||||||
#define EVTCHN_FIRST_BIT(w) find_first_bit(BM(&(w)), BITS_PER_EVTCHN_WORD)
|
#define EVTCHN_FIRST_BIT(w) find_first_bit(BM(&(w)), BITS_PER_EVTCHN_WORD)
|
||||||
|
|
||||||
static DEFINE_PER_CPU(xen_ulong_t [EVTCHN_2L_NR_CHANNELS/BITS_PER_EVTCHN_WORD],
|
#define EVTCHN_MASK_SIZE (EVTCHN_2L_NR_CHANNELS/BITS_PER_EVTCHN_WORD)
|
||||||
cpu_evtchn_mask);
|
|
||||||
|
static DEFINE_PER_CPU(xen_ulong_t [EVTCHN_MASK_SIZE], cpu_evtchn_mask);
|
||||||
|
|
||||||
static unsigned evtchn_2l_max_channels(void)
|
static unsigned evtchn_2l_max_channels(void)
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user