Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp405586lkq; Thu, 3 Dec 2020 07:04:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzm/xu1zJWMXJuj+y+Ur92r5Ew0P7J2UEibM7+0Bvu/ydjPOX/z9gtmL9xvAXoOKs+fgTXf X-Received: by 2002:a17:907:28d4:: with SMTP id en20mr2946924ejc.196.1607007865164; Thu, 03 Dec 2020 07:04:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607007865; cv=none; d=google.com; s=arc-20160816; b=xXeIXUQjHqVZFPRjX+XZsMeTnmxl7pParr1QISRpiz8TYf/mU0J+ChbKVlrq9i6urK YVEwXGdsFGNqT1VMSALixBxmHZN2Z3T8eOyLfLK0VREMmw3Jyn92Lpa2t5QewIufWDLA 5d8X7qO/j1pDSRnctwvkiCGqqlsLPaaSFUJrGUw/7nAUWJWAqHaNxh9FFkr432G2mPBJ MiY2enKCm/Se7wI/UUVgeeM6G4UzzCmEV5cw/u/UGKJ11+rivzrUXda/YEYqNWQs6k0E HbWvlqdHTO8h7D09VUk6iDHdrD/4bWFTotdfUc+kvNU77SAoQB71+gUzDwd0CRFQGTD+ VpYw== 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=gtrUm39YRvjGQkpwp89JU9IieQfVUqXbXD00+JJB3kM=; b=GIbQC1xmL+xcgItTtO6dUanHGNJL3ZYnTZ6IA5MSfUACePBXnXE2/yM8TcQIQvugj9 +5qzNwZspfVyaV97vATRXPlgG59nWVjVej8XyQSTboIiCBhOUKj1ig84Zhg32OQPAtqg 4eJzDFLGoUWEUon+N7wmoclkIrLxGPO6sNJWbQPF4c3caLB0sLHGH2FZbha5Mev/lU/l i075nOwUqczEB3nzEHjeuZHFHN8tyraAqF9XeOz8d4aNZR5+nd7FGU5OOdyi1jAO25O7 jSOn3wDHKrAKfMrQf3w7eW4qcNogjRqC+TvIQQcR8flLHsayy9lkgaA/pcqII/GpLVg7 1yxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=OKkOz6wq; 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 v5si1083191edj.313.2020.12.03.07.03.57; Thu, 03 Dec 2020 07:04:25 -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=OKkOz6wq; 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 S1730872AbgLCPAO (ORCPT + 99 others); Thu, 3 Dec 2020 10:00:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727430AbgLCPAO (ORCPT ); Thu, 3 Dec 2020 10:00:14 -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 F399EC061A4E for ; Thu, 3 Dec 2020 06:59:33 -0800 (PST) Received: by mail-ej1-x643.google.com with SMTP id jx16so3866247ejb.10 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=sJCAWExw1m18w0QgQi0SIndAfZgdVaZi4MQDnyeF59fgUZMYH3mPeZlTm7ytmAzOR4 NoTmrSEt2JNXIZX1q6hH2R1hLMlQ8WkVp2r9aCNxaneWSFpdPoC2Jezx0NgJddDJsD9l ZZuOf102SxutadIrkscTRR8jyEsfIYfi0+k6QZLIeiPNY49Mwgy8ipnQHFjtXD1DAe0q 5HjJfgfupA/z3u+/T+cZn3ITuKpP7VfudopZGOnie6ElBkZhhN/LUQustAa+o4mcBkDQ QEO7qNfoTyx/5htTlUzJnRgkuKAcSIQZyNlpipzuyoX5WzaJf1a1Ip6J6RweP4tABOWD o54w== X-Gm-Message-State: AOAM532ZVd0NvWjspZU7SuYOk9tUNLVxqi3gReLazedXZCi+uEHdQdxx 862aa2+xdUfsi0fUSvSbfLAraoulhqaOd1mcgYX1BQ== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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