lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100111114607.1d8cd1e0.minchan.kim@barrios-desktop>
Date:	Mon, 11 Jan 2010 11:46:07 +0900
From:	Minchan Kim <minchan.kim@...il.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Hugh Dickins <hugh.dickins@...cali.co.uk>,
	Izik Eidus <ieidus@...hat.com>, linux-mm <linux-mm@...ck.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: [PATCH -mmotm-2010-01-06-14-34] Count minor fault in break_ksm

We have counted task's maj/min fault after handle_mm_fault.
break_ksm misses that.

I wanted to check by VM_FAULT_ERROR. 
But now break_ksm doesn't handle HWPOISON error. 

Signed-off-by: Minchan Kim <minchan.kim@...il.com>
CC: Hugh Dickins <hugh.dickins@...cali.co.uk>
CC: Izik Eidus <ieidus@...hat.com>
---
 mm/ksm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/mm/ksm.c b/mm/ksm.c
index 56a0da1..3a1fda4 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -367,9 +367,13 @@ static int break_ksm(struct vm_area_struct *vma, unsigned long addr)
 		page = follow_page(vma, addr, FOLL_GET);
 		if (!page)
 			break;
-		if (PageKsm(page))
+		if (PageKsm(page)) {
 			ret = handle_mm_fault(vma->vm_mm, vma, addr,
 							FAULT_FLAG_WRITE);
+			if (!(ret & (VM_FAULT_SIGBUS | VM_FAULT_OOM)
+					|| current->flags & PF_KTHREAD))
+				current->min_flt++;
+		}
 		else
 			ret = VM_FAULT_WRITE;
 		put_page(page);
-- 
1.5.6.3



-- 
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ