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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 B744BC433FE for ; Wed, 9 Dec 2020 16:24:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2F3A723BDF for ; Wed, 9 Dec 2020 16:24:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F3A723BDF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 45E226B00E5; Wed, 9 Dec 2020 11:24:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 40CDA6B00E7; Wed, 9 Dec 2020 11:24:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 322ED6B00EA; Wed, 9 Dec 2020 11:24:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id 6999A6B00E5 for ; Wed, 9 Dec 2020 11:24:41 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2F89B180AD81A for ; Wed, 9 Dec 2020 16:24:41 +0000 (UTC) X-FDA: 77574267162.28.meal44_0007e56273f1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id DF0E06C04 for ; Wed, 9 Dec 2020 16:24:40 +0000 (UTC) X-HE-Tag: meal44_0007e56273f1 X-Filterd-Recvd-Size: 4488 Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Dec 2020 16:24:40 +0000 (UTC) Received: by mail-qv1-f68.google.com with SMTP id b18so832834qvt.10 for ; Wed, 09 Dec 2020 08:24:40 -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=8cMr2dgjkPnPu+tNugvleKxdn8sQchL81xxVbGoFiFk=; b=j0pMzIX19fqb3nEnN7dmTi/elQaraS0XarYog+6OqBXc8r+oGUTsoWkerS3wtrUH8I jq3EQ/5FLM4Fce+UHC7NznIK2FpQ3C83exkpH2zk6ZyEO1u817sof6i1zeGtnUbc5dsV t5f+dGO6g9y4DQ2xQb5CB2w4mYzbqIeJVhJ4+sJBG41YUHdJkGojWGaMX/f3QQOv/AtA tNi4sQ2uYP56Ejo5QbpuJFC1fVYAw2g7vcDBk/TR88T+J1OFmZxaChQ3g2gFo1C8Ijd0 y/dogaYdOD7o02D2LMbpZD0VyOI6iJ941W9PlVHtY4C/aqkRUc/ERp/Yr32ebB+7/hcd ECgg== 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=8cMr2dgjkPnPu+tNugvleKxdn8sQchL81xxVbGoFiFk=; b=D1GovJYJFXj7uUhxcgtAnJF/d/Ov8HzqsPVxGs/7DsVNLQxzedId9HKuXFe3ulIJ6C SSeLvfcrY3cmgNs8zPkl3HwSiYZLBA9TbPLfCHa4FHbuwHzNSwGlPOnJcD6181Yq/GvL 1ygTDWtzC6wOaPIT4Ve8y2kjabCkVgvKI5O+20osR0e57lmleIu1Mr+s88cPZfMYeF8e hM8gKoeIyDyUUEhW2mgGJZDlN2CS2SNX3OOU9yECquIuPlyYhXaOC3kNDXzsxVlvzCLm /T22xWUIg41uwdGdZrLTyClF0BX6bfami8He2OqtbA0VKBSHD4GGYxOtH6jT0/9wVQ4+ +pfA== X-Gm-Message-State: AOAM5323HwlxuQxHMEnGHs0a9ons5hRiWMkTCojRB8O63dXCoHPNs6vq mIzfMD0NFiz7dLE6Hgb5LGyQRA== X-Google-Smtp-Source: ABdhPJyHCb2u5YHnt7eqSRtX0gq3VUYJqwcDgFVl/ZG8huJjhs4tcfKYzUaKoOyuHJjezKzFui4U6w== X-Received: by 2002:ad4:47c4:: with SMTP id p4mr3900443qvw.23.1607531079819; Wed, 09 Dec 2020 08:24:39 -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 a185sm1324570qkd.83.2020.12.09.08.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Dec 2020 08:24:39 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kn2Gc-008Il5-FZ; Wed, 09 Dec 2020 12:24:38 -0400 Date: Wed, 9 Dec 2020 12:24:38 -0400 From: Jason Gunthorpe To: Joao Martins Cc: linux-mm@kvack.org, Dan Williams , Ira Weiny , linux-nvdimm@lists.01.org, Matthew Wilcox , Jane Chu , Muchun Song , Mike Kravetz , Andrew Morton Subject: Re: [PATCH RFC 6/9] mm/gup: Grab head page refcount once for group of subpages Message-ID: <20201209162438.GW5487@ziepe.ca> References: <20201208172901.17384-1-joao.m.martins@oracle.com> <20201208172901.17384-8-joao.m.martins@oracle.com> <20201208194905.GQ5487@ziepe.ca> <20201209151505.GV5487@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed, Dec 09, 2020 at 04:02:05PM +0000, Joao Martins wrote: > Today (without the series) struct pages are not represented the way they > are expressed in the page tables, which is what I am hoping to fix in this > series thus initializing these as compound pages of a given order. But me > introducing PGMAP_COMPOUND was to conservatively keep both old (non-compound) > and new (compound pages) co-exist. Oooh, that I didn't know.. That is kind of horrible to have a PMD pointing at an order 0 page only in this one special case. Still, I think it would be easier to teach record_subpages() that a PMD doesn't necessarily point to a high order page, eg do something like I suggested for the SGL where it extracts the page order and iterates over the contiguous range of pfns. This way it can remain general with no particularly special path for devmap or a special PGMAP_COMPOUND check here. Jason