Skip to content

Commit

Permalink
Merge tag 'mm-hotfixes-stable-2022-06-05' of git://git.kernel.org/pub…
Browse files Browse the repository at this point in the history
…/scm/linux/kernel/git/akpm/mm

Pull mm hotfixes from Andrew Morton:
 "Fixups for various recently-added and longer-term issues and a few
  minor tweaks:

   - fixes for material merged during this merge window

   - cc:stable fixes for more longstanding issues

   - minor mailmap and MAINTAINERS updates"

* tag 'mm-hotfixes-stable-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  mm/oom_kill.c: fix vm_oom_kill_table[] ifdeffery
  x86/kexec: fix memory leak of elf header buffer
  mm/memremap: fix missing call to untrack_pfn() in pagemap_range()
  mm: page_isolation: use compound_nr() correctly in isolate_single_pageblock()
  mm: hugetlb_vmemmap: fix CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON
  MAINTAINERS: add maintainer information for z3fold
  mailmap: update Josh Poimboeuf's email
  • Loading branch information
torvalds committed Jun 6, 2022
2 parents e17fee8 + a19cad0 commit 815b196
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ Jordan Crouse <[email protected]> <[email protected]>
<[email protected]> <[email protected]>
<[email protected]> <[email protected]>
<[email protected]> <[email protected]>
Josh Poimboeuf <[email protected]> <[email protected]>
Josh Poimboeuf <[email protected]> <[email protected]>
Juha Yrjola <at solidboot.com>
Juha Yrjola <[email protected]>
Juha Yrjola <[email protected]>
Expand Down
7 changes: 7 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -22002,6 +22002,13 @@ L: [email protected]
S: Maintained
F: mm/zbud.c

Z3FOLD COMPRESSED PAGE ALLOCATOR
M: Vitaly Wool <[email protected]>
R: Miaohe Lin <[email protected]>
L: [email protected]
S: Maintained
F: mm/z3fold.c

ZD1211RW WIRELESS DRIVER
M: Ulrich Kunitz <[email protected]>
L: [email protected]
Expand Down
12 changes: 9 additions & 3 deletions arch/x86/kernel/machine_kexec_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,6 @@ void machine_kexec(struct kimage *image)
#ifdef CONFIG_KEXEC_FILE
void *arch_kexec_kernel_image_load(struct kimage *image)
{
vfree(image->elf_headers);
image->elf_headers = NULL;

if (!image->fops || !image->fops->load)
return ERR_PTR(-ENOEXEC);

Expand Down Expand Up @@ -514,6 +511,15 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi,
(int)ELF64_R_TYPE(rel[i].r_info), value);
return -ENOEXEC;
}

int arch_kimage_file_post_load_cleanup(struct kimage *image)
{
vfree(image->elf_headers);
image->elf_headers = NULL;
image->elf_headers_sz = 0;

return kexec_image_post_load_cleanup_default(image);
}
#endif /* CONFIG_KEXEC_FILE */

static int
Expand Down
2 changes: 1 addition & 1 deletion mm/hugetlb_vmemmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DEFINE_STATIC_KEY_MAYBE(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON,
EXPORT_SYMBOL(hugetlb_optimize_vmemmap_key);

static enum vmemmap_optimize_mode vmemmap_optimize_mode =
IS_ENABLED(CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON);
IS_ENABLED(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON);

static void vmemmap_optimize_mode_switch(enum vmemmap_optimize_mode to)
{
Expand Down
2 changes: 1 addition & 1 deletion mm/memremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static int pagemap_range(struct dev_pagemap *pgmap, struct mhp_params *params,

if (!mhp_range_allowed(range->start, range_len(range), !is_private)) {
error = -EINVAL;
goto err_pfn_remap;
goto err_kasan;
}

mem_hotplug_begin();
Expand Down
58 changes: 29 additions & 29 deletions mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,6 @@ static int sysctl_panic_on_oom;
static int sysctl_oom_kill_allocating_task;
static int sysctl_oom_dump_tasks = 1;

#ifdef CONFIG_SYSCTL
static struct ctl_table vm_oom_kill_table[] = {
{
.procname = "panic_on_oom",
.data = &sysctl_panic_on_oom,
.maxlen = sizeof(sysctl_panic_on_oom),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_TWO,
},
{
.procname = "oom_kill_allocating_task",
.data = &sysctl_oom_kill_allocating_task,
.maxlen = sizeof(sysctl_oom_kill_allocating_task),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{
.procname = "oom_dump_tasks",
.data = &sysctl_oom_dump_tasks,
.maxlen = sizeof(sysctl_oom_dump_tasks),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{}
};
#endif

/*
* Serializes oom killer invocations (out_of_memory()) from all contexts to
* prevent from over eager oom killing (e.g. when the oom killer is invoked
Expand Down Expand Up @@ -729,6 +700,35 @@ static void queue_oom_reaper(struct task_struct *tsk)
add_timer(&tsk->oom_reaper_timer);
}

#ifdef CONFIG_SYSCTL
static struct ctl_table vm_oom_kill_table[] = {
{
.procname = "panic_on_oom",
.data = &sysctl_panic_on_oom,
.maxlen = sizeof(sysctl_panic_on_oom),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_TWO,
},
{
.procname = "oom_kill_allocating_task",
.data = &sysctl_oom_kill_allocating_task,
.maxlen = sizeof(sysctl_oom_kill_allocating_task),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{
.procname = "oom_dump_tasks",
.data = &sysctl_oom_dump_tasks,
.maxlen = sizeof(sysctl_oom_dump_tasks),
.mode = 0644,
.proc_handler = proc_dointvec,
},
{}
};
#endif

static int __init oom_init(void)
{
oom_reaper_th = kthread_run(oom_reaper, NULL, "oom_reaper");
Expand Down
2 changes: 1 addition & 1 deletion mm/page_isolation.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,9 @@ static int isolate_single_pageblock(unsigned long boundary_pfn, int flags,
* above do the rest. If migration is not possible, just fail.
*/
if (PageCompound(page)) {
unsigned long nr_pages = compound_nr(page);
struct page *head = compound_head(page);
unsigned long head_pfn = page_to_pfn(head);
unsigned long nr_pages = compound_nr(head);

if (head_pfn + nr_pages <= boundary_pfn) {
pfn = head_pfn + nr_pages;
Expand Down

0 comments on commit 815b196

Please sign in to comment.