Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp488526pxb; Wed, 3 Feb 2021 10:03:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyX6I/77i/RG7i1WCpM9nWD/ETLNYony28qgTipaPxG4AWHKT305AkYMXTj9FKrah9oy8cL X-Received: by 2002:adf:d1ce:: with SMTP id b14mr4860677wrd.329.1612375402754; Wed, 03 Feb 2021 10:03:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612375402; cv=none; d=google.com; s=arc-20160816; b=KVqrz2CsGzxEfhq6t6HMLxjD+h0XA6qWhHtv9hChZKwGh4oxXZm7ZipijKTnYq3sJw ku+yyewHSZRZ/xI4zM1Wyf0RQS4MqnZJ3K++XWRbRqT2HTwgHdcH5u+ydBUHjgWn5fAQ dtDgRbbZ1041quPmkcU1U/4Yw67lZ5IUKYNLGH2smp6oivL0qxQDDxcSUlzqUY1dONgu Mel0HyGPGUR+3IM/LE/4sObJoQudu+920nYB0wfSqrB/0Z2fjXmXbSbcuLWPSyl+14ov sz+VJPeLBJ6Oo/pT5CaYgkoDxe+HYYNmvfp3zhEQ9dUesIjjxRvCFBygkPq9SmOeIYyV BErQ== 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=maK4BO0r+TiWcThPzVJ4RLB+sQqUIwmjmNwcvNFw9mM=; b=TwYknXPMSlHbjO2MKsF9xn4I8XECaGFFFDWD4NBpiwr3tiRbUM5oP9nZ53yOS2MMBL rveN4KkHgNu75PpkvaGuOQfWuBFKqjUzX0vW25HjhXmS3HjYhvL7vBp88p87yPHSXF4n 85jKP0OEOKzGVwfIUdyH8x8XTQZhkN5/r2jojEFeshxUbZVLmdFsVjj9WJKLaINck/fd airsWdb8CMttVBn2vU4y7iW3ONXRI74jPKPa4efQ4I1iqSF8S/HAdBIAkRpzTTj4Gc/E jfqprDeDZzo8vFjlmqIRuK7/ZhsJ0zBpmq1GU4KmmmkfZtoQLCHcT7ExAZFixEgvYEWh Rp9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="OYYwV/hP"; 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 by12si1751371edb.611.2021.02.03.10.02.56; Wed, 03 Feb 2021 10:03:22 -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=@ziepe.ca header.s=google header.b="OYYwV/hP"; 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 S232727AbhBCSBb (ORCPT + 99 others); Wed, 3 Feb 2021 13:01:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232682AbhBCSAr (ORCPT ); Wed, 3 Feb 2021 13:00:47 -0500 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8755EC0613D6 for ; Wed, 3 Feb 2021 10:00:06 -0800 (PST) Received: by mail-qk1-x731.google.com with SMTP id x81so622369qkb.0 for ; Wed, 03 Feb 2021 10:00:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=maK4BO0r+TiWcThPzVJ4RLB+sQqUIwmjmNwcvNFw9mM=; b=OYYwV/hPNphEgxWKjIs0jsEBIteW6sjsSXmm3kaRKAgNvo0roJkISTnB3HeCqjylB1 iLoTG4ajADQexcPU77OJd+AN9V5ickef33AD3Y5bjRuNtAHpzo0+8Yw1vns5Lt5UhnC1 uKxg7AHn0awSVc6rMvjtk3PJ5vyhywm73ut3NeHl8CZk7DWGSksRjlVCzx6En8NmAr93 1M9M89Hj+fI+hzquvwbsBnibhh4tZtP2rpBjGZDKqcCQbz0bmK7NiWxQgCR4lwSqUAby tB+on+omxCPkuzrbxhR1IN8i6uluffWqHXTWxVrYzyuO2UNAn68SmpLVpA/L+mVnnkiK iELA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=maK4BO0r+TiWcThPzVJ4RLB+sQqUIwmjmNwcvNFw9mM=; b=HZFJrqyAkm/fzmeoNL39dPzN2VxWpcZsq4Bc/kU1cyi6GNtdcbvOgeVVxpho+WEpSk eOsjeVW6aRi3xMM8kffF3x7RJBeP9cmdB8QV9Bkx40M8fChBxo+d5/2XnJ8+qD7nIqYh b5tM4Lhz1D1ll4AnLIfnqJt9wDW5CAHB3/S5NhA73YxVyrRfoScM6coq0AxRzSAu3yG3 Rym4fBdY9dif8AV5wYw6prUFwRaVSzJrzSQO9IAAe/i/5jrmVaBvU6Cc3f6vIum5BbRo 7/i7yU4G+u4ZHbiOoRhQVmVBzHG6ECT2uTcN7mAS9GSFpl4o4VfegOTJk/EFXki6Jzj9 n2BA== X-Gm-Message-State: AOAM533wKDWisAn61L5czKF5QnyLphENsvNUCoyWow7SjYTRtc1BJsRD 61xkHb1cZCvUtevFAqDBqB7XVQlIgFI8jxay X-Received: by 2002:a37:aa58:: with SMTP id t85mr3620548qke.229.1612375205841; Wed, 03 Feb 2021 10:00:05 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-115-133.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.115.133]) by smtp.gmail.com with ESMTPSA id h5sm1970465qti.22.2021.02.03.10.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 10:00:05 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1l7MRg-0034r0-IJ; Wed, 03 Feb 2021 14:00:04 -0400 Date: Wed, 3 Feb 2021 14:00:04 -0400 From: Jason Gunthorpe To: Joao Martins Cc: Pavel Tatashin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, vbabka@suse.cz, mhocko@suse.com, 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, peterz@infradead.org, mgorman@suse.de, willy@infradead.org, rientjes@google.com, jhubbard@nvidia.com, linux-doc@vger.kernel.org, ira.weiny@intel.com, linux-kselftest@vger.kernel.org, jmorris@namei.org Subject: Re: [PATCH v8 02/14] mm/gup: check every subpage of a compound page during isolation Message-ID: <20210203180004.GS4718@ziepe.ca> References: <20210125194751.1275316-1-pasha.tatashin@soleen.com> <20210125194751.1275316-3-pasha.tatashin@soleen.com> <05a66361-214c-2afe-22e4-12862ea1e4e2@oracle.com> <20210203145313.GQ4718@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 03, 2021 at 04:13:21PM +0000, Joao Martins wrote: > If check_and_migrate_movable_pages() is meant to migrate unpinned > pages, then rather than pinning+unpinning+moving, perhaps it would > be called in __get_user_pages() place where we are walking page > tables and know if it's a PUD/PMD and can skip all the subpages and > just record and migrate those instead. Was that your thinking? I think a reasonable approach is to detect non-pinnable pages while walking the VMAs, when found isolate them and thread them on a linked list. When the VMA walk is done you'll have a linked list of isolated pages that need migration. So the check_and_migrate_movable_pages() gets split into the top half being diffused in the VMA walk and the bottom half still called after __get_user_pages() returns. Jason