Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp870502ybf; Sat, 29 Feb 2020 18:25:39 -0800 (PST) X-Google-Smtp-Source: APXvYqw8JOarigNUxOhrWaTuN8/5m8ECUjCSme2737IBxmFX0qw+xTaqX/gZHhQa2VeqsU2nrYjj X-Received: by 2002:a05:6830:1f0c:: with SMTP id u12mr8449237otg.253.1583029539238; Sat, 29 Feb 2020 18:25:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583029539; cv=none; d=google.com; s=arc-20160816; b=vXmd9zy6A44A/OYlrF/OGeo86CLRx1GcUoU18Z7ByxJcpWF59IpZiYjxD5wKxP7zw1 jrMYV5gmQpKin8s/LIhcTdZTsjvnQU9PP4ohCV3InSfbXYgbyaeMyP7W1eo7cdc6muPT 2CaqaOi6hVQMRGk+XZwZBKwWeXaczf2s4HMEau6LVgoig3AmijLG3Qfnhp4CrqjQxRtM yyl7Lxa0w3XNHirVLBHlv2E6cg5b6OrFRkeFTIloEpF1yMkSbWx3CEz0kD2cLBVe+Xt+ hjlKDXjYB2MCg2tnZBC3AjHXSGdTvlY3pmWY+pcoUIYbP8E/8iCQqulZSfAyAQck9MEF KDqA== 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=+awkLjkGMtaL9UHRpSD2yU9IAdbQXqI7K85V0gdfXuM=; b=jdggLmqowqYeP1Gv7W7xP67ygJD5Ah4ImSz1SbtT12EgIWvRlGBTYL0gT209ynvH2i lV0OkaxLlXFBngsZu1PwV+AVlfvu0PR8mJTHjfbLAfybHh7MRujETg7/OXadZl9QqwRT jiBAu0+yQmypAYjjtIVCtw1UZrogSio6M1mg/HhB/q3niUc0NgCQ6D8sQz1Fj74HSVqE SNdoIDM8EUx4l9pMmTIZ27czATLEZK4tcpI90I1VDy2tCz0lraA61tDo5MmonBXXkAoq GR4PDYCM50WgWwrpAeeKhqt+RjlGtzD6TIsDgUmrTlFsH9MuMejuoHFx0wuKH1NszwKN uN+Q== 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 l3si743215oig.197.2020.02.29.18.25.12; Sat, 29 Feb 2020 18:25:39 -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 S1727291AbgCACYU (ORCPT + 99 others); Sat, 29 Feb 2020 21:24:20 -0500 Received: from shelob.surriel.com ([96.67.55.147]:55254 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727240AbgCACYU (ORCPT ); Sat, 29 Feb 2020 21:24:20 -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 1j8EH7-00016k-Gx; Sat, 29 Feb 2020 21:24:13 -0500 Message-ID: Subject: Re: [PATCH 2/2] mm,thp,compaction,cma: allow THP migration for CMA allocations From: Rik van Riel To: Vlastimil Babka , linux-kernel@vger.kernel.org Cc: kernel-team@fb.com, akpm@linux-foundation.org, linux-mm@kvack.org, mhocko@kernel.org, mgorman@techsingularity.net, rientjes@google.com, aarcange@redhat.com Date: Sat, 29 Feb 2020 21:24:09 -0500 In-Reply-To: <1094fc21-9104-1410-bc03-f1934dbfcd66@suse.cz> References: <3289dc5e6c4c3174999598d8293adf8ed3e93b57.1582321645.git.riel@surriel.com> <05027092-a43e-756f-4fee-78f29a048ca1@suse.cz> <81c8d2fa-a8ae-82b8-f359-bba055fbff68@suse.cz> <1094fc21-9104-1410-bc03-f1934dbfcd66@suse.cz> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-uhw2MaE8So4ibiAndE8G" 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 --=-uhw2MaE8So4ibiAndE8G Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2020-02-28 at 16:17 +0100, Vlastimil Babka wrote: > On 2/26/20 6:53 PM, Rik van Riel wrote: > >=20 > > It appears that the order in which things are done does > > not really provide a good moment: > > 1) decide to attempt allocating a range of memory > > 2) scan each page block for unmovable pages > > 3) if no unmovable pages are found, mark the page block > > MIGRATE_ISOLATE > >=20 > > I wonder if we should do things the opposite way, first > > marking the page block MIGRATE_ISOLATE (to prevent new > > allocations), then scanning it, and calling lru_add_drain_all > > if we encounter a page that looks like it could benefit from > > that. > >=20 > > If we still see unmovable pages after that, it is cheap > > enough to set the page block back to its previous state. >=20 > Yeah seems like the whole has_unmovable_pages() thing isn't much > useful > here. It might prevent some unnecessary action like isolating > something, > then finding non-movable page and rolling back the isolation. But > maybe > it's not worth the savings, and also has_unmovable_pages() being > false > doesn't guarantee succeed in the actual isolate+migrate attempt. And > if > it can cause a false negative due to lru pages not drained, then it's > actually worse than if it wasn't called at all. We'll experiment with that, and see how often it is an issue in practice. If this aspect of the code needs improving, I suspect Roman and I will find it soon enough. --=20 All Rights Reversed. --=-uhw2MaE8So4ibiAndE8G Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl5bHMkACgkQznnekoTE 3oPf1QgAubWJCIPdZBomnqtqeXqkQcsFhxmG9DpikmTRcoNXX7zWbxFMPVk3KyyZ hOn+5R1mudluuIYV00LcFYSh1tFi6HDyf6Z/RztnXGykpe9s0ggFSe1tBJEM/AYN J7MYW9M0gFBfSHpi+pAmS/dkOVb5LtVtuDD3DZDd1cYs8vRLqPnpTmSdSgkUkl31 L9t2XJc6KmPdgXTwlv3+CvzfrVJbD15RRRWvw9ThAdsft/6n4RXSOR6BIovTBBqT FZCxcn6fk60dZPCvo5+IEjR7u24t67vQjX+sOFNRwxw3N9wg+9eO2agPcDfDBCUc qGvK2lxwzLcDcqhgHKrMvOye+aPmqA== =69L+ -----END PGP SIGNATURE----- --=-uhw2MaE8So4ibiAndE8G--