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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 8FCE0C4361B for ; Tue, 15 Dec 2020 04:38:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0DE25207B3 for ; Tue, 15 Dec 2020 04:38:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DE25207B3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2E9938D0006; Mon, 14 Dec 2020 23:38:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2996C8D0005; Mon, 14 Dec 2020 23:38:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13B678D0006; Mon, 14 Dec 2020 23:38:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id EE9818D0005 for ; Mon, 14 Dec 2020 23:38:33 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A17628249980 for ; Tue, 15 Dec 2020 04:38:33 +0000 (UTC) X-FDA: 77594260506.23.egg21_5713b8127420 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 85E9437604 for ; Tue, 15 Dec 2020 04:38:33 +0000 (UTC) X-HE-Tag: egg21_5713b8127420 X-Filterd-Recvd-Size: 5506 Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Tue, 15 Dec 2020 04:38:32 +0000 (UTC) Received: by mail-ej1-f65.google.com with SMTP id j22so7744292eja.13 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=dP0xvjNx0BmlQ2SWLNiEFb+9cbnHCQ0O4//ZfvRcsH5vydJlub0xk2BqRS9Halu3Gn 8ATpbKywSEs1IaL83vi9cEAfuFeg/fxEGXBxc5LV56kz9WZ2JAabzQooiqpWcHKHf2Lm S5x9k57NGaURg9Fh/zJaeBgLir+ex03IQpe73H9oRYUwsaw7pFKAbyZLtPVaGp68N3xu ep2aIZ1yT6l4BmLAIYhyBlp+6ZoMOIsLB33RGSu5uNT+DQdhe2920wVF39VLXD/39Ce9 DqlHuRXvIrLYj2/2Qh9ZSU3ObdcawD7gJZOyHmr2iu1ydPYNTP7vUzILVYBWKMFOGuFi CttA== X-Gm-Message-State: AOAM532ts0BR9/XOobhcsKPYvJhU36XRDHB7SMEA9WfO1k/qnbONdrYP iVcngH00Npx0RXgMy2Omq7OnSPGQmP/+TQdjvqwf5w== X-Google-Smtp-Source: ABdhPJxmmg2xBh9Z1x6jNfKkt61RWp5JGX1NTncLKP19jmRPohZ5nawq5vIMNeMZ2XyD8PMP5v+IraZ8V0c8PmC1A+A= 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" 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 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