From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E95D4C2D0F4 for ; Thu, 2 Apr 2020 02:13:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AE43A208FE for ; Thu, 2 Apr 2020 02:13:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="smW3DrLt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE43A208FE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 447D58E0008; Wed, 1 Apr 2020 22:13:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F8648E0007; Wed, 1 Apr 2020 22:13:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 30E198E0008; Wed, 1 Apr 2020 22:13:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id 1A3EC8E0007 for ; Wed, 1 Apr 2020 22:13:25 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id BA2274DDA for ; Thu, 2 Apr 2020 02:13:24 +0000 (UTC) X-FDA: 76661293128.11.rod93_57f6eda5eea55 X-HE-Tag: rod93_57f6eda5eea55 X-Filterd-Recvd-Size: 4225 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Apr 2020 02:13:24 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4350520719; Thu, 2 Apr 2020 02:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585793603; bh=klz9eliX+7OT0FFYqY405/cf6rLKmbUmvzr4pvm6U58=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=smW3DrLtRQS4C3UmhDTRI2xaz4Yx8dDbtgpWlIbH4LPogR2WjWbeR7teiV6G6Tzey zjQ0EPNKzfOZCKea1LJL3kKZwOSMeVSGiFmb0g3IuJeYrcQ6bPMDfGlBOZZNq/tGY+ 1ujqrGItLOSS62tzbcR9oVu8SSRALuRM4T0ygyPs= Date: Wed, 1 Apr 2020 19:13:22 -0700 From: Andrew Morton To: Joonsoo Kim Cc: Roman Gushchin , Vlastimil Babka , Rik van Riel , Linux Memory Management List , LKML , kernel-team@fb.com, Qian Cai , Mel Gorman , Anshuman Khandual , Joonsoo Kim Subject: Re: [PATCH] mm,page_alloc,cma: conditionally prefer cma pageblocks for movable allocations Message-Id: <20200401191322.a5c99b408aa8601f999a794a@linux-foundation.org> In-Reply-To: References: <20200306150102.3e77354b@imladris.surriel.com> <8e67d88f-3ec8-4795-35dc-47e3735e530e@suse.cz> <20200311173526.GH96999@carbon.dhcp.thefacebook.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 12 Mar 2020 10:41:28 +0900 Joonsoo Kim wrote: > Hello, Roman. >=20 > 2020=EB=85=84 3=EC=9B=94 12=EC=9D=BC (=EB=AA=A9) =EC=98=A4=EC=A0=84 2:3= 5, Roman Gushchin =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > > > On Wed, Mar 11, 2020 at 09:51:07AM +0100, Vlastimil Babka wrote: > > > On 3/6/20 9:01 PM, Rik van Riel wrote: > > > > Posting this one for Roman so I can deal with any upstream feedba= ck and > > > > create a v2 if needed, while scratching my head over the next pie= ce of > > > > this puzzle :) > > > > > > > > ---8<--- > > > > > > > > From: Roman Gushchin > > > > > > > > Currently a cma area is barely used by the page allocator because > > > > it's used only as a fallback from movable, however kswapd tries > > > > hard to make sure that the fallback path isn't used. > > > > > > Few years ago Joonsoo wanted to fix these kinds of weird MIGRATE_CM= A corner > > > cases by using ZONE_MOVABLE instead [1]. Unfortunately it was rever= ted due to > > > unresolved bugs. Perhaps the idea could be resurrected now? > > > > Hi Vlastimil! > > > > Thank you for this reminder! I actually looked at it and also asked J= oonsoo in private > > about the state of this patch(set). As I understand, Joonsoo plans to= resubmit > > it later this year. > > > > What Rik and I are suggesting seems to be much simpler, however it's = perfectly > > possible that Joonsoo's solution is preferable long-term. > > > > So if the proposed patch looks ok for now, I'd suggest to go with it = and return > > to this question once we'll have a new version of ZONE_MOVABLE soluti= on. >=20 > Hmm... utilization is not the only matter for CMA user. The more > important one is > success guarantee of cma_alloc() and this patch would have a bad impact= on it. >=20 > A few years ago, I have tested this kind of approach and found that inc= reasing > utilization increases cma_alloc() failure. Reason is that the page > allocated with > __GFP_MOVABLE, especially, by sb_bread(), is sometimes pinned by someon= e. >=20 > Until now, cma memory isn't used much so this problem doesn't occur eas= ily. > However, with this patch, it would happen. So I guess we keep Roman's patch on hold pending clarification of this risk?