From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756491Ab3C2RZL (ORCPT ); Fri, 29 Mar 2013 13:25:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62302 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755280Ab3C2RZJ (ORCPT ); Fri, 29 Mar 2013 13:25:09 -0400 Date: Fri, 29 Mar 2013 13:23:38 -0400 From: Naoya Horiguchi To: Michal Hocko Cc: Andrew Morton , Mel Gorman , Hugh Dickins , Rik van Riel , KOSAKI Motohiro , stable@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Message-ID: <1364577818-615ipxeo-mutt-n-horiguchi@ah.jp.nec.com> In-Reply-To: <20130329135730.GB21879@dhcp22.suse.cz> References: <1364485358-8745-1-git-send-email-n-horiguchi@ah.jp.nec.com> <1364485358-8745-3-git-send-email-n-horiguchi@ah.jp.nec.com> <20130329135730.GB21879@dhcp22.suse.cz> Subject: Re: [PATCH 2/2] hugetlbfs: add swap entry check in follow_hugetlb_page() Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Mutt-References: <20130329135730.GB21879@dhcp22.suse.cz> X-Mutt-Fcc: ~/Maildir/sent/ User-Agent: Mutt 1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, Mar 29, 2013 at 02:57:30PM +0100, Michal Hocko wrote: > On Thu 28-03-13 11:42:38, Naoya Horiguchi wrote: > [...] > > @@ -2968,7 +2968,8 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, > > * first, for the page indexing below to work. > > */ > > pte = huge_pte_offset(mm, vaddr & huge_page_mask(h)); > > - absent = !pte || huge_pte_none(huge_ptep_get(pte)); > > + absent = !pte || huge_pte_none(huge_ptep_get(pte)) || > > + is_swap_pte(huge_ptep_get(pte)); > > is_swap_pte doesn't seem right. Shouldn't you use is_hugetlb_entry_hwpoisoned > instead? I tested only hwpoisoned hugepage, but the same can happen for hugepages under migration. So I intended to filter out all types of swap entries. The local variable 'absent' seems to mean whether data on the address is immediately available, so swap type entry isn't included in it. Thanks, Naoya From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx127.postini.com [74.125.245.127]) by kanga.kvack.org (Postfix) with SMTP id D4DCF6B0002 for ; Fri, 29 Mar 2013 13:23:44 -0400 (EDT) Date: Fri, 29 Mar 2013 13:23:38 -0400 From: Naoya Horiguchi Message-ID: <1364577818-615ipxeo-mutt-n-horiguchi@ah.jp.nec.com> In-Reply-To: <20130329135730.GB21879@dhcp22.suse.cz> References: <1364485358-8745-1-git-send-email-n-horiguchi@ah.jp.nec.com> <1364485358-8745-3-git-send-email-n-horiguchi@ah.jp.nec.com> <20130329135730.GB21879@dhcp22.suse.cz> Subject: Re: [PATCH 2/2] hugetlbfs: add swap entry check in follow_hugetlb_page() Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Andrew Morton , Mel Gorman , Hugh Dickins , Rik van Riel , KOSAKI Motohiro , stable@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Hi, On Fri, Mar 29, 2013 at 02:57:30PM +0100, Michal Hocko wrote: > On Thu 28-03-13 11:42:38, Naoya Horiguchi wrote: > [...] > > @@ -2968,7 +2968,8 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, > > * first, for the page indexing below to work. > > */ > > pte = huge_pte_offset(mm, vaddr & huge_page_mask(h)); > > - absent = !pte || huge_pte_none(huge_ptep_get(pte)); > > + absent = !pte || huge_pte_none(huge_ptep_get(pte)) || > > + is_swap_pte(huge_ptep_get(pte)); > > is_swap_pte doesn't seem right. Shouldn't you use is_hugetlb_entry_hwpoisoned > instead? I tested only hwpoisoned hugepage, but the same can happen for hugepages under migration. So I intended to filter out all types of swap entries. The local variable 'absent' seems to mean whether data on the address is immediately available, so swap type entry isn't included in it. Thanks, Naoya -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org