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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 E7339C433FE for ; Thu, 3 Dec 2020 14:59:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4D663207A4 for ; Thu, 3 Dec 2020 14:59:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D663207A4 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 43BCA6B0036; Thu, 3 Dec 2020 09:59:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E9AE6B005C; Thu, 3 Dec 2020 09:59:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B27E6B0068; Thu, 3 Dec 2020 09:59:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id 12A8B6B0036 for ; Thu, 3 Dec 2020 09:59:35 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id CB1291EF3 for ; Thu, 3 Dec 2020 14:59:34 +0000 (UTC) X-FDA: 77552279868.18.actor86_5009bab273bc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 9CE48100ED3CB for ; Thu, 3 Dec 2020 14:59:34 +0000 (UTC) X-HE-Tag: actor86_5009bab273bc X-Filterd-Recvd-Size: 5394 Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Dec 2020 14:59:34 +0000 (UTC) Received: by mail-ej1-f65.google.com with SMTP id ce23so132426ejb.8 for ; Thu, 03 Dec 2020 06:59:33 -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=gtrUm39YRvjGQkpwp89JU9IieQfVUqXbXD00+JJB3kM=; b=OKkOz6wq+D/58WmYowNmsHKpnl+a6upvx7wqFLtq5ZLZZ0xElkZgiu2bHTSGGzXWSU M0wNSsvohuyojmO/XXDZNNUGOp3Te9LdTsFyFJRfV4it43gj1+xZ2AaC8qNbq1l4zPpJ hbZMqK8jW0RPCaiAkV39YTewcPS/cQh5xrekksd1lUheDVCEZLwb5vWY2z4irSt6cvve JIWCICpI8CKs4aGj8sSc8uimuSPLFTswGWqw2ptDLXvU0h8yP3UGtyhkkuW6ZKXw8igb Lt94wSgfgZjGQkzsBom5Vufmj3Cncf4D4swH2QrvpZw2OO1qX6wc0bieZymG1jidp/Pt szeQ== 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=gtrUm39YRvjGQkpwp89JU9IieQfVUqXbXD00+JJB3kM=; b=mPfYr4ZL7Af3fWroqyTUGMCTNDxkEyrwPKDcIjButcCzUqGeAknatw4CX60mg/keiK vEem/bOaWev0apxWQUGrTdRZMYS3M28Ocd2eAnvcl+hl3irjwASzCJEN3d3FgVOQ+k5d mcjGBFqVvHuC2Hh4th2pHi/+eSwsZocYVy49RNgwKkYgesGUCK4LD/oZ9f7QzWmGrPhH 8xo85yhP+YwUwlYBSH0eFw8ALLc3Qn1vJU9+Nk5oDI572/YM7utlYBpsiGe2gf85lkxW C0uVdXqelsty7F0NKV82QFFf44mdIngfIKackfJ97KW2w3meQ9gWqfC27cU7kVYepCF0 6y/A== X-Gm-Message-State: AOAM531qti2PQKBPFlFuEpbiBW7BF7i/Gsk1xUkFM4J5cquDINNYsSyd p2sbFPxsfe7ox6DTHyAWCFlnyVl4F0tRaBtACfVt8Q== X-Google-Smtp-Source: ABdhPJz7t1z0/U/klW1evqOsuGhvga4qUdUoyFjbr45vNQEwHSdCNrp8kWH8h2F+2Xm91WdM3ugojkZJ+n9sHarZS+c= X-Received: by 2002:a17:906:ce51:: with SMTP id se17mr2820390ejb.314.1607007572721; Thu, 03 Dec 2020 06:59:32 -0800 (PST) MIME-Version: 1.0 References: <20201202052330.474592-1-pasha.tatashin@soleen.com> <20201202052330.474592-3-pasha.tatashin@soleen.com> <20201203084616.GY17338@dhcp22.suse.cz> In-Reply-To: <20201203084616.GY17338@dhcp22.suse.cz> From: Pavel Tatashin Date: Thu, 3 Dec 2020 09:58:56 -0500 Message-ID: Subject: Re: [PATCH 2/6] mm/gup: don't pin migrated cma pages in movable zone 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:46 AM Michal Hocko wrote: > > On Wed 02-12-20 00:23:26, Pavel Tatashin wrote: > > In order not to fragment CMA the pinned pages are migrated. However, > > they are migrated to ZONE_MOVABLE, which also should not have pinned pages. > > > > Remove __GFP_MOVABLE, so pages can be migrated to zones where pinning > > is allowed. > > I was wondering why we do have __GFP_MOVABLE at all. Took a shovel > and... 41b4dc14ee807 says: > : We have well defined scope API to exclude CMA region. Use it rather than > : manipulating gfp_mask manually. With this change, we can now restore > : __GFP_MOVABLE for gfp_mask like as usual migration target allocation. It > : would result in that 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. __GPF_NOWARN is added to hugetlb gfp_mask > : filter since a new user for gfp_mask filter, gup, want to be silent when > : allocation fails. > > This clearly states that the priority was to increase the migration > target success rate rather than bother with the pinning aspect of the > target page. So I believe we have simply ignored/missed the point of the > movable zone guarantees back then and that was a mistake. > > > Signed-off-by: Pavel Tatashin > > I have to admit I am not really sure about the failure path. The code is > just too convoluted to follow. I presume the pin will fail in that case. > Anyway this wouldn't be anything new in this path. Movable zone > exclusion can make the failure slightly more possible in some setups but > fundamentally nothing new there. I've been trying to keep this series simple for easier backport, and not to introduce new changes beside increasing the scope of pages which are not allowed to be pinned. This area, however, requires some inspection and fixes, something that Jason also mentioned in another patch. > Acked-by: Michal Hocko Thank you, Pasha