Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 3rqL6B2vsGzDqFG for ; Wed, 13 Jul 2016 23:58:58 +1000 (AEST) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6DDrnao030685 for ; Wed, 13 Jul 2016 09:58:56 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0a-001b2d01.pphosted.com with ESMTP id 2452atg5nd-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 13 Jul 2016 09:58:56 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Jul 2016 07:58:55 -0600 From: "Aneesh Kumar K.V" To: Benjamin Herrenschmidt , paulus@samba.org, mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH for-4.8 02/10] powerpc/mm: Convert early cpu/mmu feature check to use the new helpers In-Reply-To: <1468411747.20552.81.camel@kernel.crashing.org> References: <1468402690-5373-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1468402690-5373-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1468411747.20552.81.camel@kernel.crashing.org> Date: Wed, 13 Jul 2016 19:28:46 +0530 MIME-Version: 1.0 Content-Type: text/plain Message-Id: <87poqhy6zt.fsf@skywalker.in.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Benjamin Herrenschmidt writes: > On Wed, 2016-07-13 at 15:08 +0530, Aneesh Kumar K.V wrote: >> This switch most of the early feature check to use the non static key >> variant of the function. In later patches we will be switching >> cpu_has_feature and mmu_has_feature to use static keys and we can use >> them only after static key/jump label is initialized. Any check for >> feature before jump label init should be done using this new helper. > > I'm not sure about that. This is converting way way way way more > functions than is needed. Especially if Michael applies my series > there will be very little code run before the patching, really only the > MMU initialization.... > But then all of them are __init functions and that help in: 1) Avoid adding those location information to the __jump_table section. (I assume that will also have an impact of vmlinux size ?) 2) Simple rule regarding when to use __cpu_has_feature and cpu_has_feature 3) No need to runtime patch lot of these __init code paths which will we throw out after boot. Do you see any draw back in making all the __init functions to use __cpu_has_feature() ? -aneesh