From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 143694403 for ; Wed, 14 Sep 2022 17:54:32 +0000 (UTC) Received: by mail-qt1-f170.google.com with SMTP id g12so11393097qts.1 for ; 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=X2e+4PLn/xKS4ePIiAZUFnwcSIE2I2CCq5kyoUeTAN7rGnWxZeQuPsdc7+k6CqRJuN p0K7cdh1G+Jj7Sflig0l8j4FsPaFj1510wB1XOYriVnTyAe5oDyVUajRzUf2ioAtcnIE X4e2+VenmPdJiEXoAEFrfWsNpmyav/tK/Evw6BU403T+MEJHSroftIJzhmJyOEKs+g70 iHWdytsx1zYKJ1IjJSOrr/LZhXYYFN9eN+aGss0XvtnlmOwthqCUCuF98cMnLDcmsz7N EvHsu4EnaMhKPTRMic08ZXCbvZ+dTobHBh08O2YbZc2l1SeZ4vLJ1TlvmX5xOQaThJH4 WilA== X-Gm-Message-State: ACgBeo1A62wS1UBNq9iiGLHdAaaCebTJbi9v4wmSmoDDtQfcUUkeZf8K Or9vfBK45/p7AWJwpYBLPt4= X-Google-Smtp-Source: AA6agR6TNcOs9G/1GT36JKa+IitWjuNF26XpK7u3lTR4YMggceCehr58RazsJJgUrvEATr7qoTnO3A== 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 Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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