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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DF0EC43334 for ; Fri, 24 Jun 2022 18:44:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F41D36B0071; Fri, 24 Jun 2022 14:44:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EF0966B0072; Fri, 24 Jun 2022 14:44:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB9028E0244; Fri, 24 Jun 2022 14:44:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id CD8286B0071 for ; Fri, 24 Jun 2022 14:44:02 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id A8AE7605A4 for ; Fri, 24 Jun 2022 18:44:02 +0000 (UTC) X-FDA: 79614003924.11.E400D33 Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com [209.85.217.42]) by imf15.hostedemail.com (Postfix) with ESMTP id 32FB7A009A for ; Fri, 24 Jun 2022 18:44:02 +0000 (UTC) Received: by mail-vs1-f42.google.com with SMTP id t127so3100490vsb.8 for ; Fri, 24 Jun 2022 11:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8hYCeRpaEZU7KjgpT/XAUYtlAbNZbR1jTTlanQG1Mz8=; b=CVSF24k6Vdbn0T5OOFWkOhmBimI4cMqOpZejir1SjU/vmy5lbIk68w2OG7LzGP3/gY m2TbNg53miajxfizMYXwIr4j2n6L77jyUjDEzKYFiYYtyRFEpbvLWb8e675Hs9oe27sC on2UIRUk2xDMua24ZWnL/6DC4QZq3PVn3w+WaZ0Q43a1PJ79lsHOEaykqUMFM88UbsYt Lm9YZGd9IZoWaA1kkmlJyBCAouzieRnARiIYyBeqomuFoo/QL+e2HfNiw4apXzYKRU6+ s5t1m14o5uRU3JUwKaVJU+vn8mz72aPUL2QcgbeXDe8dS4cfwn60lLX74TjII79wC3nu zovg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8hYCeRpaEZU7KjgpT/XAUYtlAbNZbR1jTTlanQG1Mz8=; b=jj/lLSeDWP4YdRXwqlNXBz7FBtCxZPqaG1QiiwSIaAGxidZNRJIwppS8kF0ijKlfeY fwMXfEEvpt0PURHGKYU5G1PheYgM3gd2jGXU7NCE9YvTwY2Wa5DJqh9l2dAywa3Z8+1m qp2oMFtPP8iY4e4aY+GNlAUS9vDjNd15xr5bXXPtOIHLRSv1AQWdSRQNIOLcPIP08UiP oLLrHEEhhUx/m1D6OYffw6u/gDY+vA8YkAUemcS2kCamElhFg7o53k9NRdAwjNPmYPff kJCW16tCifz9Fbsn7KuNSRRa5TZOu/4vb9u8IhbWWPUFohT5vpIXxWRqq/jh/+a3HRQL iJVA== X-Gm-Message-State: AJIora8xSb0PatrMwxB0ARg7R8fKcIE27vZDQpzYntQgFpKHLfwfqcNP r8zYfBtMxBRrjAsK6IJanW3wooTMbhYslQfrgU/6jg== X-Google-Smtp-Source: AGRyM1usFfqzp3/s3xxFYzC5Q7anIB/04PGBIkNtfl++nLUVrXSam0ArMwILrhQ5XVVn6XUIT+sTeqhTbzRuRjLOMno= X-Received: by 2002:a67:f958:0:b0:354:3f56:8a2d with SMTP id u24-20020a67f958000000b003543f568a2dmr216587vsq.59.1656096241466; Fri, 24 Jun 2022 11:44:01 -0700 (PDT) MIME-Version: 1.0 References: <20220624173656.2033256-1-jthoughton@google.com> <20220624173656.2033256-2-jthoughton@google.com> In-Reply-To: <20220624173656.2033256-2-jthoughton@google.com> From: Mina Almasry Date: Fri, 24 Jun 2022 11:43:50 -0700 Message-ID: Subject: Re: [RFC PATCH 01/26] hugetlb: make hstate accessor functions const To: James Houghton Cc: Mike Kravetz , Muchun Song , Peter Xu , David Hildenbrand , David Rientjes , Axel Rasmussen , Jue Wang , Manish Mishra , "Dr . David Alan Gilbert" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=CVSF24k6; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf15.hostedemail.com: domain of almasrymina@google.com designates 209.85.217.42 as permitted sender) smtp.mailfrom=almasrymina@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656096242; a=rsa-sha256; cv=none; b=tnDLZQkIQPL4QCNjmcDkq6vMcaVdR3ozWGILF7k//12Db0c+TLHrQd7GdoJ1e6pTITFuV2 onD5v2Cvme5QBh9IQCep4LXebunDThuSXGCAPx+XkcgSag6ZPxksDFPWUZHoAtu9u+kqoV 6kI1Pfk1W0wxg1rlfqtuJqCNZj1vb+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656096242; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=8hYCeRpaEZU7KjgpT/XAUYtlAbNZbR1jTTlanQG1Mz8=; b=BTd2o2EW0x3Xb2SH7JseQo/XOEZ8c5+SX0f2vH88gom0b3V7WT7P22QBREI23G6d8xfOtx Gkc7FLH1ZkBzAPcyb+Ckzm1+Ugq/fPiwABMVv3prGALXoubc+XSAigEcqNTTfM06JN8V6K DNUxfjQq8PiOmoWW+kvG93T/xF5cfRI= X-Stat-Signature: aqum46qfqh6jw1exxrpp94ayey6ttcqr X-Rspamd-Server: rspam08 X-Rspam-User: X-Rspamd-Queue-Id: 32FB7A009A Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=CVSF24k6; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf15.hostedemail.com: domain of almasrymina@google.com designates 209.85.217.42 as permitted sender) smtp.mailfrom=almasrymina@google.com X-HE-Tag: 1656096242-731675 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jun 24, 2022 at 10:37 AM James Houghton wrote: > > This is just a const-correctness change so that the new hugetlb_pte > changes can be const-correct too. > > Acked-by: David Rientjes > Reviewed-By: Mina Almasry > 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 >