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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35088ECAAD8 for ; Wed, 14 Sep 2022 01:07:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229740AbiINBHv (ORCPT ); Tue, 13 Sep 2022 21:07:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbiINBHt (ORCPT ); Tue, 13 Sep 2022 21:07:49 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4BB4386B3; Tue, 13 Sep 2022 18:07:47 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id s9so7567855qkg.4; Tue, 13 Sep 2022 18:07:47 -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=plxos9uquFOD+IvTyP/oZn7J1wpWUgAiZjzQhRQDPPQ=; b=b5Ib02DcxbD8iGr+e9uO3ofxDa5NOXUgiKqm4v2kO2kVzLFaIksphZ+L5Zdbvek1wM Wmqq1e6M0COkpEIS2jTy/PtUgCdajEtU48nkMBXp1pD9XDM6s+PucJjIlGaVewK6jpAB MixvjHa8iEwvkFwCTzd4+IiI1JDNHjbquWMgFtpWgjJj6qqEw5WAYPSMVDEgpLo3HNek 36boSZgTaGRXICe0uFLtjuI38uivs5RzA7nLftvI8tOPpKmyKy3pz/VsvafUilaTeUvi fcpstGUbfcwFK2RzmK6KZVIK3Hl4+3OGNIQyl05fWMzuh3cx6pq0kx437GIDICGwdU2D iecg== 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=plxos9uquFOD+IvTyP/oZn7J1wpWUgAiZjzQhRQDPPQ=; b=o2TZPYe7jrULkGFpNAlRCQDfJDI5Cd99r7HNA2r4A+g5bL1W3rI0TFu2WY5gSHh9jK k3Pjapy6gyiAqfkIh1nElMt3vxI7gut0fLL1f0fSuyZ/8szDlFP9iQaj/DVtHw+0RdW/ VnBqa1Q5D/V72lpo62NjsexQLfnN8xHC2i3dHwufrT/4O+9KazSCF/HX9jP1VRVfCf72 q1aRLRC1nl7N6kMNjp3MgC7bm1st1OseUbmCcfK50mNdUZyl9VmhEf5VuZdA02+xm4uh ECvxaZVGLjwbeDSSQdNQ4XKUiqgnXr4xgmh6RDz0o5VGL0Z/QUjJs8tt+xwVqhcwO3Yk XWng== X-Gm-Message-State: ACgBeo2JpQ1YC5HtqqNpdUjgOhaaj5HPKpNiQKUMJXNTMCHvRz+3YyrQ VZYIqAiGr0Cp+a37Hzsf2QI= X-Google-Smtp-Source: AA6agR6T8fHDs9UyqzsDp4Um9poKtPw3ia21pUGOlENIFjDdlRCXupm+CtiBRXcOgUDRfWYaL1iLtg== X-Received: by 2002:a05:620a:4114:b0:6bb:33c2:45f9 with SMTP id j20-20020a05620a411400b006bb33c245f9mr24395201qko.374.1663117666899; Tue, 13 Sep 2022 18:07:46 -0700 (PDT) Received: from [10.69.40.226] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bs14-20020a05620a470e00b006b58d8f6181sm707879qkb.72.2022.09.13.18.07.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Sep 2022 18:07:45 -0700 (PDT) Message-ID: <33ff9543-3396-7609-3865-7eed20b853f5@gmail.com> Date: Tue, 13 Sep 2022 18:07:41 -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: Matthew Wilcox 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 References: <20220913195508.3511038-1-opendmb@gmail.com> <20220913195508.3511038-4-opendmb@gmail.com> From: Doug Berger In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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. > >> 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))