Unverified Commit a3906c82 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!1191 fix memory reliable related issues

Merge Pull Request from: @ci-robot 
 
PR sync from: Wupeng Ma <mawupeng1@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/DBYQ7YX2NZXNZFVXLHOUZRNTPCMRY75Q/ 
From: Ma Wupeng <mawupeng1@huawei.com>

Fix memory reliable related issues.

Ma Wupeng (3):
  mm: mem_reliable: Fix reliable page counter mismatch problem
  mm: mem_reliable: Update reliable page counter to zero if underflows
  efi: Disable mirror feature during crashkernel


-- 
2.25.1
 
 
Link:https://gitee.com/openeuler/kernel/pulls/1191

 

Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents ea3ee0df 2bbd51a7
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include <linux/ucs2_string.h>
#include <linux/memblock.h>
#include <linux/security.h>
#include <linux/crash_dump.h>

#include <asm/early_ioremap.h>

@@ -446,6 +447,11 @@ void __init efi_find_mirror(void)
	if (!mirrored_kernelcore)
		return;

	if (is_kdump_kernel()) {
		mirrored_kernelcore = false;
		return;
	}

	for_each_efi_memory_desc(md) {
		unsigned long long start = md->phys_addr;
		unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;
+13 −2
Original line number Diff line number Diff line
@@ -132,8 +132,19 @@ static inline bool reliable_allow_fb_enabled(void)
static inline void reliable_page_counter(struct page *page,
		struct mm_struct *mm, int val)
{
	if (page_reliable(page))
	if (!page_reliable(page))
		return;

	atomic_long_add(val, &mm->reliable_nr_page);

	/*
	 * Update reliable page counter to zero if underflows.
	 *
	 * Since reliable page counter is used for debug purpose only,
	 * there is no real function problem by doing this.
	 */
	if (unlikely(atomic_long_read(&mm->reliable_nr_page) < 0))
		atomic_long_set(&mm->reliable_nr_page, 0);
}

static inline void reliable_clear_page_counter(struct mm_struct *mm)
+1 −0
Original line number Diff line number Diff line
@@ -887,6 +887,7 @@ copy_present_pte(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
		get_page(page);
		page_dup_rmap(page, false);
		rss[mm_counter(page)]++;
		reliable_page_counter(page, dst_vma->vm_mm, 1);
	}

	/*