From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 263E2C64EBC for ; Thu, 4 Oct 2018 08:34:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE1B321470 for ; Thu, 4 Oct 2018 08:34:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE1B321470 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727662AbeJDP0s (ORCPT ); Thu, 4 Oct 2018 11:26:48 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:32886 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726808AbeJDP0r (ORCPT ); Thu, 4 Oct 2018 11:26:47 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w948Y169085008 for ; Thu, 4 Oct 2018 04:34:38 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2mwem3a3fs-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 04 Oct 2018 04:34:38 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 4 Oct 2018 09:34:36 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 4 Oct 2018 09:34:32 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w948YVo164094412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 4 Oct 2018 08:34:31 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 84EAE42049; Thu, 4 Oct 2018 11:34:11 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 538A74203F; Thu, 4 Oct 2018 11:34:10 +0100 (BST) Received: from skywalker (unknown [9.124.31.179]) by d06av24.portsmouth.uk.ibm.com (Postfix) with SMTP; Thu, 4 Oct 2018 11:34:10 +0100 (BST) Received: (nullmailer pid 27280 invoked by uid 1000); Thu, 04 Oct 2018 08:34:29 -0000 From: "Aneesh Kumar K.V" To: akpm@linux-foundation.org, Michal Hocko , Alexey Kardashevskiy , mpe@ellerman.id.au Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH V3 0/2] mm/kvm/vfio/ppc64: Migrate compound pages out of CMA region In-Reply-To: <20180918115839.22154-1-aneesh.kumar@linux.ibm.com> References: <20180918115839.22154-1-aneesh.kumar@linux.ibm.com> Date: Thu, 04 Oct 2018 14:04:29 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 18100408-4275-0000-0000-000002C4D3E0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18100408-4276-0000-0000-000037CFEAF1 Message-Id: <87y3beaz56.fsf@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-04_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=676 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810040088 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, "Aneesh Kumar K.V" writes: > ppc64 use CMA area for the allocation of guest page table (hash page table). We won't > be able to start guest if we fail to allocate hash page table. We have observed > hash table allocation failure because we failed to migrate pages out of CMA region > because they were pinned. This happen when we are using VFIO. VFIO on ppc64 pins > the entire guest RAM. If the guest RAM pages get allocated out of CMA region, we > won't be able to migrate those pages. The pages are also pinned for the lifetime of the > guest. > > Currently we support migration of non-compound pages. With THP and with the addition of > hugetlb migration we can end up allocating compound pages from CMA region. This > patch series add support for migrating compound pages. The first path adds the helper > get_user_pages_cma_migrate() which pin the page making sure we migrate them out of > CMA region before incrementing the reference count. > > Aneesh Kumar K.V (2): > mm: Add get_user_pages_cma_migrate > powerpc/mm/iommu: Allow migration of cma allocated pages during > mm_iommu_get > > arch/powerpc/mm/mmu_context_iommu.c | 120 ++++++++----------------- > include/linux/hugetlb.h | 2 + > include/linux/migrate.h | 3 + > mm/hugetlb.c | 4 +- > mm/migrate.c | 132 ++++++++++++++++++++++++++++ > 5 files changed, 174 insertions(+), 87 deletions(-) Any feedback on this. -aneesh