Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp31912imu; Thu, 10 Jan 2019 16:26:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN5WvZDBHjpMWfehqlcg2+8lZ1NiGn5vmWoY33kNDngf6CR+sYnXenoEwrb5sy6SYYbbgQW+ X-Received: by 2002:a62:4549:: with SMTP id s70mr12205290pfa.233.1547166387509; Thu, 10 Jan 2019 16:26:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547166387; cv=none; d=google.com; s=arc-20160816; b=r04DVl9uOTI7HuZE7HnHoxFzBVzOAb+CyP+E0AoDRGg6PdITsSY1c48EznzDz8VBmd xVZ66oCzoAryBxb3M2a2ER4RvIAg7h8ufafcrAs19eu9/UsBZcrVHXhLYPJhq7uDT+zg pKOw82TFxPMOfl5e0kfgp7nG3gH8YPnRVrToDohuTXq9fUU3oMhq5CeX6MXzqM02nanM cIgtix4fTMXt17aBy8ULjWUx3J6p8jUMnDiS9X+NB/syRrvRIC6mi+/skX4pufZiuhJR 8Nc36MVinXZukl3oT1TttDixukFk25gysB11TBzkGIFy8MreDHINKm7Hy6gxQwEWnHaJ OuhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZZetU6aZnP+Ek4YKKW6F+RC5AZcEM2VNYYZbIysugkY=; b=Rdkzbt3S7UzPcqp+C9NOrDlq6t+kvZkxRUrUO+2pOXABxR3O61SB5Vc5FjMKvheRTZ EAVjWjL3jn2PSgIYeWHn91MmC9SlQ4EJubAbzg0/SU0kD78usnZ+8wiaWnIjlCym2het PP95tPheK3sugyejOr/k6amYxGIR/HvbOJgQn87A0VsT8YuRq99/8M+1+uwiQBZeKQhj FmTTY6nFx6uKOkSjnP+8yeSpEYfrGWstxwWxSNYDDSlKRqSOf60XzTYrYa53g3bdacq7 tBdIPitB+U2CDbcATscGrNX3u12uA1LplFniYpwshH7SJ0p/uYXFH/jhXXMAY4qPpvns N3eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b="Ppf/PBuU"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l36si2569180plb.433.2019.01.10.16.26.12; Thu, 10 Jan 2019 16:26:27 -0800 (PST) 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; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b="Ppf/PBuU"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729833AbfAJWyq (ORCPT + 99 others); Thu, 10 Jan 2019 17:54:46 -0500 Received: from ozlabs.org ([203.11.71.1]:60537 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727634AbfAJWyq (ORCPT ); Thu, 10 Jan 2019 17:54:46 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 43bLsw0wCHz9sCs; Fri, 11 Jan 2019 09:54:44 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1547160884; bh=LitWFpvdKXNjMwZx0YTbEvvuJx/7dVVFpRuZO0vLFk4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ppf/PBuUjkRWx6hYiEH7S7Ki9EO5l9PfNgW7iHtaF1DnzV9sad8MfxtImGLzuaSnb XvCSZdqL795ujNGsb232wLnt+trJyhcUoC0Uq2382BmDSJAQr2o+nvTTvYmmyoj65x T2r0+Zzd4fONoEwytSQvxXyw73yKrnoSbojVgck0= Date: Thu, 10 Jan 2019 15:11:09 +1100 From: David Gibson To: "Aneesh Kumar K.V" Cc: Andrew Morton , Michal Hocko , Alexey Kardashevskiy , Andrea Arcangeli , mpe@ellerman.id.au, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH V6 0/4] mm/kvm/vfio/ppc64: Migrate compound pages out of CMA region Message-ID: <20190110041109.GG6682@umbus.fritz.box> References: <20190108045110.28597-1-aneesh.kumar@linux.ibm.com> <20190108115620.6ec22e7d60b86d5f609d5a87@linux-foundation.org> <875zuyjk96.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0z5c7mBtSy1wdr4F" Content-Disposition: inline In-Reply-To: <875zuyjk96.fsf@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0z5c7mBtSy1wdr4F Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 09, 2019 at 02:11:25PM +0530, Aneesh Kumar K.V wrote: > Andrew Morton writes: >=20 > > On Tue, 8 Jan 2019 10:21:06 +0530 "Aneesh Kumar K.V" wrote: > > > >> ppc64 use CMA area for the allocation of guest page table (hash page t= able). 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 o= f 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 th= e lifetime of the > >> guest. > >>=20 > >> Currently we support migration of non-compound pages. With THP and wit= h the addition of > >> hugetlb migration we can end up allocating compound pages from CMA re= gion. 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.=20 > > > > Does this code do anything for architectures other than powerpc? If > > not, should we be adding the ifdefs to avoid burdening other > > architectures with unused code? >=20 > Any architecture enabling CMA may need this. I will move most of this bel= ow > CONFIG_CMA. In theory it could affect any architecture using CMA. I suspect it's much less likely to bite in practice on architectures other than ppc. IIUC the main use of CMA there is to allocate things like framebuffers or other large contiguous blocks used for hardware devices. That's usually going to happen rarely and during boot up. What makes ppc different is that we need a substantial CMA allocation every time we start a (POWER8) guest for the HPT. It's the fact that running guests on a system both means we need the CMA unfragment and (with vfio added in) can cause CMA fragmentation which makes this particularly problematic. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --0z5c7mBtSy1wdr4F Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAlw2xdsACgkQbDjKyiDZ s5J9sBAA5lc1/Su5Mk8Js41SPXyYqpqL564xEbq/qnGSLpg3S6KalgBl3t2cwN/0 mcd68QCi6vsD659ZwKtvraQDMA5Mk5mCMXaJo59WnN5eaio+gjQ6e5Ii8AjZjO/N peQhvsmk1TAy5GIC+h+s8o3g8r2gr5N/XxYnLBSz5DZhGtLH1Kpge1e6Gpk0dhlM CM59ss0KWfO912VtHicpWwsOt2ac2Nfk9HKBlPtboefLKjAf8lc/Yggaz7NWrm/Q Of5QXd94PaoH41Fy/t89LMOt4NuqTywx6/H0fcVCrYOxtHi9AMZ4o0xnEe+d1NqE 1LWVs6UTDgtSNkwygki7d3p3nY5vdLOsR84iioKZN5Ssvlv99pEDyBu55fhNvEO6 l4Q5cJigSk2Wxonn26Ktf50Ye3UV1JDFzvv4JQx19EfzvOI8aZREQWAJPvS0/s6n vb2NZg6MG8jLy7havZxqxGpTZEqWLt4u3ksDbAeOL2qNpYzrELIeNb+rKJOnF/BN wFWZ22vtrlXxJFDyTlOWTKLtX95PhYeviuZAqTqc8nTRbpe963rDpztxGOOclBG1 nipPp01RnwPG2XaqTdYnANWVFG0EHjdO+qQ8Ea9J5QCOswHjP02kbdPjPG5fb2zC /gdOd9+Co4t0tZjCreB96Bn/1GAzaj0TCyADV4hWEwlhUoKnBSI= =f8fd -----END PGP SIGNATURE----- --0z5c7mBtSy1wdr4F--