From patchwork Wed Jul 25 16:19:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 10544293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6249139A for ; Wed, 25 Jul 2018 16:19:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 956882A409 for ; Wed, 25 Jul 2018 16:19:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8977C2A533; Wed, 25 Jul 2018 16:19:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18D192A409 for ; Wed, 25 Jul 2018 16:19:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 812276B026A; Wed, 25 Jul 2018 12:19:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 76F6E6B026B; Wed, 25 Jul 2018 12:19:40 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 574796B026C; Wed, 25 Jul 2018 12:19:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f70.google.com (mail-oi0-f70.google.com [209.85.218.70]) by kanga.kvack.org (Postfix) with ESMTP id 26D566B026A for ; Wed, 25 Jul 2018 12:19:40 -0400 (EDT) Received: by mail-oi0-f70.google.com with SMTP id t138-v6so7947216oih.5 for ; Wed, 25 Jul 2018 09:19:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:in-reply-to:references:message-id; bh=lM7M9ux8ienPIjtz1tu4IkSsQ2nWdiZIL3KDTcUqaIA=; b=oIwH+PQERslSEi24fvozi1jNYcV184nP2oNA+IkuYFIh0PltTkx2FuUeE5EU3/UAfl +BLFxgwAdashc4IZl2zBo7jEM/XoOQxCVQKjFIHkfBJs6oyF6CwJgSU1nfdVcwV6MEx6 gw9V59JP/6WDNi4FR2kJf8VqhroS3RPBnHi21giNhI0ej/QSNSOp65H3byI/fdbqf4d7 8N2Lrz7xdunK8tZz+PQG1dxmAvBe3ALh5nhYncHeFs7Vd4KC4MaN6CNBB+vd96cepk+x J7Q+KPGAJKqMrnjch7WPMUkiL45slW5WV9YOT6MoJk5COWMTRgCsd3gXSqGibS5pBqJK eBNQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AOUpUlGRbD5aGghH7W6DjFIc8ymCJQJB+rj1TBu3f69l8e7XjkTcui+5 oW9oQ3QG3O5dW8giRZd2F6/A9XRFE52D3mD3YlR29BhN9Fi/BL/eETZeJRrGXKsgUN/4K0ukzJB xdy9rm3stXE7ceaCB3qgScAnvQSydRQ9jtUyxJ9eDQmkgi1m1IlTGlX9FLT+Oms28Yg== X-Received: by 2002:aca:3bc2:: with SMTP id i185-v6mr4365006oia.156.1532535579952; Wed, 25 Jul 2018 09:19:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd4UzvVYg2mBmGMPjKCwbuzQo64O5APKKgxicZ9B67K4HNl36h/DIJmXb43wmIXqRuuFay6 X-Received: by 2002:aca:3bc2:: with SMTP id i185-v6mr4364945oia.156.1532535579211; Wed, 25 Jul 2018 09:19:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532535579; cv=none; d=google.com; s=arc-20160816; b=wLNEifcbDpJOgXVPfIiVIMQjWQF0dZ63rHuDirbUTOox/nOd+MKg3cZeDhGatbqkNh 1paw61W6IOWJomWBD/SuE3YHwVQRGh9JJ8Bw7KlFBpU9PcrQxKeM+RN6nAM2HGpDggan /BzVZXkMxTDsVlpjA96HG1PdM1RmKDsOe7ls+tFJogZz8IBDb05CprC0JABdGp2nHzkl RDFum0CYky8SyX89fQN/jYYh57TWzyR8YJGKVBNPCE3zWr2a+Q2KeqcBDkNTZAxmptho p8KC91IAsqMlNjAqBKfew4SAWXoxqKI+iPjtyBs9eigjjCVbkyXWY3CI4gR+prsmaVhU 3G1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from :arc-authentication-results; bh=lM7M9ux8ienPIjtz1tu4IkSsQ2nWdiZIL3KDTcUqaIA=; b=oBOqFQX2aqUcsqXHYKfNeuAKRC2Y0+lTz4hb+OXtksAC0B4XJDnLvN3UL0xVPO1ejc zPfVj9uZJDQwAWkRR5PAGIggZbyRPHHFcNYoY6lOKPtAOvdkOnkvu83xRh0mQpVrY7A2 oWO4Fwk+0ozyU6S5O/ETsbEOptnXAq45YZhdT4irfr9MZr78sOuHdERC6M8ZCirTKHog h9gycR7023qWQeU1AUiu1PP1rEp21pAy0ZXyyQDE7EY+enHlG04+4yB06jAwHeA1krJn 0Whh/puJbW/PoeY6THsALxLGFJlnuG9jXHPB38gB1r+990UxLDEkqRTJ/Y+1iDIdm+rn WgbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id d188-v6si10359281oih.266.2018.07.25.09.19.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 09:19:39 -0700 (PDT) Received-SPF: pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6PGE3gf097769 for ; Wed, 25 Jul 2018 12:19:38 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kevhe89b5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 25 Jul 2018 12:19:38 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Jul 2018 12:19:37 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 25 Jul 2018 12:19:33 -0400 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6PGJW7k5439994 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 25 Jul 2018 16:19:33 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E0B90AE05F; Wed, 25 Jul 2018 12:18:47 -0400 (EDT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 16877AE05C; Wed, 25 Jul 2018 12:18:45 -0400 (EDT) Received: from skywalker.ibmmodules.com (unknown [9.199.35.55]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 25 Jul 2018 12:18:44 -0400 (EDT) From: "Aneesh Kumar K.V" To: npiggin@gmail.com, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, Naoya Horiguchi Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, "Aneesh Kumar K.V" Subject: [PATCH V2 6/6] powerpc/mm:book3s: Enable THP migration support Date: Wed, 25 Jul 2018 21:49:03 +0530 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180725161903.31257-1-aneesh.kumar@linux.ibm.com> References: <20180725161903.31257-1-aneesh.kumar@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18072516-0072-0000-0000-00000385A965 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009425; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01065989; UDB=6.00547631; IPR=6.00843848; MB=3.00022321; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-25 16:19:36 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18072516-0073-0000-0000-000048D76E05 Message-Id: <20180725161903.31257-6-aneesh.kumar@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-25_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=986 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807250174 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/pgtable.h | 8 ++++++++ arch/powerpc/platforms/Kconfig.cputype | 1 + 2 files changed, 9 insertions(+) diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h index 8b80c5e16896..2f12732952f0 100644 --- a/arch/powerpc/include/asm/book3s/64/pgtable.h +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h @@ -734,6 +734,8 @@ static inline bool pte_user(pte_t pte) */ #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val((pte)) & ~_PAGE_PTE }) #define __swp_entry_to_pte(x) __pte((x).val | _PAGE_PTE) +#define __pmd_to_swp_entry(pmd) (__pte_to_swp_entry(pmd_pte(pmd))) +#define __swp_entry_to_pmd(x) (pte_pmd(__swp_entry_to_pte(x))) #ifdef CONFIG_MEM_SOFT_DIRTY #define _PAGE_SWP_SOFT_DIRTY (1UL << (SWP_TYPE_BITS + _PAGE_BIT_SWAP_TYPE)) @@ -1084,6 +1086,12 @@ static inline pte_t *pmdp_ptep(pmd_t *pmd) #define pmd_soft_dirty(pmd) pte_soft_dirty(pmd_pte(pmd)) #define pmd_mksoft_dirty(pmd) pte_pmd(pte_mksoft_dirty(pmd_pte(pmd))) #define pmd_clear_soft_dirty(pmd) pte_pmd(pte_clear_soft_dirty(pmd_pte(pmd))) + +#ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION +#define pmd_swp_mksoft_dirty(pmd) pte_pmd(pte_swp_mksoft_dirty(pmd_pte(pmd))) +#define pmd_swp_soft_dirty(pmd) pte_swp_soft_dirty(pmd_pte(pmd)) +#define pmd_swp_clear_soft_dirty(pmd) pte_pmd(pte_swp_clear_soft_dirty(pmd_pte(pmd))) +#endif #endif /* CONFIG_HAVE_ARCH_SOFT_DIRTY */ #ifdef CONFIG_NUMA_BALANCING diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index e93d6186de6e..f83ca0ca3bd8 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype @@ -72,6 +72,7 @@ config PPC_BOOK3S_64 select PPC_HAVE_PMU_SUPPORT select SYS_SUPPORTS_HUGETLBFS select HAVE_ARCH_TRANSPARENT_HUGEPAGE + select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE select ARCH_SUPPORTS_NUMA_BALANCING select IRQ_WORK