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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BB7EC2BB55 for ; Fri, 10 Apr 2020 19:19:57 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0B5320732 for ; Fri, 10 Apr 2020 19:19:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gmVjI/VE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0B5320732 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48zSWY5mDdzDqWs for ; Sat, 11 Apr 2020 05:19:53 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=205.139.110.120; helo=us-smtp-1.mimecast.com; envelope-from=peterx@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gmVjI/VE; dkim-atps=neutral Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48zSRg2lHRzDr0v for ; Sat, 11 Apr 2020 05:16:23 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586546180; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cv7iW9UAPEbptJQ7pxTuJ8mpCyBB8TXm9+xjBE0kLBw=; b=gmVjI/VETuwYAeYbrArpbQTmnjIYLVEW3o7HoX6keMIWotqjUhdnMrVum7SuOgzN5/w3AQ sIszYe5UdlmQHn7j1D9yv+xcgsOsAQEA5EuxDUh+Aj+fnNYozxVis3pL0l2rr9w08jTM9Y oMFH0FFjglivJtBA/Jdn6V+LYFJPdVQ= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-C2iEV-3mMtSKXE2qDoN2uQ-1; Fri, 10 Apr 2020 15:16:17 -0400 X-MC-Unique: C2iEV-3mMtSKXE2qDoN2uQ-1 Received: by mail-qv1-f71.google.com with SMTP id m5so2416210qvy.0 for ; Fri, 10 Apr 2020 12:16:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mwSL4Svde7cDyREN44P4y94Qc6dx9Sv2bNY13UCrEho=; b=nhBAF2utt5OrdBriZSb1B9oUhfPNpP57QqNI7DMtgxWPb9cWouXt2S8FpYG1oNL6js 5hNTAFd/zda5h2oawBc0yB56l67gq4En7At+GRkr7UpnSIFll9/KM/iUI1uN2I0NA3ZG VSGJm3CXJX+zMJ7nUb2hmiElgSMW5AjuENxb2Y9rD5SwoXp6/XkBcZVK1Ks6fJIkt5tC IsGiFkwmH023skAbFpTD1/pW0++sDqmXteRaNFbE0d+D7SLLHcrolH/vQNYxhSWEeunR gu8nYMjCvUy67ZhIzNsO5y3P8HkjZVdQGRKUlFjbXqVi/c3WH+RNo32KmbCXYufE8uRL /YGw== X-Gm-Message-State: AGi0PubkvRqTfG5Pw/ba+pYr0FcYQj/0X8PNGkwrxrMe/28jFIiAAkrz Dvrg+1vetfbGMmlcZ6LpJs/ZsIJ5G1uGdhT+lzSGHcJE+3YQIrD77D6sZY1IKLXC8FLjZ18FxaO dgeJLwDwd/wzia1SphSKANhPrRA== X-Received: by 2002:a05:620a:89d:: with SMTP id b29mr5792243qka.329.1586546177445; Fri, 10 Apr 2020 12:16:17 -0700 (PDT) X-Google-Smtp-Source: APiQypLiuHO8rQfrWs/w6IUs43Srn34pCDFpZie/ieWUpJNT3bX04my6S/Xtwb+5j5ZmCFgzwIqbpg== X-Received: by 2002:a05:620a:89d:: with SMTP id b29mr5792202qka.329.1586546177111; Fri, 10 Apr 2020 12:16:17 -0700 (PDT) Received: from xz-x1 ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id b13sm1590230qtp.46.2020.04.10.12.16.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 12:16:16 -0700 (PDT) Date: Fri, 10 Apr 2020 15:16:13 -0400 From: Peter Xu To: Mike Kravetz Subject: Re: [PATCH v2 1/4] hugetlbfs: add arch_hugetlb_valid_size Message-ID: <20200410191613.GD3172@xz-x1> References: <20200401183819.20647-1-mike.kravetz@oracle.com> <20200401183819.20647-2-mike.kravetz@oracle.com> MIME-Version: 1.0 In-Reply-To: <20200401183819.20647-2-mike.kravetz@oracle.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, Catalin Marinas , Dave Hansen , Heiko Carstens , linux-mm@kvack.org, Paul Mackerras , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , Mina Almasry , linux-s390@vger.kernel.org, Jonathan Corbet , Christian Borntraeger , Ingo Molnar , Longpeng , Albert Ou , Vasily Gorbik , Paul Walmsley , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S . Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Apr 01, 2020 at 11:38:16AM -0700, Mike Kravetz wrote: > diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hu= getlb.h > index 2eb6c234d594..81606223494f 100644 > --- a/arch/arm64/include/asm/hugetlb.h > +++ b/arch/arm64/include/asm/hugetlb.h > @@ -59,6 +59,8 @@ extern void huge_pte_clear(struct mm_struct *mm, unsign= ed long addr, > extern void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long add= r, > =09=09=09=09 pte_t *ptep, pte_t pte, unsigned long sz); > #define set_huge_swap_pte_at set_huge_swap_pte_at > +bool __init arch_hugetlb_valid_size(unsigned long size); > +#define arch_hugetlb_valid_size arch_hugetlb_valid_size Sorry for chimming in late. Since we're working on removing arch-dependent codes after all.. I'm thinking whether we can define arch_hugetlb_valid_size() once in the common header (e.g. linux/hugetlb.h), then in mm/hugetlb.c: bool __init __attribute((weak)) arch_hugetlb_valid_size(unsigned long size) { =09return size =3D=3D HPAGE_SIZE; } We can simply redefine arch_hugetlb_valid_size() in arch specific C files where we want to override the default. Would that be slightly cleaner? Thanks, --=20 Peter Xu