Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4241464ybb; Mon, 23 Mar 2020 16:44:22 -0700 (PDT) X-Google-Smtp-Source: ADFU+vua8GHQrH85iE6M4LFIzlP+6H2CufjiGqQg508U9+JWN9PGmmPUenj178i6VsMh7r5lB7WU X-Received: by 2002:aca:aa81:: with SMTP id t123mr1452280oie.117.1585007062608; Mon, 23 Mar 2020 16:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585007062; cv=none; d=google.com; s=arc-20160816; b=J6Y+0nYSa399jocYzMB0hJvAtB9+X7t5R548Q8YzvCBnLTqoLTLPjY0fBGX/UQjeOc KCIJq37ZPnRxqsW1AlHmRL/ePep+VKqwap90HJ30jHvfHGMiTHMqfN4RocsY6Dbux0Is WXJGEupULwy0rqxZ6cwFXzQwdjBSssRWsP0S3Ac5etmLeaPyIG/e1DfsSyooOmyrtb7H H3scndIku5CN1x3MWBRbSdAKhGpjFhtcup4LXcrl7UQsYRus5rz+m/CkrAqbaV0M6YUR VmjJK+O2o0usLex+Z85aG70mrMpXzAEkeGTLmqPsBexJNs2G9uT5N99l/fZnIjde1j7X 4Jgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QEuYlxaghpgWF2p5OUfw9hRKqdJnGRCmq90AXOuejGU=; b=IxLvzURh8nHQBENgUd5c9r8KcCfoSerFv7ZKFjeiQHpoB4uCj+icE+uMzJxXVM7kzd RNXy+vc/3bNu8eQtHDOP6RnoxwW8zFZw64pznkgyofcoL2eCqN5xJqGTWVSYaEA3IOcS EmGrdwrvf2Nz0dEBJhDUkkJk30o+wEAfEDQyGoRdmojULNr14/4ccAcaFeHR4aiAxDAJ mWT2LRaIDhwqyZrWt3/chb4Tjl1FKuHSccqmSO6DqCCrl/0YjLV5GlWFhr4DUQ9hO0US J62DTtnSTolOSnT0gWmkorHUuRpG3TGfV5OyN4S3o/ExBPbkUNyXkocdakG6VoB9SJhq xIYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JGS9qhFf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w85si7794876oif.88.2020.03.23.16.44.09; Mon, 23 Mar 2020 16:44:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JGS9qhFf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727169AbgCWXnf (ORCPT + 99 others); Mon, 23 Mar 2020 19:43:35 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:35964 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727133AbgCWXnc (ORCPT ); Mon, 23 Mar 2020 19:43:32 -0400 Received: by mail-oi1-f196.google.com with SMTP id k18so16761700oib.3 for ; Mon, 23 Mar 2020 16:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QEuYlxaghpgWF2p5OUfw9hRKqdJnGRCmq90AXOuejGU=; b=JGS9qhFfhzpnjEAVbAAMHJj8in5e/nOn1IICF83YfSbXJY3qg9DEVBEwgVof62szn8 +wcr6ReeQRfgWIdq3IXB2OeCk9osydynfhtZIMTCNHSyFiVP/P5Caj8dhLtq2BGgXDI9 z9RWzC11+dTOKTK7uz6IWkRq0sE8ke2sODVks25xtxNeNkP0j/LZ0ZWRVSUO0ISXmDFY OXhQuh5V+0FA6tHkTdix9SbRKnBOQB6GwgxG+jXmCWPfN3smHYwjJomfsyJOxbvZNvce W9L18k9PNSoTMlcmWM5mVcddQaDKgk7ayZqZ1lqcZwPmZb1GF+ztYj4NfcNcdWQ/KL+9 +iKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QEuYlxaghpgWF2p5OUfw9hRKqdJnGRCmq90AXOuejGU=; b=uabi+4TxPCBhCXgujO32ZkIfgGT+wRbXqvNWUl2FBD8N+Rz98hRKSTOLnNYjqCCDTl kbWiJtlrK1zMpgtTrkgwM7bAlYESXoS6+tHT509BqHc9owRLgXtlsk62TOvWh8P8WvsD PYGt/Yp4r/H6LPUu9of7aVzoHlsDriMV997vvfC/oHcYMGDqaAxjzPPwQ3Jw0gnkdvEr zaxfw2MVxgskDp1TPoLIHqA2f+0vhNeKOwIk8XIEGYyZEDJVPlG4X1OdVgXJeTd3VH4A 4aVhTcVEZdMcriAFkMuQ6aeTybOfK5nXL9LlnzJkoj84ZZIECLtmZKax3AL/2dFm51JQ VI1w== X-Gm-Message-State: ANhLgQ2aljt0i4fc/OJlZHtCbyHv0ScG48hf1HGcW2xgsOg9fb7O0Ekl M0afrE3epdLKGbt3wiZ9CYibtJVpqyGqoU87L9vWpA== X-Received: by 2002:aca:5d83:: with SMTP id r125mr1504637oib.8.1585007011359; Mon, 23 Mar 2020 16:43:31 -0700 (PDT) MIME-Version: 1.0 References: <20200318220634.32100-1-mike.kravetz@oracle.com> <20200318220634.32100-2-mike.kravetz@oracle.com> In-Reply-To: <20200318220634.32100-2-mike.kravetz@oracle.com> From: Mina Almasry Date: Mon, 23 Mar 2020 16:43:19 -0700 Message-ID: Subject: Re: [PATCH 1/4] hugetlbfs: add arch_hugetlb_valid_size To: Mike Kravetz Cc: Linux-MM , open list , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-doc@vger.kernel.org, Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , "David S . Miller" , Thomas Gleixner , Ingo Molnar , Dave Hansen , Jonathan Corbet , Longpeng , Andrew Morton Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 18, 2020 at 3:07 PM Mike Kravetz wrote: > > The architecture independent routine hugetlb_default_setup sets up > the default huge pages size. It has no way to verify if the passed > value is valid, so it accepts it and attempts to validate at a later > time. This requires undocumented cooperation between the arch specific > and arch independent code. > > For architectures that support more than one huge page size, provide > a routine arch_hugetlb_valid_size to validate a huge page size. > hugetlb_default_setup can use this to validate passed values. > > arch_hugetlb_valid_size will also be used in a subsequent patch to > move processing of the "hugepagesz=" in arch specific code to a common > routine in arch independent code. > > Signed-off-by: Mike Kravetz > --- > arch/arm64/include/asm/hugetlb.h | 2 ++ > arch/arm64/mm/hugetlbpage.c | 19 ++++++++++++++----- > arch/powerpc/include/asm/hugetlb.h | 3 +++ > arch/powerpc/mm/hugetlbpage.c | 20 +++++++++++++------- > arch/riscv/include/asm/hugetlb.h | 3 +++ > arch/riscv/mm/hugetlbpage.c | 28 ++++++++++++++++++---------- > arch/s390/include/asm/hugetlb.h | 3 +++ > arch/s390/mm/hugetlbpage.c | 18 +++++++++++++----- > arch/sparc/include/asm/hugetlb.h | 3 +++ > arch/sparc/mm/init_64.c | 23 ++++++++++++++++------- > arch/x86/include/asm/hugetlb.h | 3 +++ > arch/x86/mm/hugetlbpage.c | 21 +++++++++++++++------ > include/linux/hugetlb.h | 7 +++++++ > mm/hugetlb.c | 16 +++++++++++++--- > 14 files changed, 126 insertions(+), 43 deletions(-) > With build fixes: Acked-by: Mina Almasry