Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753178AbcKHIOS (ORCPT ); Tue, 8 Nov 2016 03:14:18 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42249 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751741AbcKHIOR (ORCPT ); Tue, 8 Nov 2016 03:14:17 -0500 Subject: Re: [PATCH v2 05/12] mm: thp: add core routines for thp/pmd migration To: Naoya Horiguchi , linux-mm@kvack.org References: <1478561517-4317-1-git-send-email-n-horiguchi@ah.jp.nec.com> <1478561517-4317-6-git-send-email-n-horiguchi@ah.jp.nec.com> Cc: "Kirill A. Shutemov" , Hugh Dickins , Andrew Morton , Dave Hansen , Andrea Arcangeli , Mel Gorman , Michal Hocko , Vlastimil Babka , Pavel Emelyanov , Zi Yan , Balbir Singh , linux-kernel@vger.kernel.org, Naoya Horiguchi From: Anshuman Khandual Date: Tue, 8 Nov 2016 13:43:54 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1478561517-4317-6-git-send-email-n-horiguchi@ah.jp.nec.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16110808-0004-0000-0000-00000366A172 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16110808-0005-0000-0000-0000105EE686 Message-Id: <58218942.8010608@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-08_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611080153 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1464 Lines: 29 On 11/08/2016 05:01 AM, Naoya Horiguchi wrote: > This patch prepares thp migration's core code. These code will be open when > unmap_and_move() stops unconditionally splitting thp and get_new_page() starts > to allocate destination thps. > > Signed-off-by: Naoya Horiguchi > --- > ChangeLog v1 -> v2: > - support pte-mapped thp, doubly-mapped thp > --- > arch/x86/include/asm/pgtable_64.h | 2 + > include/linux/swapops.h | 61 +++++++++++++++ > mm/huge_memory.c | 154 ++++++++++++++++++++++++++++++++++++++ > mm/migrate.c | 44 ++++++++++- > mm/pgtable-generic.c | 3 +- > 5 files changed, 262 insertions(+), 2 deletions(-) > > diff --git v4.9-rc2-mmotm-2016-10-27-18-27/arch/x86/include/asm/pgtable_64.h v4.9-rc2-mmotm-2016-10-27-18-27_patched/arch/x86/include/asm/pgtable_64.h > index 1cc82ec..3a1b48e 100644 > --- v4.9-rc2-mmotm-2016-10-27-18-27/arch/x86/include/asm/pgtable_64.h > +++ v4.9-rc2-mmotm-2016-10-27-18-27_patched/arch/x86/include/asm/pgtable_64.h > @@ -167,7 +167,9 @@ static inline int pgd_large(pgd_t pgd) { return 0; } > ((type) << (SWP_TYPE_FIRST_BIT)) \ > | ((offset) << SWP_OFFSET_FIRST_BIT) }) > #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val((pte)) }) > +#define __pmd_to_swp_entry(pte) ((swp_entry_t) { pmd_val((pmd)) }) The above macro takes *pte* but evaluates on *pmd*, guess its should be fixed either way.