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=-5.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 411B6C4361B for ; Thu, 3 Dec 2020 15:03:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A61DC206B9 for ; Thu, 3 Dec 2020 15:03:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A61DC206B9 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 1C4606B0068; Thu, 3 Dec 2020 10:03:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 199B96B006C; Thu, 3 Dec 2020 10:03:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D78E6B006E; Thu, 3 Dec 2020 10:03:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0155.hostedemail.com [216.40.44.155]) by kanga.kvack.org (Postfix) with ESMTP id E883D6B0068 for ; Thu, 3 Dec 2020 10:03:48 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A59CD5010 for ; Thu, 3 Dec 2020 15:03:48 +0000 (UTC) X-FDA: 77552290536.12.table04_300c85a273bc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id AAD1418027FC3 for ; Thu, 3 Dec 2020 15:02:39 +0000 (UTC) X-HE-Tag: table04_300c85a273bc X-Filterd-Recvd-Size: 5280 Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Dec 2020 15:02:38 +0000 (UTC) Received: by mail-ej1-f66.google.com with SMTP id a16so3935869ejj.5 for ; Thu, 03 Dec 2020 07:02:38 -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=2oBk06us5wVqdWMU+iMlK5adDApddIAgqhzs8YqwqZ4=; b=J/SCOeMKyQzEy6hV/vdq1obRRZ71jIXpN+DVY5fhw9NYL+fY5UT75nbp3VPGxsTCav W8pvlrZtJSrH7Lo17eDrHhEj7T6ND5H8YfhF2KSCMoOAIidzP+kD8Ifab6ZWf1ZdTJoT oJqtDQVRvaz9Hj12ZHM8dYP2yBgaZdqR9nPFDFguWJ7kYc2nj5vAs9D2Gk9uXtafnO0P nrmrV/CsQ2u1A39EcsqOoEjEGPjVr1L6vykZ8o/kG7XmOkwCsanbI2eNgsBZzULgXgsb SpYIQDNn9nU6uM847b+9UVqXCWMCOLTshhnvLCQxofcVwkRhBDqw74sp4aGG4zKSwCgo Cglg== 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=2oBk06us5wVqdWMU+iMlK5adDApddIAgqhzs8YqwqZ4=; b=JI6mLNewyoXFJT50hkj9prJpk171nBP9PDfYnKl4veQvHlrCBbKwicNT6YNr7kAj2h aLVPyQqqG4WIuuZFRW0HftG7Wrvui+ZTsaOfouKVKi0gn05sAtIvieDHov48RFN4hu6c sT5q9t5n1VWeidiV4wR2xBauRKzNKe+ZYREfqBytMEsnvdyKCliYByU5oHAU4KctdQls K725aYfn2ilo1ywO6NyDw/Q+aP4YChjurTTUuJMMUbCXkdJ94Z5aU/v67Y2kJoElxX7R gk8R9wgYP5sE6WkF6UUp6i4UpT2/yYQZJHbIegJq4asZkA35lddM9uCzQHv5F+DmkmFa G4Hg== X-Gm-Message-State: AOAM532TWNx94IJiDJL8lT2Kxq3ls8HJyQlLbxLk3W/3e70ybAzw12V+ cmy7mgRj30d8+bqMMQx5Dprp5cXj2Y0uH+sNwQTE+Q== X-Google-Smtp-Source: ABdhPJxoHdMGimV/GKPmQkcxnmmWd4M1Lv76VdAbfdEa6XT+0s8FgIiPFgBcYdq4M5pYZ4gIAMkrC62+uAvzY/njBhQ= X-Received: by 2002:a17:906:ce51:: with SMTP id se17mr2836575ejb.314.1607007757813; Thu, 03 Dec 2020 07:02:37 -0800 (PST) MIME-Version: 1.0 References: <20201202052330.474592-1-pasha.tatashin@soleen.com> <20201202052330.474592-5-pasha.tatashin@soleen.com> <20201203085744.GZ17338@dhcp22.suse.cz> In-Reply-To: <20201203085744.GZ17338@dhcp22.suse.cz> From: Pavel Tatashin Date: Thu, 3 Dec 2020 10:02:01 -0500 Message-ID: Subject: Re: [PATCH 4/6] mm cma: rename PF_MEMALLOC_NOCMA to PF_MEMALLOC_NOMOVABLE 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 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 Thu, Dec 3, 2020 at 3:57 AM Michal Hocko wrote: > > On Wed 02-12-20 00:23:28, Pavel Tatashin wrote: > > PF_MEMALLOC_NOCMA is used for longterm pinning and has an effect of > > clearing _GFP_MOVABLE or prohibiting allocations from ZONE_MOVABLE. > > This is not precise. You are mixing the implementation and the intention > here. I would say "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." > > > We will prohibit allocating any pages that are getting > > longterm pinned from ZONE_MOVABLE, and we would want to unify and re-use > > this flag. So, rename it to generic PF_MEMALLOC_NOMOVABLE. > > Also re-name: > > memalloc_nocma_save()/memalloc_nocma_restore > > to > > memalloc_nomovable_save()/memalloc_nomovable_restore() > > and make the new functions common. > > This is hard to parse for me. I would go with something like: > " > 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_NOMOVABLE > which defines an allocation context which can only get pages suitable > for long-term pins. > " I will address the above with your suggested wording. > > Btw. the naming is hard but PF_MEMALLOC_NOMOVABLE is a bit misnomer. CMA > pages are not implicitly movable. So in fact we do care more about > pinning than movability. PF_MEMALLOC_PIN or something similar would be > better fit for the overal intention. Sounds good, I will rename with PF_MEMALLOC_PIN > > Other than that looks good to me. Thanks! Thank you, Pasha