From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752844AbcITC25 convert rfc822-to-8bit (ORCPT ); Mon, 19 Sep 2016 22:28:57 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:50441 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751888AbcITC2z (ORCPT ); Mon, 19 Sep 2016 22:28:55 -0400 From: "Aneesh Kumar K.V" To: christophe leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Scott Wood Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2 2/3] powerpc: get hugetlbpage handling more generic In-Reply-To: <68949cf6-c70b-f616-4586-fa438a7c17cd@c-s.fr> References: <87mvj4xwt6.fsf@linux.vnet.ibm.com> <68949cf6-c70b-f616-4586-fa438a7c17cd@c-s.fr> Date: Tue, 20 Sep 2016 07:58:44 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16092002-0024-0000-0000-0000149BEC41 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005788; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000185; SDB=6.00759326; UDB=6.00360902; IPR=6.00533591; BA=6.00004736; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012720; XFM=3.00000011; UTC=2016-09-20 02:28:51 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16092002-0025-0000-0000-000044A1427F Message-Id: <877fa7xq1v.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-19_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=5 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609200032 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org christophe leroy writes: > Le 19/09/2016 à 07:50, Aneesh Kumar K.V a écrit : >> >> Christophe Leroy writes: >>> +#else >>> +static void hugepd_free(struct mmu_gather *tlb, void *hugepte) >>> +{ >>> + BUG(); >>> +} >>> + >>> #endif >> >> >> I was expecting that BUG will get removed in the next patch. But I don't >> see it in the next patch. Considering >> >> @@ -475,11 +453,10 @@ static void free_hugepd_range(struct mmu_gather *tlb, hugepd_t *hpdp, int pdshif >> for (i = 0; i < num_hugepd; i++, hpdp++) >> hpdp->pd = 0; >> >> -#ifdef CONFIG_PPC_FSL_BOOK3E >> - hugepd_free(tlb, hugepte); >> -#else >> - pgtable_free_tlb(tlb, hugepte, pdshift - shift); >> -#endif >> + if (shift >= pdshift) >> + hugepd_free(tlb, hugepte); >> + else >> + pgtable_free_tlb(tlb, hugepte, pdshift - shift); >> } >> >> What is that I am missing ? >> > > Previously, call to hugepd_free() was compiled only when #ifdef > CONFIG_PPC_FSL_BOOK3E > Now, it is compiled at all time, but it should never be called if not > CONFIG_PPC_FSL_BOOK3E because we always have shift < pdshift in that case. > Then the function needs to be defined anyway but should never be called. > Should I just define it static inline {} ? > For 8M with 4K mode, we have shift >= pdshift right ? -aneesh