Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp122470ybf; Thu, 27 Feb 2020 17:23:01 -0800 (PST) X-Google-Smtp-Source: APXvYqxEqPTU7a7OpqicjlWqfebL3x6ZZj2c88EFiXpimOeVKfI0qXsUQcMf8KJXgcg2xFBiLwwy X-Received: by 2002:aca:724a:: with SMTP id p71mr1482654oic.23.1582852980808; Thu, 27 Feb 2020 17:23:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582852980; cv=none; d=google.com; s=arc-20160816; b=uCRUa5XPC1sy19gtmdjaO0tknTmFjCHkUH3IfLKerxU78raVUZM+nfzFEqERQX8cyG 7En3pxvWo+JKqrShb/99Z90JMkD82ixXNmXiqCJES+5EOHdyBQhKouh5KWZymNb1i0sr fpZ7T38p6+JFlTQXFLuFzvnnhhA0gbR6glwm8lxqZRpW1XAeIVS0PCmlaQThfimjrXJR f9L1wJyP6zQg6/ZJ2tM58uMHOhMvn19EYe9vC2TC1xQhTxCypxIbvsDUEdDFREeI7lJB hZ5W8SBchxEhovFvrTDUBtdYWHmRGMa0CxCduzRtyaHddl1VZpN+a6nmiqY5oELe5ZZF Smsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=cak9cJ/Mb3hTe2xfXh6S6Ay80plD5JE3MJ4puLqvb/0=; b=QaaB+dy32VOvJXYCEzftLU4ACRDb71+cMGa8yJpGAf+3pGa5c4Fw7eIBEavwmZa+k+ kjMg3MhEOH+kD7gFDi2MrtUZRnBNfAkeAXj/d8mUhQ1ZxzW1ETg+KBWZDaS6FhQp1LQ9 s4VEA8btFOKUxzyOyMw3ocSzG3Mpk68MrNJzgtoDJozFem1EDL0KwtIJziSqVbhF5JP1 RBPrYeOjJjp0QxFXyMBV7XGSjtfFdZI1OgabVW20OxmEsJ5/gRb2Ig14qeQW/P3KOnCS HGZzpCZhuU7GsxHh5N8KXKjkRMbomdBLGsaNEzIbDYjDZI4EUuxRztdmsjt7Rn6GdAZ/ ElvA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si564292oti.283.2020.02.27.17.22.49; Thu, 27 Feb 2020 17:23:00 -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; 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 S1730735AbgB1BVp (ORCPT + 99 others); Thu, 27 Feb 2020 20:21:45 -0500 Received: from shelob.surriel.com ([96.67.55.147]:46704 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730463AbgB1BVp (ORCPT ); Thu, 27 Feb 2020 20:21:45 -0500 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1j7ULS-0002E6-U5; Thu, 27 Feb 2020 20:21:38 -0500 Message-ID: <7800e98e3688c124ac3672284b87d67321e1c29e.camel@surriel.com> Subject: Re: [PATCH v2 2/2] mm,thp,compaction,cma: allow THP migration for CMA allocations From: Rik van Riel To: Mike Kravetz , linux-kernel@vger.kernel.org Cc: kernel-team@fb.com, akpm@linux-foundation.org, linux-mm@kvack.org, mhocko@kernel.org, vbabka@suse.cz, mgorman@techsingularity.net, rientjes@google.com, aarcange@redhat.com, ziy@nvidia.com Date: Thu, 27 Feb 2020 20:21:38 -0500 In-Reply-To: References: <20200227213238.1298752-2-riel@surriel.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-GuN/ZXBkrY1Ye2qQ9BQv" User-Agent: Evolution 3.34.3 (3.34.3-1.fc31) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-GuN/ZXBkrY1Ye2qQ9BQv Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2020-02-27 at 15:41 -0800, Mike Kravetz wrote: > On 2/27/20 1:32 PM, Rik van Riel wrote: > >=20 > > +++ b/mm/page_alloc.c > > @@ -8253,14 +8253,19 @@ struct page *has_unmovable_pages(struct > > zone *zone, struct page *page, > > =20 > > /* > > * Hugepages are not in LRU lists, but they're movable. > > + * THPs are on the LRU, but need to be counted as > > #small pages. > > * We need not scan over tail pages because we don't > > * handle each tail page individually in migration. > > */ > > - if (PageHuge(page)) { > > + if (PageHuge(page) || PageTransCompound(page)) { > > struct page *head =3D compound_head(page); > > unsigned int skip_pages; > > =20 > > - if > > (!hugepage_migration_supported(page_hstate(head))) > > + if (PageHuge(page) && > > + !hugepage_migration_supported(page_hstate(h > > ead))) > > + return page; > > + > > + if (!PageLRU(head) && !__PageMovable(head)) >=20 > Pretty sure this is going to be true for hugetlb pages. So, this > will change > behavior and make all hugetlb pages look unmovable. Perhaps, only > check this > condition for THP pages? Does that need to be the following, then? if (PageTransHuge(head) && !PageHuge(page) && !PageLRU(head) && !__PageMovable(head)) return page; That's an easy one liner I would be happy to send in if everybody agrees that should fix things :) --=20 All Rights Reversed. --=-GuN/ZXBkrY1Ye2qQ9BQv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl5YayIACgkQznnekoTE 3oPx0Af/TX+zEkUxcEv+yrrOG4Jv1BzQ8b6pdaygAYaEH2MhPrSDgprArigLLmWl 2eWVDfgfoNPn1FW1//hUCZREJvTFQDd5UgtrXiCVw3qXt66mI0OfQQ6FtSh9yWM1 YV2D7uzDucuGYd16wFVeOs5XkVtNZk1o1TjCWBi1UVMScPU42HROoG3rrZ3kPEtG JuXCdAPOq3S3s+PwyBushTVe51LNZCSFjA1lv0Y5viT52TgZU+ugySCme7wOnpb1 mT5UMkrUyjhye2TAqr0h3z8gpTYOG7uX5psZRx77l6eG89IedY/0hOAyk0MgwtSz iqGb8+FoH3rjeRiXsrQ9JHpc/uW3ug== =zMII -----END PGP SIGNATURE----- --=-GuN/ZXBkrY1Ye2qQ9BQv--