Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3088204pxu; Mon, 14 Dec 2020 20:45:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3fqOO7pFa5SIssoJrtKCfNPotGT+/E8KWAQr9kleXiRMaeHxNIWnsigD2CcvQNNyVprhj X-Received: by 2002:aa7:c492:: with SMTP id m18mr5428580edq.236.1608007516287; Mon, 14 Dec 2020 20:45:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608007516; cv=none; d=google.com; s=arc-20160816; b=Y1xT+ihKEKLSbciYyk6d8QB6hWGyrOEFiWYk5XE6rGzZ9N3Kze2aHoEAC6X9z03RFs xPb7gEV/6dDZf7cyJDNS9Metr8duDgQMXTPfRBxYlONLyzmIo8dqHe1TJN7SWn/E9gQp HuLUWIA04qnlbIeqRWqhEBVYqWqpYOWEQBxYZCsVKL43fiQjz6492+yHDCYSRMvsfDwh 8J+0u5cedhWyRAUutSlJqu/p3YkNKo+5uf3Lg1d/LN1ldjmPu9/Mt+CLordC+CsUj/UG s6Z8GOTyX5lIp19xgPnnpDykfjbfwSw8fgbI4+zyRsYhxLPQgxyhv2HshhnZjug8z8/V YkEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bjas04zq4quJPDf/2Zl8W/3PIeOhXPZgNazOTkbLsjU=; b=iv0vpLere+RlMZsCNlnDC/XPa4ms0ZLAnSW0lxYely+TdHa3SmoQPvXXS48PiFZ4Jf 4F2dCgv25L9g77Ss5JpDC/8/iDWbcnT7j7axr4mfwin1lB1qRZrPiAiOT2J/S3VDCRbG ydIjmCZijNbmLj7kxXFwlvpSKayQWaT/hYdgLOHmSjbga/HXVoGQkDfgPg9Vdh/YRj7M nFmlUSght2swuyiEVjryfUw7ZnF1L38KVoakBXKrsj7l2yIJy5fosc32WOYTluPh/2wP 433WafCLCjcqCZyFeHN1Sq8EvBa0LYCQ59LPi8fR5VTnChP/GVieO13vhA3D8pF3NHgc Hu9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b="GDNB/aCq"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si302290ejw.546.2020.12.14.20.44.53; Mon, 14 Dec 2020 20:45:16 -0800 (PST) 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; dkim=pass header.i=@soleen.com header.s=google header.b="GDNB/aCq"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726022AbgLOEj0 (ORCPT + 99 others); Mon, 14 Dec 2020 23:39:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726009AbgLOEjN (ORCPT ); Mon, 14 Dec 2020 23:39:13 -0500 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1074C0617A6 for ; Mon, 14 Dec 2020 20:38:32 -0800 (PST) Received: by mail-ej1-x643.google.com with SMTP id ga15so25733448ejb.4 for ; Mon, 14 Dec 2020 20:38:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bjas04zq4quJPDf/2Zl8W/3PIeOhXPZgNazOTkbLsjU=; b=GDNB/aCqhln43599Pj7A2uVQlX4OYo4k0I9Dp6EdhU8h/suX8Kcgr94s0vG5G4AsnS GyqJ6Jxg0aq0K3BNSs6krIkxfxVrixOORoACeUCI0EeUYuHdU/0KkaODusnGRhJaz6uM 20EelORVe4K3b2B4XpT9vDqWkOylgP3IDNynB6isAOyS/BabSgEvuguS2d/zehk4KuDB pn6kpGKURU0c2xhX5BvLAc5xBp763QXa/l92BxeuvqdssCpgI6CwVq/H1yl18AdhYgsN OVkoWDZlyGX6whsYCfE8VOjfBcmyW2wRLZmsFb85XgqutAuXwV/jSLrIE65UNJ2g0UOE Gtig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bjas04zq4quJPDf/2Zl8W/3PIeOhXPZgNazOTkbLsjU=; b=HCPJWiXIKUKjOl/nxqnUuTSU53Oy5QiF8Bly6PmqyIF6EzwLeX+K2i6HaHCt/ecReR HSuKz6VXo5tcl9KWVhP4rXhmlZ30WIHHnvb9FfL9wPZk3f1lhCE9HxXFiFQN7qG8gF9J cNAmIS7gBde2DEnQQZNAm85AnIfPgO0aO3nXRTKb1WQCd12a+rHfDC78/EO8gmsZem1l ZuprNFH7DCH15/qA4EHLI+wu6wp2Lg9AdOVv0QJef732tA175Eha7iCFXx1q+7LGj3RG eMqEeUHWY7k5acwKMDyyayc1xdliBwOxES5ciCzRHMiyPGWjnvTAV/ZvRoVf7MecmKtS ryTw== X-Gm-Message-State: AOAM530AKdCxTq/ZG7yyd5YSagDwuVzfRi6iRv0Th7PKlsT0bQO9UCL0 fb9vq42vT38MyRD/P4QO1bWhHE8F+CDGBhP4iwsAKA== X-Received: by 2002:a17:906:fb9b:: with SMTP id lr27mr25823947ejb.175.1608007111384; Mon, 14 Dec 2020 20:38:31 -0800 (PST) MIME-Version: 1.0 References: <20201211202140.396852-1-pasha.tatashin@soleen.com> <20201211202140.396852-3-pasha.tatashin@soleen.com> <20201214140337.GD32193@dhcp22.suse.cz> In-Reply-To: <20201214140337.GD32193@dhcp22.suse.cz> From: Pavel Tatashin Date: Mon, 14 Dec 2020 23:37:55 -0500 Message-ID: Subject: Re: [PATCH v3 2/6] mm cma: rename PF_MEMALLOC_NOCMA to PF_MEMALLOC_PIN To: Michal Hocko Cc: LKML , linux-mm , Andrew Morton , Vlastimil Babka , David Hildenbrand , Oscar Salvador , Dan Williams , Sasha Levin , Tyler Hicks , Joonsoo Kim , mike.kravetz@oracle.com, Steven Rostedt , Ingo Molnar , Jason Gunthorpe , Peter Zijlstra , Mel Gorman , Matthew Wilcox , David Rientjes , John Hubbard , Linux Doc Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 14, 2020 at 9:03 AM Michal Hocko wrote: > > On Fri 11-12-20 15:21:36, Pavel Tatashin wrote: > > PF_MEMALLOC_NOCMA is used ot guarantee that the allocator will not return > > pages that might belong to CMA region. This is currently used for long > > term gup to make sure that such pins are not going to be done on any CMA > > pages. > > > > When PF_MEMALLOC_NOCMA has been introduced we haven't realized that it is > > focusing on CMA pages too much and that there is larger class of pages that > > need the same treatment. MOVABLE zone cannot contain any long term pins as > > well so it makes sense to reuse and redefine this flag for that usecase as > > well. Rename the flag to PF_MEMALLOC_PIN which defines an allocation > > context which can only get pages suitable for long-term pins. > > > > Also re-name: > > memalloc_nocma_save()/memalloc_nocma_restore > > to > > memalloc_pin_save()/memalloc_pin_restore() > > and make the new functions common. > > > > Signed-off-by: Pavel Tatashin > > Reviewed-by: John Hubbard > > Acked-by: Michal Hocko Thank you. > > with one comment below > [...] > > --- a/include/linux/sched.h > > +++ b/include/linux/sched.h > > @@ -1576,7 +1576,7 @@ extern struct pid *cad_pid; > > #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ > > #define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_mask */ > > #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ > > -#define PF_MEMALLOC_NOCMA 0x10000000 /* All allocation request will have _GFP_MOVABLE cleared */ > > +#define PF_MEMALLOC_PIN 0x10000000 /* All allocation request will have _GFP_MOVABLE cleared */ > > This comment is not really helpeful. I would go with > /* Allocation context constrained to zones which allow long term > * pinning. > */ > > Something similar would be useful for memalloc_pin* functions as well. I will add it. > -- > Michal Hocko > SUSE Labs