From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753274AbcF2PnY (ORCPT ); Wed, 29 Jun 2016 11:43:24 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41377 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752821AbcF2PnV (ORCPT ); Wed, 29 Jun 2016 11:43:21 -0400 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: arbab@linux.vnet.ibm.com Date: Wed, 29 Jun 2016 10:37:31 -0500 From: Reza Arbab To: Michael Ellerman Cc: "Aneesh Kumar K.V" , Benjamin Herrenschmidt , Paul Mackerras , 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> <20160623193739.GA19202@arbab-laptop.austin.ibm.com> <1467112865.16036.4.camel@ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1467112865.16036.4.camel@ellerman.id.au> 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: 16062915-0004-0000-0000-00000FCD3D67 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062915-0005-0000-0000-000076A0D8DB Message-Id: <20160629153731.GA31214@arbab-laptop.austin.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-29_09:,, 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-1606290146 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 28, 2016 at 09:21:05PM +1000, Michael Ellerman wrote: >No, you need to use mmu_linear_psize for the hotplug case. > >But you can probably factor out a common routine that both cases use, and hide >the hash vs radix check in that. Okay, I'm trying to refactor {create,remove}_section_mapping() into hash__ and radix__ variants. This lead to a couple of questions. Pseudocode for radix__create_section_mapping(start, end): page_size = 1 << mmu_psize_defs[mmu_linear_psize].shift; start = _ALIGN_DOWN(start, page_size); for (; start < end; start += page_size) { radix__map_kernel_page(start, __pa(start), PAGE_KERNEL, page_size); } Should the above use PAGE_KERNEL, like the the hash table bolt, or (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_KERNEL_RW), like in the radix vmemmap creation? The other question is what radix__remove_section_mapping() should do. I don't know offhand what the opposite of map_kernel_page() is. As Aneesh mentioned, radix vmemmap removal is currently stubbed as a FIXME so I couldn't use that as a reference. -- Reza Arbab