Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp8269795rwn; Wed, 14 Sep 2022 11:34:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR6tAyNwpCc5lzPEl5JPQ6Y6mPkIN9DH6I5rGWuNW03nrr2c8tU+ll0fIbbIUjg31hgDzVMX X-Received: by 2002:a17:907:d29:b0:77c:be93:d3a9 with SMTP id gn41-20020a1709070d2900b0077cbe93d3a9mr12917887ejc.654.1663180449167; Wed, 14 Sep 2022 11:34:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663180449; cv=none; d=google.com; s=arc-20160816; b=NLWrxmv2Lb/ZLz9AYbYTgBQ8bUf6OteYO2BNX2KtfqCExW203P2ESP/tXFR8M3h8j4 tia6ZfIijgk3gfgokcRF/eXm3qGDBalMv+jqqvKxQomO/VPaurRPkWFrjRfg2Z4rE6Sg bXkwup14O27MH7Tnjbij6DGH1WyoiHkhduKDu+vESVXybbf2pIrIpGIU0rBvx+PS7gCn 0MQo1HD3tJw9WZGGBZ19ZkDgahc79LBUDLk7mfikQK9C0f8p66q/C5CD4z6WTWdP+ahz vikxS1cwlF84/T7/VrM12hbgrS823DFeyqVXJzqjV8sWbh/8RGDOGmcmBtuAEs0XSgC6 YbuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=078ohqEl3SbvSuLUyK3z9/YOVVWoH6vsNvPCy6kXlrI=; b=YJkKXo7iScU5vpworn3liWA7MaF8AnEFQuEbS2uh7sw/7FyYJOPkFjGl9I1F0+kIWg TmrQSq0RTrt0nx7mSdXxDxqmQhPefet5oEuEXoZJQIRCNX4GHXPb7iUo7dUMHv4Hat7f 0az8vkmcZeLRu4e/SDM3viq7goCztUcQQeEowq3BJEZKYcN2lxIzrcFV+8qrCudvwMrI S1L9LRG+n/vKug4kdHi/g1AymX4qBb7xBVMJ1xLN7PFK9E/CfwumGo7hxIT582UpxjNP 3+O0gcbwqJHW+IYWspNxoPiYBKcYi2cBt6FkAFRVrqbiXKAc4hAafjza7jvReC2U2BiI 2aHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KJeN8BAb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n27-20020a50935b000000b0044615ee1b6fsi10293911eda.218.2022.09.14.11.33.40; Wed, 14 Sep 2022 11:34:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KJeN8BAb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbiINRyg (ORCPT + 99 others); Wed, 14 Sep 2022 13:54:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbiINRye (ORCPT ); Wed, 14 Sep 2022 13:54:34 -0400 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6E51E097; Wed, 14 Sep 2022 10:54:32 -0700 (PDT) Received: by mail-qt1-x82a.google.com with SMTP id z18so11779763qts.7; Wed, 14 Sep 2022 10:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=078ohqEl3SbvSuLUyK3z9/YOVVWoH6vsNvPCy6kXlrI=; b=KJeN8BAbeQhrvfhh8qJlMy+PCwI0ztOtPFYIGvj/n2ABIfXLdb93t6qjzN0kQM8+og eWmqaiwNRo7hnpwsuVFYx50Blm6etKPmPVX+wURHIU8xXv/HpBmbVMp28HYu5oMSUsGX +5EEDwSv5lIVQWgqp7TdRVAMdYl7ypTb2JnJm7oaXu08gcHZ1RFpv4YUkc63H8Pdw3RD D9fMiyebzoyOnhPUFxWGi4D3UGHh5Zsj1o53imZgzb+W5ArT9HtuzMRqlK1Qrp3HuvaU CjnoCGrYdIpmnafc2Tp/gi2czpGf2a79J1N08j6qoinJAsOfTLxH79I/JJq2e1CYp2/V tvnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=078ohqEl3SbvSuLUyK3z9/YOVVWoH6vsNvPCy6kXlrI=; b=2NspH0sbtWEPg7vGaROzVNaPP+Z38Wggi5WngXftYPKBYUbQpL+wz+O+30RaDJ9WBC wKJ73iRdgK+1nEQnr1cVzfx6WwtTO24omgG3X4QVVRGUHt5pQS1JxybhS9pubCPYcLno ZKSPhnwlhekXTsXw6FCVCn3r3iXCzVa5E48E2WZrJwKAs2aHw+a5yga3Fzmr6TBi3ci4 /QWXdQl83XHA33XfBKnPBu2FHOaTHdPA30zqeMsuGV25trkBXBDe+Dr8tzBYaZgag1Ya w9nzgyFitlwQ+p/YamFntPJXbRUqW3uxReU1rSXJGRp76YKUOBCacCBlCQOUtqOPbX1A xVdw== X-Gm-Message-State: ACgBeo1HWfjeoVMICKYHGUKksiJFnZ4Lfth51MUWLB8tjDSzII1SNrWQ 8euRHammi8X5kw5TVTar9fM= X-Received: by 2002:ac8:57c7:0:b0:344:55d9:dcd7 with SMTP id w7-20020ac857c7000000b0034455d9dcd7mr33921914qta.162.1663178071901; Wed, 14 Sep 2022 10:54:31 -0700 (PDT) Received: from [10.69.40.226] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id g21-20020a05620a40d500b006b59f02224asm2299077qko.60.2022.09.14.10.54.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Sep 2022 10:54:31 -0700 (PDT) Message-ID: <43aabfed-bc03-3fc0-5b9a-4c5e6ebb8416@gmail.com> Date: Wed, 14 Sep 2022 10:54:27 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH 03/21] mm/hugetlb: correct demote page offset logic Content-Language: en-US To: Mike Kravetz Cc: Matthew Wilcox , Andrew Morton , Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Frank Rowand , Muchun Song , Mike Rapoport , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Borislav Petkov , "Paul E. McKenney" , Neeraj Upadhyay , Randy Dunlap , Damien Le Moal , Florian Fainelli , David Hildenbrand , Zi Yan , Oscar Salvador , Hari Bathini , Kees Cook , KOSAKI Motohiro , Mel Gorman , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux.dev References: <20220913195508.3511038-1-opendmb@gmail.com> <20220913195508.3511038-4-opendmb@gmail.com> <33ff9543-3396-7609-3865-7eed20b853f5@gmail.com> From: Doug Berger In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/14/2022 10:08 AM, Mike Kravetz wrote: > On 09/13/22 18:07, Doug Berger wrote: >> On 9/13/2022 4:34 PM, Matthew Wilcox wrote: >>> On Tue, Sep 13, 2022 at 12:54:50PM -0700, Doug Berger wrote: >>>> With gigantic pages it may not be true that struct page structures >>>> are contiguous across the entire gigantic page. The mem_map_offset >>>> function is used here in place of direct pointer arithmetic to >>>> correct for this. >>> >>> We're just eliminating mem_map_offset(). Please use nth_page() >>> instead.That's good to know. I will include that in v2. > > Thanks Doug and Matthew. I will take a closer look at this series soon. > > It seems like this patch is a fix independent of the series. If so, I > would suggest sending separate to make it easy for backports to stable. Yes, as I noted in [PATCH 00/21] the first three patches fit that description, but I included them here in case someone was brave enough to attempt to use this patch set. They were in my branch for my own testing. Full disclosure: An earlier version of this patch set had more complete support for hugepage isolation that included migrating the isolation state when demoting a hugepage that touched lines in demote_free_huge_page() and depended on the subpage variable introduced here. At this point I will submit a patch for this on its own and will likely remove the first three commits when submitting V2 of the set. Thanks for your consideration. -Doug