From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751885AbcFWThv (ORCPT ); Thu, 23 Jun 2016 15:37:51 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42403 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750863AbcFWTht (ORCPT ); Thu, 23 Jun 2016 15:37:49 -0400 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: arbab@linux.vnet.ibm.com Date: Thu, 23 Jun 2016 14:37:39 -0500 From: Reza Arbab To: "Aneesh Kumar K.V" Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Dan Williams , Balbir Singh , Gavin Shan , David Gibson , Vasant Hegde , Scott Wood , "Oliver O'Halloran" , Nathan Fontenot , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc/mm: update arch_{add,remove}_memory() for radix References: <1466699962-22412-1-git-send-email-arbab@linux.vnet.ibm.com> <87mvmbygdb.fsf@skywalker.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <87mvmbygdb.fsf@skywalker.in.ibm.com> Organization: IBM Linux Technology Center User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062319-0004-0000-0000-00000FC26182 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062319-0005-0000-0000-00007672A079 Message-Id: <20160623193739.GA19202@arbab-laptop.austin.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-23_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606230204 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 23, 2016 at 10:47:20PM +0530, Aneesh Kumar K.V wrote: >Reza Arbab writes: >> These functions are making direct calls to the hash table APIs, >> leading to a BUG() on systems using radix. >> >> Switch them to the vmemmap_{create,remove}_mapping() wrappers, and >> move to the __meminit section. > >They are really not the same. They can possibly end up using different >base page size. Also vmemmap is available only with SPARSEMEM_VMEMMAP >enabled. Does hotplug depend on sparsemem vmemmap ? I'm not sure. Maybe it's best if I back up a step and explain what lead me to this patch. During hotplug, you get ... arch_add_memory create_section_mapping htab_bolt_mapping BUG_ON(!ppc_md.hpte_insert); So it seemed to me that I needed a radix equivalent of create_section_mapping(). After some digging, I found hash__vmemmap_create_mapping() and radix__vmemmap_create_mapping() did what I needed. I did not notice the #ifdef SPARSEMEM_VMEMMAP around them. Hotplug/remove are now working for me as far as I can tell, so I think the functional change in itself was correct. Hotplug may not depend on sparsemem vmemmap, but we seem to need a radix create_section_mapping() regardless. Could it be that the functions just need to be renamed hash__create_mapping()/radix__create_mapping() and moved out of #ifdef SPARSEMEM_VMEMMAP? -- Reza Arbab