Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1809067ybh; Fri, 17 Jul 2020 01:31:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC9y/ABudyULYrd0sVPB/kvoRwsjnPrunOfJvr1we+mstGk3sT+BWM67StWs0QpI4rQ220 X-Received: by 2002:a05:6402:1ef:: with SMTP id i15mr8195089edy.378.1594974660799; Fri, 17 Jul 2020 01:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594974660; cv=none; d=google.com; s=arc-20160816; b=qputMEUbw/D5iW4zpZR1kF0RpNJsrzTipqYmbo0bUQvTP0SL2WzioBbN1EKhsq2RoC BddASRYhUhomOH+VRCAaXjhOuTWY4rqmmZoyfSs8+SwgJHjUyq2bYAFPfkQozizjyXyP oOONm91bVASGmoM67mEyFj2v1AMWkJhOkssn49vEqFjI+pd5YR5wFXzDgAP9nLToAO5A BQRDRldzWrs0UcvjU4unPSGMaLwTKeL3MPy9Xtk/I/PKfHwzc6VXR1GlfjpU+01F9nZO obeASqOFePql8v5vW0EhNVXs2E0gAC1OlIImsR6lUVs4L9VKLDXWTQPrLJs5o4RYWQsp kRZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=iDFlO+GQcqhp+vY+gvgj7kF+MF/l2MV7H3mINPfB+O8=; b=ZoNW/BLsvbV/raBfLZL4bwB+XeEEyjB0B7hNMDEUEfqCkXsbnAoUuP6zDC8L4LibHJ YG0GVLHZFIQb5CoomDmJRe2cCUNgqGq0ya42dxeofPlEgny5Lkyz85eH9oEWDPx/Brbo pNpAU6EofzW/KR1RtKPGeULB2YbqCd70TkAbyLkVihw/Vhayzv+LKDJfMx/Q0jEU2eP5 hqSCZGeEQR1o5GCzUjWQlXCzhw1F0f5PnIniAa9RwuoWQHfz5AzSZvEpYApKHaBM/fYt iRCczM9gORosMG9HUNvXRo0IP4Z81KoBXLQGkG9G5XqmHf3fPcmkJk4CC52kddimmedv g3Dg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si4971780edq.133.2020.07.17.01.30.37; Fri, 17 Jul 2020 01:31:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726845AbgGQI0s (ORCPT + 99 others); Fri, 17 Jul 2020 04:26:48 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:53587 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725864AbgGQI0r (ORCPT ); Fri, 17 Jul 2020 04:26:47 -0400 Received: by mail-wm1-f68.google.com with SMTP id j18so13774313wmi.3 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=ZkxUXPyFPqPFs/KbV9oQd2IRTcH7zaADCBMnTzEotSxqvY/MrawsxbKeHTrNTncnlh wWWMIWslrlOQUBpPqg+/KcHt2E0pJLr/unYUYEiKRVV90KfplPl/mcAP1JnMdRsObOXY x294PCkebjr3KfIE7QneD4Lg4m84S+jhDRjI08M1eorsACoA+BbGEmVQGkIBrERTZi+s WkPqXt+7t4C1d5a2acS7LxOjjf76LZZKRRTyOLgbVQFIZAFdePbG1lydj+7JEmwPwjGz 98Lrje6GIcbsK6pvHWsH2W0xwDkgZEqlGbQ1DnqWy0twVruF2iBPv3BBLKvAYEZHP5Da cAJw== X-Gm-Message-State: AOAM533GSJJ9xcy4I2JXq9UTT7BlOQL0cQkPd1g7rZYaLD/UpLmgyIPb R/7bcyKbdkVsiSMMZ1RBnec= 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 Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 17-07-20 16:46:38, Joonsoo Kim wrote: > 2020년 7월 15일 (수) 오후 5:24, Michal Hocko 님이 작성: > > > > 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 also > > > searched by page allocator. For hugetlb, gfp_mask is redefined since > > > it has a regular allocation mask filter for migration target. > > > > > > Note that this can be considered as a fix for the commit 9a4e9f3b2d73 > > > ("mm: update get_user_pages_longterm to migrate pages allocated from > > > CMA region"). However, "Fixes" tag isn't added here since it is just > > > suboptimal but it doesn't cause any problem. > > > > But it is breaking the contract that the longterm pins never end up in 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 > > Previous implementation is correct since longterm pins never end up in a CMA > managed memory with that implementation. It's just a different and suboptimal > implementation to exclude the CMA area. This is why I don't add the "Fixes"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? -- Michal Hocko SUSE Labs