Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp694723imm; Thu, 4 Oct 2018 01:36:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV62OSHiGqx3J0ykobXsRNCWV3RYGbQ4AuLODS/0Lzx2JXdqjhzyaL/wjAqU8w47lT1zNW1ou X-Received: by 2002:a62:ac15:: with SMTP id v21-v6mr5690821pfe.126.1538642197388; Thu, 04 Oct 2018 01:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538642197; cv=none; d=google.com; s=arc-20160816; b=r2IgFEpe35n0fjkzDoG+yJkGUqlOJm5nyBuLWR+Gz4PpZkVn5x4WcwOZkASvQgMX8h qH7F88tX2ho21N9t09FWdixXBLndRfuk7050TqmY6RvCzwEYlgRxKxKsxASDCbJW5h7C sxsyu6cUzeqvI4Nnn9Zb2DQLpryXlvYyZeEjhZIBD8tTeJsQWbVfjLu+ZnpOlBbKhZSZ ocyt9hQ9sieHmEWq2hQhGBItkltxK473lApc4lUWzUS7l47ExS7+Z4gCgx572+rImhgG jIxUpJeY2ZxG8ue+54SvW737cgNZXRAeCUiYvNU+CVjm06iLgN8cPWbZ6YeKzm+FcH0h Abjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:references :in-reply-to:subject:cc:to:from; bh=uKwoUeL8BWarJ77QKTGTgvrFQZDv1BF3lpqSG1FSR8Q=; b=p8WKCyfpt1aG2wGxhAvj3/RSeIAA6Izr1DLS6yJCpS9rJKWONBTspVK9GSAYGIUMPq A1srkrtDlld0AYYITkIGzUfSgtXXb/HWWauC2/jS78hHrtiY6QAFweUBg7y1dg2a/SzC B5AuCLrpA20yDqmvqivBuHo7j8cxbXbAEKxnEZsHzz2YJVC+OGwO2k+X1rJsw5GQ7Rzz JXOtHjMkojdupjTj3lWhFbpsF7stmqwqTFD5MwJZMMAc22U5fyqpPWVG3UPEb5u0Gs9J +DyAmyPZwp6dAGyMed/OFHM7zY8Kn/2CieaAgz7LGb/I14fr01/18e/r0U6sEH1UVp7A dfTw== 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 g38-v6si4261606pgm.193.2018.10.04.01.36.21; Thu, 04 Oct 2018 01:36:37 -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 S1727654AbeJDP0s (ORCPT + 99 others); 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