Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7235850rwn; Tue, 13 Sep 2022 16:45:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR4J0K6PRtG2xmuVxFW6Pr5PjtTPnj+ivVilF0ou45m61NO3cbz2c0xewi2STnQHwbq/K3VA X-Received: by 2002:a17:906:5a6c:b0:77c:c2db:63ab with SMTP id my44-20020a1709065a6c00b0077cc2db63abmr9229097ejc.431.1663112734572; Tue, 13 Sep 2022 16:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663112734; cv=none; d=google.com; s=arc-20160816; b=YH2wxHwUxGqQYedHjkZon5YIES1ZCM1qHKr0y8wsGrOHnX3+0On17eqKjHtgP+1CgT FP8nenWipvsP94uBBhz5o6kHi+Og0c3ck/aNA2ae8W0HXvkTsi9m3v3UtYVRQbiZhRy0 9JyFGy490K6oh/42zbatswnOsLBUuGrjt76pFhGJyIXr8BvhXGBq7K+SEAAwppuYFZ6c U4rIynBCDyqvl2AojENAptLscN1Uxa9f9o4+/OGMG0RVpLgqW2OsGUWcJOMUXk4ZLVSY Pu9nKQ9zdkBORpQsPurwzIx4V+VGwhRlLYB79TXsMaWl8v7TRlPQbU59Wi2II7RHbR+J 3xGA== 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=/9i0RT8xYnvhhYLydSNCy5w2V2bVU0zcdBS2b/Mx3KU=; b=X/Eb3st1LzI5FxgwOiy8kkgWp0XuiOQZBot5aqolCR7WqU+xeuE/EFCFFgNQBxcABs 6mIb3NsWrIgO5LmHFnEkgdpBNaHoCPctKzl1r5XCrH39YnSSVWNjyzGGq+FOJAt+SqsS wlwA+2BYlldEHiJYdh/mdhlzHERjy6bDP3Zt1XEPMO85ovPhhqkqQAwZEV1oLLnBa1B1 v6ubdNs/YcwIqWcmFsx5z1iqUW/4EZQfOiW+RSdbjsLFac05QvtZqSTl1cIyYvayGvdT LveuOpLOd8LXfQQNH/X9ah5Hwm7FHDzQPHT/SQrtA7lbJnRW2RwKO7cYBnAcEo1M3g8e u+ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=t4p3qotL; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020aa7d487000000b004483d16d216si8736616edr.623.2022.09.13.16.45.07; Tue, 13 Sep 2022 16:45:34 -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=@infradead.org header.s=casper.20170209 header.b=t4p3qotL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229510AbiIMXe5 (ORCPT + 99 others); Tue, 13 Sep 2022 19:34:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbiIMXez (ORCPT ); Tue, 13 Sep 2022 19:34:55 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7330A1A3AF; Tue, 13 Sep 2022 16:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/9i0RT8xYnvhhYLydSNCy5w2V2bVU0zcdBS2b/Mx3KU=; b=t4p3qotLpiXBOK695FV6Av3c7P V9ch6wXoz1ze/fCRWkrmnKtiyv6PaIrGIqra//NJzO/QtAuQ55T8o35R8QevMFZ/1RRuhOIdBe0Pb avPTqmgXSgQ1OqwAURW4GVR+y4TIRhuAIq14QtDmIXoVDxzd3jv5vBBLC5789Wo00msxADOfYqo6d IP7LviZekrBf8W8u1g4RbQ1Bpc1F0suAv1V7jHk0oBFLZ2XyQNjY80HoVM4apaNTL112jO+GQTaU6 lzWwjEfT/q37SX/2QQDb5Eon30dK0Xg8IzwevJjJleospvIdLzX/LFXnkA3JNVm5WeLcfH8+OuinY ThNQ8k1A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYFQ0-00HI4E-6B; Tue, 13 Sep 2022 23:34:16 +0000 Date: Wed, 14 Sep 2022 00:34:16 +0100 From: Matthew Wilcox To: Doug Berger Cc: Andrew Morton , Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Frank Rowand , Mike Kravetz , 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 Subject: Re: [PATCH 03/21] mm/hugetlb: correct demote page offset logic Message-ID: References: <20220913195508.3511038-1-opendmb@gmail.com> <20220913195508.3511038-4-opendmb@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220913195508.3511038-4-opendmb@gmail.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 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. > for (i = 0; i < pages_per_huge_page(h); > i += pages_per_huge_page(target_hstate)) { > + subpage = mem_map_offset(page, i); > if (hstate_is_gigantic(target_hstate))