Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp665975iog; Fri, 24 Jun 2022 11:16:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1si8XXDZpBNZUJLsTo+zyB26Exow7qlSlc2RULbD42CEWFGmDBRBgQjAHX2BoVQ3qGlk8m3 X-Received: by 2002:a17:902:c713:b0:16a:1c5b:2282 with SMTP id p19-20020a170902c71300b0016a1c5b2282mr298459plp.155.1656094573987; Fri, 24 Jun 2022 11:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656094573; cv=none; d=google.com; s=arc-20160816; b=cjPQEsBF5fq//jsf15+kDrEygwmnXl5HR8QBiAxrCKP7T1O9O1QCaELbZC2lXNin6M kDo+/tQ2j8nqW2WX4C5HKQgJGzGE217WlHTDTDXS3vRYRJ6dBuprna4RKY+oNQEnKRAY nHDJy5bdLFVyCZvtbtjcJSrkNUMCXbaI6WcyS8hbPUIOXe1FiO2aNH6B5vsyirUHUybr /N6m3SLeH6XgRBgw5cwvrai6WpwV2Q8hyE5iDIi4V6Gx6cmD0DQAUHGffg5gA6JunsPe q33nAtCSfiKzCwqcifUCIpmj4FCqZ5s0YH1ocCOvaqb14zJEBl/KiOidD3qmXjHXfw+N gWTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=0YfnJKuQrbw7pcq3GiMHpIZjYaYv7/J4Psozl7GAbkY=; b=FKO5YJ47EUWuKTHkAnNZR2DQRolHL3dXlZ9AmDKDi4kUC2QgYCiuIRjf7h7hiwLQUK ftOfnKdXiwUwGeZUUqHm1XJ779VKTPTSQzjuPkjLRu8JCYJYJDeWFSJTQvRAFsodqIRt fQNX5sJvvhl13JTYsGj7PvinAZIbzakb0Iqit+SwJZ3Wr0ClORzweo3xjSikrmX/tYF1 rYUVNpKiiFnD7qN2ES6CjNksUk9irpCsHhy5BjA9NSiKW3iCEQVzvVy25MPqj+gNELVY lkWrZ26UCMxg1hnazwM5ob7yFcbfFUP8Yv0P42bVAbZTGLNfYsO6VslsiDg4yw+6FMQu 8pQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=rhedzQCK; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jc5-20020a17090325c500b00153b2d165f6si3462979plb.510.2022.06.24.11.16.01; Fri, 24 Jun 2022 11:16:13 -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=@google.com header.s=20210112 header.b=rhedzQCK; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232389AbiFXRiS (ORCPT + 99 others); Fri, 24 Jun 2022 13:38:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231300AbiFXRhN (ORCPT ); Fri, 24 Jun 2022 13:37:13 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 596C35DF25 for ; Fri, 24 Jun 2022 10:37:12 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id c10-20020a251c0a000000b00669b463d2e1so2744999ybc.11 for ; Fri, 24 Jun 2022 10:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=0YfnJKuQrbw7pcq3GiMHpIZjYaYv7/J4Psozl7GAbkY=; b=rhedzQCKx2wNhVDSGuAJpH9VZYMHroyUpR1McnELZRf5xZDgeN7uNFXQFUQY36oI+V sQBZjS3MbDOeENElKNgbkCSeJdkA4KvbvhCfXewwUZV8VRhUz4h9mZPxYQQ152Wr/FN/ 5BdmdPLWcel0PhshC6zVgGbHZJRq7Q7vjb3TkLcOA4+olBP02aOCGQ9Oozydj+ubNW0a x/51FkRIRk4fHQ5AYf3+Jpxz4mZgUNsIXL+ynW22YI6IcrDX3OU3vcAglWcWj6mxHBI5 z3zP8e+fcp3Sh89Okw6YqgR52njYR4st6QIktXU0C0bgCozw42NZ4PuV/5cZ6iJXZUXt qYDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=0YfnJKuQrbw7pcq3GiMHpIZjYaYv7/J4Psozl7GAbkY=; b=yW0Q1bmgM5aP1SAicqs1tAxGxIYHB33SRoHBYbAShJ8CvecuZbuDd7hfsmV4i/0BEV 2ffzGnG5ISMSWIBhsVg/PomNNvKcpVtHhWe1prcSMkEeL+vNRUZ2yFp1DybDlKycOIUe UNVfUt+XXaGtCV++zOSkZqMF3coVuUoTwkiKDHEtWGHu076S7QLMfJcxNDYMnNJXZMEH SlurY9bgu9Z3ohNl/CcZOAaNOrA+2sXxaKJvfnMsaZeK8UuVfVijJfj4eAkTze8DyUoX b7gLRmdJhFR0O2ynMm5dQIA3AxeHHMQiRDYLqp8lXs6lHw0KJQxMf2rv+/5ipOFE5ICY OvZQ== X-Gm-Message-State: AJIora+cjaf55RZa3Bj5QdCuV1HXZxridAJALNLKrBybpKnXenGGzLN0 ePcghfHfVS0IqIs13rVWp6Q/lCYhKfYM3w6e X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a0d:f4c5:0:b0:317:7f89:f547 with SMTP id d188-20020a0df4c5000000b003177f89f547mr18475ywf.334.1656092231687; Fri, 24 Jun 2022 10:37:11 -0700 (PDT) Date: Fri, 24 Jun 2022 17:36:31 +0000 In-Reply-To: <20220624173656.2033256-1-jthoughton@google.com> Message-Id: <20220624173656.2033256-2-jthoughton@google.com> Mime-Version: 1.0 References: <20220624173656.2033256-1-jthoughton@google.com> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog Subject: [RFC PATCH 01/26] hugetlb: make hstate accessor functions const From: James Houghton To: Mike Kravetz , Muchun Song , Peter Xu Cc: David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , Jue Wang , Manish Mishra , "Dr . David Alan Gilbert" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, James Houghton Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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 This is just a const-correctness change so that the new hugetlb_pte changes can be const-correct too. Acked-by: David Rientjes Signed-off-by: James Houghton --- include/linux/hugetlb.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index e4cff27d1198..498a4ae3d462 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -715,7 +715,7 @@ static inline struct hstate *hstate_vma(struct vm_area_struct *vma) return hstate_file(vma->vm_file); } -static inline unsigned long huge_page_size(struct hstate *h) +static inline unsigned long huge_page_size(const struct hstate *h) { return (unsigned long)PAGE_SIZE << h->order; } @@ -729,27 +729,27 @@ static inline unsigned long huge_page_mask(struct hstate *h) return h->mask; } -static inline unsigned int huge_page_order(struct hstate *h) +static inline unsigned int huge_page_order(const struct hstate *h) { return h->order; } -static inline unsigned huge_page_shift(struct hstate *h) +static inline unsigned huge_page_shift(const struct hstate *h) { return h->order + PAGE_SHIFT; } -static inline bool hstate_is_gigantic(struct hstate *h) +static inline bool hstate_is_gigantic(const struct hstate *h) { return huge_page_order(h) >= MAX_ORDER; } -static inline unsigned int pages_per_huge_page(struct hstate *h) +static inline unsigned int pages_per_huge_page(const struct hstate *h) { return 1 << h->order; } -static inline unsigned int blocks_per_huge_page(struct hstate *h) +static inline unsigned int blocks_per_huge_page(const struct hstate *h) { return huge_page_size(h) / 512; } -- 2.37.0.rc0.161.g10f37bed90-goog