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=-4.0 required=3.0 tests=BAYES_00,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 CD931C433E7 for ; Fri, 17 Jul 2020 08:27:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 971952071A for ; Fri, 17 Jul 2020 08:27:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 971952071A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 24D828D0017; Fri, 17 Jul 2020 04:27:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FDD28D0001; Fri, 17 Jul 2020 04:27:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1150A8D0017; Fri, 17 Jul 2020 04:27:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id EF88C8D0001 for ; Fri, 17 Jul 2020 04:27:07 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A8B0F824805A for ; Fri, 17 Jul 2020 08:27:07 +0000 (UTC) X-FDA: 77046887694.20.book71_5f1125d26f09 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 6771018086DEC for ; Fri, 17 Jul 2020 08:26:58 +0000 (UTC) X-HE-Tag: book71_5f1125d26f09 X-Filterd-Recvd-Size: 4503 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Fri, 17 Jul 2020 08:26:46 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id g75so13763737wme.5 for ; Fri, 17 Jul 2020 01:26:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=iDFlO+GQcqhp+vY+gvgj7kF+MF/l2MV7H3mINPfB+O8=; b=YWMJnWZpEvcHWuoqrqN/d0yuC8Js2BRdM+R14k/pkHiBE/4v6G+SC77gAmtBgo4hTM EbvotMPdrht/IMynrrW2kBZiKtNUMBYOyJWm93VDduHvRI0/86klpFGtaoOr9+oih7JA ZH+WY0ykBAwo2zaa8DLGmc7/V85IEiRFxGKEyen4mPJpShbIZ5+O1N/+uDlMqACpYEI2 3HH41wt4dzRvkGJA52apopSH2wzZe5imcax3TNeWR+A7qcp+lxujrA3ZUmBXKdPcjQK7 sirdYx+slzB4ORvhYr3iGmjwMUBr9rvOX7vkr1SicdLzoYpitNyzSqoun/5ezJm6stnK Q/zQ== X-Gm-Message-State: AOAM531TxjwJogMGRHJ+baKlVNFLA4CH0lOIl6oPG2Q6Iea49j5sRcaG UbW+d9SZpD6/7rjhZc8VmBw= X-Google-Smtp-Source: ABdhPJyZ2qI3nRV3baByYIs8hnUOISWF5gmXw3Qszj4PHiwtQ9OcDbrrxBVDq6YLJIiE983WiQe3iA== X-Received: by 2002:a1c:18e:: with SMTP id 136mr7932171wmb.93.1594974405897; Fri, 17 Jul 2020 01:26:45 -0700 (PDT) Received: from localhost (ip-37-188-169-187.eurotel.cz. [37.188.169.187]) by smtp.gmail.com with ESMTPSA id t16sm13569982wru.9.2020.07.17.01.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 01:26:44 -0700 (PDT) Date: Fri, 17 Jul 2020 10:26:43 +0200 From: Michal Hocko To: Joonsoo Kim Cc: Andrew Morton , Linux Memory Management List , LKML , kernel-team@lge.com, Vlastimil Babka , Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , "Aneesh Kumar K . V" , Joonsoo Kim Subject: Re: [PATCH 2/4] mm/gup: restrict CMA region by using allocation scope API Message-ID: <20200717082643.GC10655@dhcp22.suse.cz> References: <1594789529-6206-1-git-send-email-iamjoonsoo.kim@lge.com> <1594789529-6206-2-git-send-email-iamjoonsoo.kim@lge.com> <20200715082401.GC5451@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 6771018086DEC X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 Fri 17-07-20 16:46:38, Joonsoo Kim wrote: > 2020=EB=85=84 7=EC=9B=94 15=EC=9D=BC (=EC=88=98) =EC=98=A4=ED=9B=84 5:2= 4, Michal Hocko =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > > > On Wed 15-07-20 14:05:27, Joonsoo Kim wrote: > > > From: Joonsoo Kim > > > > > > We have well defined scope API to exclude CMA region. > > > Use it rather than manipulating gfp_mask manually. With this change= , > > > we can now use __GFP_MOVABLE for gfp_mask and the ZONE_MOVABLE is a= lso > > > searched by page allocator. For hugetlb, gfp_mask is redefined sinc= e > > > it has a regular allocation mask filter for migration target. > > > > > > Note that this can be considered as a fix for the commit 9a4e9f3b2d= 73 > > > ("mm: update get_user_pages_longterm to migrate pages allocated fro= m > > > CMA region"). However, "Fixes" tag isn't added here since it is jus= t > > > suboptimal but it doesn't cause any problem. > > > > But it is breaking the contract that the longterm pins never end up i= n a > > cma managed memory. So I think Fixes tag is really due. I am not sure > > about stable backport. If the patch was the trivial move of >=20 > Previous implementation is correct since longterm pins never end up in = a CMA > managed memory with that implementation. It's just a different and subo= ptimal > implementation to exclude the CMA area. This is why I don't add the "Fi= xes"A > tag on the patch. But the current implementation calls memalloc_nocma_restore too early so __gu_longterm_locked will migrate pages possibly to CMA ranges as there is no GFP_MOVABLE restriction in place. Or am I missing something? --=20 Michal Hocko SUSE Labs