Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5131265imm; Tue, 18 Sep 2018 04:59:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbpJyJ8Qa/0eGoEw9If7eWuv4KORNSnVyyFD5sxSdugRTOMS5BE2yehXeh9k+x+aptf7lnx X-Received: by 2002:a62:438f:: with SMTP id l15-v6mr31063995pfi.196.1537271965132; Tue, 18 Sep 2018 04:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537271965; cv=none; d=google.com; s=arc-20160816; b=Qdxy5MwQWIXxMFQ54O/MaBu2HdkcVYurFdy/7SccPfcTErKY+pHkxsn3LNHTvyFdKC 3dZx9Cb4ls6RervPC0X8MyZq4Sr5so7C6AGZS3qM829zE1MfI/HGTk9hPbRe6xBqrLjY pcLaFkATbsqxX1sOORd78AATNB13xVMGM9AaEuDBlYKR1fUYWHO25alLCPfQ4BgnCWpH rynrqVS4DK98NSqj/MeDcF5yeGIuHS3JvH7fImEL9gQAnwTcUx0/5IgwRRzvg+XEKcy2 IHOCato3r9L8zf2F7eF23RSLEPnjV7BVawPmf4qFhCxVrQRvUtJ/nOxZ01ozhmLwo96b QaXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=JwdYSxby+nOEHB+Mo44+KJvGh0Fpxk5WgPyeuLAcI+s=; b=JHX5p6Jw59U2vcn7Q/50yZlfbZ/25QB3uTRl/iwUnxRBXt4e2S/KfE8dHSoozxYvds 1tBwOBPZocR9GPch68Gl4YR17wlaeCWGkH2opBVdY7bcNhHg/LfPhabFliZK/hQMWNKL r/K/klSHjJSdf6GbN8CiM6ij73pZ7q+PH6GMwZCiIlUpuDKCYXFLE7Y/sOVzXEi+9Duw GKwADZ7/hZZ+XpXmUdjl1TGYv+exiw7fJcMFi04TbbpC6lcAwFTTI+3GlebIqnD0sFHP 8G/uE7JfYujHpedWp4L+m8uNvgkCsnVhyMgIxKIC/abMOgkVwUIXgvrX6a9vKrc0DGew KMxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10-v6si17242693pla.450.2018.09.18.04.59.06; Tue, 18 Sep 2018 04:59:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729249AbeIRRbQ (ORCPT + 99 others); Tue, 18 Sep 2018 13:31:16 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:56060 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726828AbeIRRbQ (ORCPT ); Tue, 18 Sep 2018 13:31:16 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8IBsIpG099334 for ; Tue, 18 Sep 2018 07:58:58 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2mk0w205bj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 18 Sep 2018 07:58:58 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 18 Sep 2018 07:58:57 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 18 Sep 2018 07:58:55 -0400 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8IBwsMg46858370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 18 Sep 2018 11:58:54 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1CEEAE05F; Tue, 18 Sep 2018 07:57:38 -0400 (EDT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1DDC0AE05C; Tue, 18 Sep 2018 07:57:36 -0400 (EDT) Received: from skywalker.ibmuc.com (unknown [9.85.75.167]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 18 Sep 2018 07:57:35 -0400 (EDT) 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, "Aneesh Kumar K.V" Subject: [PATCH V3 0/2] mm/kvm/vfio/ppc64: Migrate compound pages out of CMA region Date: Tue, 18 Sep 2018 17:28:37 +0530 X-Mailer: git-send-email 2.17.1 X-TM-AS-GCONF: 00 x-cbid: 18091811-0068-0000-0000-0000033D1941 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009728; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01090083; UDB=6.00563121; IPR=6.00870103; MB=3.00023366; MTD=3.00000008; XFM=3.00000015; UTC=2018-09-18 11:58:57 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18091811-0069-0000-0000-000045C5F380 Message-Id: <20180918115839.22154-1-aneesh.kumar@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-18_04:,, 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=570 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809180122 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.17.1