Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3894208pxb; Sat, 13 Feb 2021 13:14:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxYGARSMDSimcvAtQNR1qRoRYjekZVWQUu9Yjwm4tTuiotM1wnLJ55kFpsO1St/rxxNgyq X-Received: by 2002:a17:906:4897:: with SMTP id v23mr7783636ejq.21.1613250889030; Sat, 13 Feb 2021 13:14:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613250889; cv=pass; d=google.com; s=arc-20160816; b=WrRvmZ4MzyK3+RqKP8GIxu3kGuoTGBnYV4OlI0loZr6Rru/QRxUxlrLTwQ2ee4wDxh NDMn40tO0edptA9MEJUQzuW3CQp0mLG7mQdu9bBpp9c9q/v1WAzHvT/KHtvFFAO//+n/ M0E4C1zGu4KIKMCE9BTxjTxlHYjNJsQH010kfD3tL5zqCwOUlRDMTzIRQ2kxZmtNep6Q WzLU3b7tsTzAjKv8xUCcCiFQKyPybNAZyHK8/wFqU3swSvQK0KRoZKZINdCtRVWCIAbQ A8iyxcgCm57GdPwR0eMPlHgVhHmd9xCRPUfVAIDHLdbb6nGYbUYm/wcdF1Z8D6OyQaG+ fbDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature:dkim-signature; bh=QQfKoPSJGaWTVmRUJzJ4NHIxyedmUS/3nKj5LpN5F/Y=; b=Hz5QBI+PMRpgAXfe5O8JTJWOGDs5znhVCSEnaQbP7l3NnhmM87tR7A9V/Lvpxrs6i5 tNbk9sKdKXEx+AiHDTBv82BA7NxnKz6qsviR9KNXzLBUMobVyxbdLTnO6m3YQo951tO0 NpwGMv9xhLRfaD/BY5q01TZZ93BXz+gvpgWKXIJSEbNGGn82iPIbV8XVVDTzWOufBium DbWVrFd2LkZQf/B+y4Cb/h5NyLCpNeHvM62Ik+Y1vQXFSQ++lsfiO5nvv749dH3WtdN/ t7s7Rtxn+E+cMkGvj+KeWysKV4ZjVicWxTM60w3aTTlMriRdI31BugRV23MomaAxq5cy udVw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=Jb9VKl0P; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="ZiT/cNec"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bk4si9153641ejb.448.2021.02.13.13.14.25; Sat, 13 Feb 2021 13:14:49 -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=@oracle.com header.s=corp-2020-01-29 header.b=Jb9VKl0P; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="ZiT/cNec"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbhBMVN1 (ORCPT + 99 others); Sat, 13 Feb 2021 16:13:27 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:59716 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbhBMVNZ (ORCPT ); Sat, 13 Feb 2021 16:13:25 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11DLC6s5022232; Sat, 13 Feb 2021 21:12:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=QQfKoPSJGaWTVmRUJzJ4NHIxyedmUS/3nKj5LpN5F/Y=; b=Jb9VKl0P7VVzE1pGKNKljfe2SAWnATU09MGd2fpVDHMkV0fipwz7lAO1UIujOThtYZ8r Lagfw0yISKAp3ORZTOecIer913eE1O73ZtjMcMYBEIsvBttnqx6X3vPq80Oc5aZKUOgr SyAZi+5pW5O3Pst2VTIFXV3ouht7JhpXLJgk64i8Qbs2qV8ugP9kxBlUxJWasTbJuGgi FKL/5YA9mfUymWEhkLhM178t+YluUiqSpuqNKdCZ+TAEHHL5GASCD1c3BNe2mZ6n/IiV nGTRdFALk81ujs+WfO6eU80G5TsiuvWrIYmHZz40hkkILOISDvm+w1SYVmUAr9naTNAa 4g== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 36p49b16kg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 13 Feb 2021 21:12:31 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11DLA5pi177147; Sat, 13 Feb 2021 21:12:31 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by aserp3020.oracle.com with ESMTP id 36p6k02hy5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 13 Feb 2021 21:12:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jPrIpI9LvHbb292Ni7fx2qVvzd96Gm5F1gEGK9SjAOLvsl2uJH05R2AOjMm256FO8BpvftMpWOQ429Fg2kQ1VZmBW5NMHrG+CrLK1zpWN4k4mp6FUDquBzWuRO932aSQOxAGRB/U1eYi3225y5+EjsKjeMey+mnTOEyNgZqJq7jDobbqbjsGQ3bWPc+mSdRNritiVXC/6AJVDaa52/vwxetSrFjIkcRwgFrQJXoawSNlUCgp+nutpjjZPLnWvXke4xw2vmA2DoS4JavHafooYxFM5hevDZZ2/qnL/NQA9u4Yjzgo3DTbI3NBbtHeBn7fkclZHqZ1UmfW++Z+dH8Ffg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QQfKoPSJGaWTVmRUJzJ4NHIxyedmUS/3nKj5LpN5F/Y=; b=W0qAMtThsQJRypUsjIJrTTpA33yQmdEyJxwwMD7Ewc4EWWFRFTAVnwO6+4nRPhh0e1UqjEEh1+38hXxD0QRf7J9jJtQWRp1zg9spQ9q4jWWVBDAFB9XT6+GyquI8YT/KwzKyKFxXoiXbCchUQYKSCQ2903y6EZtcdo1tB+rlP2mNRnfu+qJk3M5HSkr4LQSBpCpWb3mq+JiWd+jrFHVZh9rL4asRxmoA05OnWszYuF1k2xJZ1eBqeFnLFNfWxje02B+E5f4CStlXes81b3rCsxBwYuf9YScz5thGpxvAw8IEHHieNOKM9tXk45AxcQtBfLStnf+YV1bt0W8GzNwpCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QQfKoPSJGaWTVmRUJzJ4NHIxyedmUS/3nKj5LpN5F/Y=; b=ZiT/cNec8OEfTbIZzTgs73/yHu1nMMXo7vcuueQjtpwZgYuSdvpHn07zTlQZ/AB6/5yZvpN1PL9/YiJ5JcOSikPW58+UUC4YtEbkEVn/K2b1nCFQX8i91q+/5eBqMr3ZzOGXi7XI8VacPthmkpF61KdbMkw5H09RrQHSBE1aumU= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=oracle.com; Received: from MWHPR10MB1389.namprd10.prod.outlook.com (2603:10b6:300:21::22) by MWHPR10MB1966.namprd10.prod.outlook.com (2603:10b6:300:10d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25; Sat, 13 Feb 2021 21:12:28 +0000 Received: from MWHPR10MB1389.namprd10.prod.outlook.com ([fe80::897d:a360:92db:3074]) by MWHPR10MB1389.namprd10.prod.outlook.com ([fe80::897d:a360:92db:3074%5]) with mapi id 15.20.3846.035; Sat, 13 Feb 2021 21:12:28 +0000 Subject: Re: [PATCH 2/2] mm/hugetlb: refactor subpage recording To: Jason Gunthorpe Cc: "Matthew Wilcox (Oracle)" , Joao Martins , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , John Hubbard , Dave Hansen References: <20210125205744.10203-1-joao.m.martins@oracle.com> <20210125205744.10203-3-joao.m.martins@oracle.com> <3d34111f-8365-ab95-af11-aaf4825204be@oracle.com> <1ae0313d-de9b-4553-1f68-04c4f5a3f7eb@oracle.com> <4d3914e9-f448-8a86-9fc6-e71cec581115@oracle.com> <20210127000730.GB4605@ziepe.ca> <20210127021023.GC4605@ziepe.ca> From: Mike Kravetz Message-ID: <0b75d477-c041-7830-5d28-bdf0a3530ee9@oracle.com> Date: Sat, 13 Feb 2021 13:12:26 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 In-Reply-To: <20210127021023.GC4605@ziepe.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [50.38.35.18] X-ClientProxiedBy: MW4PR03CA0111.namprd03.prod.outlook.com (2603:10b6:303:b7::26) To MWHPR10MB1389.namprd10.prod.outlook.com (2603:10b6:300:21::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.2.112] (50.38.35.18) by MW4PR03CA0111.namprd03.prod.outlook.com (2603:10b6:303:b7::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27 via Frontend Transport; Sat, 13 Feb 2021 21:12:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eba89cae-2a5a-4932-7c81-08d8d0641178 X-MS-TrafficTypeDiagnostic: MWHPR10MB1966: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9bAueU5JuwYUKr3P6Zl4XQICvHJsNmoCjeFYZgLVQWyWcwKDEkkyDqYcIwyWkasjnL7xeXinHUvGdusPi7kLiZ1Yp1BG4px/4GuPLfdVz3/4FwlNAUNa6tnk8d21bA51F4HhIV4wXUVnFqEmnMM67b5apPTziQs4FJWtr5XrqHy0DaPFOlpDXb4GdwSSL+7jVwHyNepZai+UijTMpxD5jKwJl5IWxkvzDZDvST8hWkbcWgMLc1k6PExlKNmUtKufbJRpXni61spmDvrAhvFmBoFTdapSrpe9Lx5RPoGnMST+NGMiet6gxVa5sagvXM1Y4ST1VfdzkZf0Kv9OjKLhT6nFWutsRALPzgpvamQZsdSjX7LG60P6cdFAYTadhsR21sOttmZsObLXBiK0+6BzfAAMrFxXGN1Fg8Wg0jGJBYi3OMQ84CuGJImSwwjOH7/GtE3FohtILQaeF9JIuQONSVoqh+pyBxBiqPzWJTIWMK37Oe9C1uHhdault8eAL/EO45C+I5WSNLDSdZ6yuu6d68fRsGom7Wj5E9O7SruajudSUVKCqsW7HNJz4PL9YHZ2w8p8/shPspVbyHAXBOBvThH2PVxcQrmqSMYMbkzfO9d36HQknC6TmgM/Sf0DW33fESRyNTW/h5/foJe4F1MJfBsFWAnI6tNZZghkY6rOoQpFuyA3LZDLy5SwTBGIMX73 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR10MB1389.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(376002)(39860400002)(366004)(346002)(396003)(44832011)(8676002)(956004)(52116002)(2906002)(6486002)(8936002)(66946007)(966005)(66556008)(5660300002)(2616005)(66476007)(83380400001)(53546011)(36756003)(4326008)(54906003)(31686004)(16576012)(26005)(16526019)(31696002)(478600001)(186003)(6916009)(86362001)(316002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?bVhNUkxCUlNxaCtkcDNpMndHdnBPbXNRei9rdjVSd1hEcnZpZlZwenJSQ3Uz?= =?utf-8?B?M2p2WEZady9MZFQzeXJlNnQzYUl2d0YwL2J3UU5McDQ3V2d0RGs1Z3JOOVBU?= =?utf-8?B?bkJoQkE4WWRHVGh0NnB5QWZlbnJNWlkxTUpzUFJwRjltTWF4R05JaGpwdS9a?= =?utf-8?B?NnZsaE8vKysybTd6NEJHdHpqZmxSc3k5c0RVdEVzS2tHSkduTEZEMW9JZmdU?= =?utf-8?B?bFdtRUVzTW9mSXpRaHBaK1FydWVvcDBDT2VweDVrcEx1S2Nac04yd1E1a2FY?= =?utf-8?B?aytOVytoMGpOaFVUbjhOZXlTUUhGb3l1azRaczlhRmxRWmJERWc0aXMrdEd6?=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QU5MZE13dXl0K1ZVZ1Q0aFlMTVRiMkgr?= =?utf-8?B?UVh5OUtqc2IzLzNBUkc3d3NuOWFNYnA0VTlabXZZMjFzY2pHOEFkemRTL09y?= =?utf-8?B?SE9JeEY2TS9BMk9QbE02M3RwY20vMkM5QVZOL2dxcjNmdUttYkFROThMWEd4?= =?utf-8?B?cDc1M3dWNGlWaDgrL1R1Qlk3eHRZZmEwcm1DYlEzd1NWYmNhVCtvcmJ1NkFJ?= =?utf-8?B?dnlST00yRFZSSm9rM2t1OGl1alU0cjJneUpEbzVSbnpzYldpTDk1RUhqMjUy?= =?utf-8?B?RXIvTHhiRjZLczEwVkg2VEdrcW1Zbi91azBWUmJFck5uMXJzVS9YczlHdThH?= =?utf-8?B?a1hhcFA5cC9KR0tQRFdMSGFiSWh3dVc1MnVldGhJTVMyZGFuK1Mrb3dEUEVp?= =?utf-8?B?NGFHNC9JdFU2c1lzTUV2S3NYWXY2bzZkTWlIL3lCbXVHcW4wUVcxZDQvWHNy?= =?utf-8?B?bC9rRFg1YjFZTUtxMUVGNzlWL2VCRHVqNUlZY0FMWnM3UUxLbHB2MWR6YnpU?= =?utf-8?Q?XWVAkPM/YQo3fuZTglxRMJ3ADeuK/eWdUUlY1RA?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: eba89cae-2a5a-4932-7c81-08d8d0641178 X-MS-Exchange-CrossTenant-AuthSource: MWHPR10MB1389.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2021 21:12:28.3400 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nTrx5k4wA3MTIpclnVJ+6SJv1/95SQkuoue0k6RVoJArYC+4SWgQzGQljFVTP4Qpa0SQDWVLhNmuDJs5XuyK0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1966 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9894 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 suspectscore=0 mlxscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102130197 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9894 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 phishscore=0 clxscore=1015 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102130197 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/26/21 6:10 PM, Jason Gunthorpe wrote: > On Tue, Jan 26, 2021 at 05:58:53PM -0800, Mike Kravetz wrote: > >> As pointed out by Joao, you can also see the differences in pfn_to_page >> for CONFIG_SPARSE_VMEMMAP and CONFIG_SPARSEMEM. The only time we might >> have issues is with CONFIG_SPARSEMEM. I would bet CONFIG_SPARSE_VMEMMAP >> is far more common. > > I think it is fine to have a different pfn_to_page, it should just be > illegal to combine pages into a compound if their tail pages are not > linear in the map. > > Matt's folio work might present an option to audit the whole mm for > this pattern and provide some folio_next_tail_page() accessor that > does the fast thing - but I question the value of such a project for a > 2008 era PPC platform with 16GB pages (seriously?) that may be using > VMEMMAP today anyhow?? > > Maybe others know of more modern use cases > > Jason When discussing v2 of this patch, Zi confirmed that this issue exists today. See, https://lore.kernel.org/linux-mm/3d2acb33-57e2-060d-616f-cce872c77307@oracle.com I will fix up that unexpected discovery in the hugetlb code. But, not sure what approach we want to take elsewhere, such as the GUP code. -- Mike Kravetz