Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp324271pxu; Thu, 3 Dec 2020 00:48:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIkFQ7DJ/JIaCYggSZ+TSvuiCtsswfOSqyedFnyVrM7+bQ4fTuzIN0EYLHBlg9wOulUsNg X-Received: by 2002:a17:906:5182:: with SMTP id y2mr1543397ejk.471.1606985330149; Thu, 03 Dec 2020 00:48:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606985330; cv=none; d=google.com; s=arc-20160816; b=GslOsBNWLZxu4AlHSTlR2PId1QMjDQwir44TCE7YQKuobvhiFCVSAVe0WyrJVsDbkL CMU1w1hLoRb2KBhNJIPFyeQ838iiiw0SSAJi6R6FpTfxtoESds2STGR2OBmR0as9n5bz krYzWPr5rnPnc0/Ya+/ECrY32fwye/X5SzHx5yscNZmWWWYPH9pb5ZL14D25JBnS/gIv FaDkwIDRyVuVOX30un9YevvHFvPCJYY/oby+PFl/GtKDD7sNNAq4IA15nB+dmytED3J3 EvX67pVT18Wm8IkeVypsUsTdkR0JFVzV1fsiJnINFPCDh/Q0IrCSiQy8SAGNXac+mpt0 2IXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6uBKNokODkdqTYoyM5NJG9oDc6vJ30ASPH6NJV4BElk=; b=qhDdDCZseWbDVQsST6PeCsSyQdBHjIMCdFtNtNchlAWhLqcBuzp7GNwkjHVPOzZUDf iujU7Dr55toMqa5AnjROVIULMtFbfI/x4NUclWNPvMmvoPeh4/WaSF0Ua3mLhQekZJ4Q d/qKcc8YBl68aFNxY0GqePLJuKVHwRges/Emwn8F7wI/uY2cJQ8nvngWflvALM/vx5h3 T5YpUSNaACA6aifwwbAVGDwOHoYWMFbWaltRGfio+YtVX+SbBuCHhQghV8UeS16oEfD8 gXSYPnykLIaJkVWx/ecB9tTyO5PNsw4iIads8Ez8/YVomcyaxz7E+Wvh1tz+uLD1aZfT fTpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=NCPr9J6d; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co17si544519edb.518.2020.12.03.00.48.26; Thu, 03 Dec 2020 00:48:50 -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=@suse.com header.s=susede1 header.b=NCPr9J6d; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730009AbgLCIrG (ORCPT + 99 others); Thu, 3 Dec 2020 03:47:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:55502 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727826AbgLCIrF (ORCPT ); Thu, 3 Dec 2020 03:47:05 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1606985178; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6uBKNokODkdqTYoyM5NJG9oDc6vJ30ASPH6NJV4BElk=; b=NCPr9J6dmvJLej5XeFrH/occ1ElUzlFRCUW20NDSvJNxKqQjgbqb9yW4eWfo3Zk/Cw8rE0 PkVRO84WXtp0vu0Hh0YoV36FQcaQLFRLODqil7CuWAxnlB34oyFFe8fEEZHuTGqDXnLHlf pfr2XeXQHhfmPInT1KBPAy2oq+DIDsU= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C7E9DAC55; Thu, 3 Dec 2020 08:46:18 +0000 (UTC) Date: Thu, 3 Dec 2020 09:46:16 +0100 From: Michal Hocko To: Pavel Tatashin Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, vbabka@suse.cz, david@redhat.com, osalvador@suse.de, dan.j.williams@intel.com, sashal@kernel.org, tyhicks@linux.microsoft.com, iamjoonsoo.kim@lge.com, mike.kravetz@oracle.com, rostedt@goodmis.org, mingo@redhat.com, jgg@ziepe.ca, peterz@infradead.org, mgorman@suse.de, willy@infradead.org, rientjes@google.com, jhubbard@nvidia.com Subject: Re: [PATCH 2/6] mm/gup: don't pin migrated cma pages in movable zone Message-ID: <20201203084616.GY17338@dhcp22.suse.cz> References: <20201202052330.474592-1-pasha.tatashin@soleen.com> <20201202052330.474592-3-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201202052330.474592-3-pasha.tatashin@soleen.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Acked-by: Michal Hocko > --- > mm/gup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/gup.c b/mm/gup.c > index cdb8b9eeb016..3a76c005a3e2 100644 > --- a/mm/gup.c > +++ b/mm/gup.c > @@ -1610,7 +1610,7 @@ static long check_and_migrate_cma_pages(struct mm_struct *mm, > long ret = nr_pages; > struct migration_target_control mtc = { > .nid = NUMA_NO_NODE, > - .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_NOWARN, > + .gfp_mask = GFP_USER | __GFP_NOWARN, > }; > > check_again: > -- > 2.25.1 > -- Michal Hocko SUSE Labs