Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1722119pxb; Wed, 10 Feb 2021 15:24:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvA4MYRXJJ+PtY1JuS6JQaEH9sm/MZNZ61+daiwuBWXWOwbOBqsEbqyKLzk6mV1aWl3vQ3 X-Received: by 2002:a17:906:1bf2:: with SMTP id t18mr5559363ejg.166.1612999495745; Wed, 10 Feb 2021 15:24:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612999495; cv=none; d=google.com; s=arc-20160816; b=XZTWJtpB0Yv3vmpeFFUOo6GL2X1VXIIjGgNDYJSRwNf+eq8ElnXUYmjGGbK8Emtr/f hU2wjk5wzCMDZn8rqMvw/McBnRSIbOTa7MV5g2KQLDUBnIzEnklW2cudkwV2NOCe94qa trHN5XzsG2io8BKvIrz/zylaS65AZpif0BBKwrzPhdnMnlRCCZPcsNNrCjM++DbZfKFF 0MaXpQ+LAj+3fje5MNor2Cu3Kc9VWnHUtTr7T6jo8dPbGBs0HU9Qv+cwdqOzci1gh82X TYY5PVO+5slrKCLEIwIlAYlUvIINUETEIPYP8slXVtjqJFyCj/sbpPzajMe1QCo6OToG U88g== 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=7sLTM6hfOssPDiik8aCiVdZ9zDHcXXsYyD4UKDqlbPE=; b=Up8uNymWGOL+QB+Po127kR2e15pbCZ/eKevIgv0nsruSv+kj9kthnv8qGfnYnXmV83 BGqF3UVIJp9m8hUi7ncrEpL4ZD2Y2ZTL4Y5YPrR3PiaHCQlbP79oT6Ede5d8J/5AYjyP nKDsJ7ZWo/hzWe2zsJZjfLzKcPlKInH4qMWtsii7IwCfQ/PndRHYXxibsG4lFCrG32ne DHAYszkAMl/P03al71xpF6erMQhq1gDIu20a8h3mKf4OgpHvD8AwuB+SBvCwbnNC+70M cAmtwZZDbiEjLxigOoK8MsSml7pNx4aPjkA7vGOyp8wLpnPaUv9OXv1i5YOqhLY0POVf TQgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=MvJckpZH; 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 gv6si2164060ejc.302.2021.02.10.15.24.29; Wed, 10 Feb 2021 15:24:55 -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=MvJckpZH; 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 S231815AbhBJXU6 (ORCPT + 99 others); Wed, 10 Feb 2021 18:20:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233792AbhBJXUw (ORCPT ); Wed, 10 Feb 2021 18:20:52 -0500 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BF62C061574 for ; Wed, 10 Feb 2021 15:20:12 -0800 (PST) Received: by mail-qt1-x832.google.com with SMTP id w20so2936326qta.0 for ; Wed, 10 Feb 2021 15:20:12 -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=7sLTM6hfOssPDiik8aCiVdZ9zDHcXXsYyD4UKDqlbPE=; b=MvJckpZHn/hprnwuzbgoMqt9Fu1fnum4GtFukDoVf5z8xeSrmRDVMHxrS1NWrvkB6u cm4O6rHocrqJQtnSYqK/5cTfAUp8Yfl3ZOMKtFvE3bqXh0SqxzKG0cEiFunuHxH+lR6k YwPQHK7lm2ZA0lKttIzkjMUd6v1C6/quD0vv9skkYZH+kC2o5+IcGDq4oqhTKdFpmdQB q32V+h7SiWmTYj0wEy0bTUUrz9TXdKoRnqj9sgm5sIv3DcFt+woW6+a9eQStIBdBERpV Tobur2Vggiax9rAYxMChluwdRObnUy16BOwoLXsNrv0tdQRiRCMtfMfd0FMGicmc5Sru tIMQ== 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=7sLTM6hfOssPDiik8aCiVdZ9zDHcXXsYyD4UKDqlbPE=; b=pLe87uM2ri9nKjxxnsWejMJ9GSUqECvcMYuNfzLuvt78CnsQyti/SQaRr4RMyfVGF+ yE/vOd+VGN/1WhlY95EdkVh8etxtVxE4QDd3AvSoWyI1uH2VZ5eTebHyGAU4X5mYuaFI SMfKr0PY3hc9STsLZyIPo8uVUHQ8LGbJiezXYqZC+qhq+J+jI057rxpv08b2JM6nwzlO jTBrwS39hi2Uphq20c/kvWlLYa/y2WzgyfqvZ/z6PGykZ57jDJXR11+6odmQXBxzM//C aCpMnG1UTHoZTJhX7IZzyX7je9U2aAcfDWga2J8jAHCzWJ4ElvHW2AwXgCAAbV5KkKbh Ts+Q== X-Gm-Message-State: AOAM533a+WaXZtHOZ9QOuEKnoCVXH1jzx1WkQtR0L6I4sdHGW+893q7f MbPchd6GGq6kcev1Fik4c+s9DYaGyVvqx0g1 X-Received: by 2002:ac8:37d1:: with SMTP id e17mr5146178qtc.215.1612999211741; Wed, 10 Feb 2021 15:20:11 -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 d128sm744698qkb.44.2021.02.10.15.20.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 15:20:11 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1l9ymI-006HPT-GH; Wed, 10 Feb 2021 19:20:10 -0400 Date: Wed, 10 Feb 2021 19:20:10 -0400 From: Jason Gunthorpe To: Joao Martins Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Andrew Morton , Doug Ledford , John Hubbard , Matthew Wilcox Subject: Re: [PATCH v3 1/4] mm/gup: add compound page list iterator Message-ID: <20210210232010.GT4718@ziepe.ca> References: <20210205204127.29441-1-joao.m.martins@oracle.com> <20210205204127.29441-2-joao.m.martins@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210205204127.29441-2-joao.m.martins@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 05, 2021 at 08:41:24PM +0000, Joao Martins wrote: > Add an helper that iterates over head pages in a list of pages. It > essentially counts the tails until the next page to process has a > different head that the current. This is going to be used by > unpin_user_pages() family of functions, to batch the head page refcount > updates once for all passed consecutive tail pages. > > Suggested-by: Jason Gunthorpe > Signed-off-by: Joao Martins > Reviewed-by: John Hubbard > --- > mm/gup.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) Reviewed-by: Jason Gunthorpe This can be used for check_and_migrate_cma_pages() too (there is a series around to change this logic though, not sure if it is landed yet) Jason