Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp374810imu; Tue, 27 Nov 2018 13:50:38 -0800 (PST) X-Google-Smtp-Source: AFSGD/WzKyf60jYcgeuccROnA5KuR06TSp96oThQiBqZN8U6wKdX1hVh8Zd1RGsBoUP4VWOvn0fI X-Received: by 2002:a17:902:b68d:: with SMTP id c13mr34206747pls.102.1543355438121; Tue, 27 Nov 2018 13:50:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543355438; cv=none; d=google.com; s=arc-20160816; b=GVymS5jBqzlTyXVLmdTUlOgs8e3riPhNzkWybXloTLMCkf1RTkGSEOkKt1SDgK3f75 +9MtmBAbTcXJ/hWjJ1GufVU7Gj2gZMAHe6pb/MJI0LFPoCdvbPi9DtT7U8R9mqcJNyGc PqcB42upSCeJ6mIhn1Wj6HEO5tsVXNWPlHF54Eh+DiCjy11pIEj7C7yhQxhiJoglTY9G cu8xfedEQDVpFVPMC1BgCBv1l8ghRYp8etr/6eGdGe1OGeCxYUkMWW6IlnDkUalmlkqH ei+Q12DrpmOUEAHNdOpeWy7Pdkq7Fi9Pw2gHApcRa6tov1kgIfP/5XK4bBf+E9dGv/Dw IUoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date; bh=FEhGM3CdgUynDK1ngn13ovbvjclJDAVfCVJYrvAguYY=; b=vM81wSvN/cmOhSdrNniNc4POqbKGwh3vR0DjMDZPy/fwwrz99vsl3n0TIRvthRuxgj MkTFHQlYI/cGYuLagmK+i9QjpDFG3d51rRzqDA2LcZwbG6pbcZVkEhkqkkZqOBOsQTpS HudZUm+T9Ibn2ZZYA5WCOqCE4F3lunt33KELwLBD4R8SdgMfKECAMscLaeigEHNN727j sPHJCNlDvhtwYNlcVR8biENuKMW52Iw0Su7r71zaPhoXJb1MlNS6s8BY+uT5A4ZJyNZr 0MA0KTV+JtpjB8LZi9oFGOLN655rrdh9TrpBNdMRBb9DnJAYuqDPQPHh4tC5MogkOSyU uDsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k72si4582025pge.310.2018.11.27.13.50.22; Tue, 27 Nov 2018 13:50:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbeK1IsQ convert rfc822-to-8bit (ORCPT + 99 others); Wed, 28 Nov 2018 03:48:16 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36186 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726288AbeK1IsQ (ORCPT ); Wed, 28 Nov 2018 03:48:16 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wARLiejh138270 for ; Tue, 27 Nov 2018 16:48:58 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2p18jfp1dg-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Nov 2018 16:48:57 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Nov 2018 21:48:55 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 27 Nov 2018 21:48:49 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wARLmmru53215338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Nov 2018 21:48:48 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 61160A405F; Tue, 27 Nov 2018 21:48:48 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A298A4054; Tue, 27 Nov 2018 21:48:48 +0000 (GMT) Received: from [9.148.204.175] (unknown [9.148.204.175]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 27 Nov 2018 21:48:47 +0000 (GMT) Date: Tue, 27 Nov 2018 23:48:45 +0200 User-Agent: K-9 Mail for Android In-Reply-To: <20181127211600.GB3235@lianli.shorne-pla.net> References: <1543182277-8819-1-git-send-email-rppt@linux.ibm.com> <1543182277-8819-5-git-send-email-rppt@linux.ibm.com> <20181127211600.GB3235@lianli.shorne-pla.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [PATCH 4/5] openrisc: simplify pte_alloc_one_kernel() To: Stafford Horne CC: linux-kernel@vger.kernel.org, Andrew Morton , Arnd Bergmann , Benjamin Herrenschmidt , "David S. Miller" , Guan Xuetao , Greentime Hu , Jonas Bonn , Michael Ellerman , Michal Hocko , Michal Simek , Mark Salter , Paul Mackerras , Rich Felker , Russell King , Stefan Kristiansson , Vincent Chen , Yoshinori Sato , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-mm@kvack.org, linux-sh@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org From: Mike Rapoport X-TM-AS-GCONF: 00 x-cbid: 18112721-0008-0000-0000-0000029973B7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18112721-0009-0000-0000-00002203B917 Message-Id: <7843DE67-DCC3-48BF-873F-71D87B08EDA8@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-27_18:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811270183 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On November 27, 2018 11:16:00 PM GMT+02:00, Stafford Horne wrote: >On Sun, Nov 25, 2018 at 11:44:36PM +0200, Mike Rapoport wrote: >> The pte_alloc_one_kernel() function allocates a page using >> __get_free_page(GFP_KERNEL) when mm initialization is complete and >> memblock_phys_alloc() on the earlier stages. The physical address of >the >> page allocated with memblock_phys_alloc() is converted to the virtual >> address and in the both cases the allocated page is cleared using >> clear_page(). >> >> The code is simplified by replacing __get_free_page() with >> get_zeroed_page() and by replacing memblock_phys_alloc() with >> memblock_alloc(). > >Hello Mike, > >This looks fine to me. How do you plan to get this merged? Will you >be taking >care of the whole series or so you want me to queue this openrisc part? I was thinking about merging via the -mm tree. Andrew, would that be ok? >> Signed-off-by: Mike Rapoport > >Acked-by: Stafford Horne Thanks! >> --- >> arch/openrisc/mm/ioremap.c | 11 ++++------- >> 1 file changed, 4 insertions(+), 7 deletions(-) >> >> diff --git a/arch/openrisc/mm/ioremap.c b/arch/openrisc/mm/ioremap.c >> index c969752..cfef989 100644 >> --- a/arch/openrisc/mm/ioremap.c >> +++ b/arch/openrisc/mm/ioremap.c >> @@ -123,13 +123,10 @@ pte_t __ref *pte_alloc_one_kernel(struct >mm_struct *mm, >> { >> pte_t *pte; >> >> - if (likely(mem_init_done)) { >> - pte = (pte_t *) __get_free_page(GFP_KERNEL); >> - } else { >> - pte = (pte_t *) __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE)); >> - } >> + if (likely(mem_init_done)) >> + pte = (pte_t *)get_zeroed_page(GFP_KERNEL); >> + else >> + pte = memblock_alloc(PAGE_SIZE, PAGE_SIZE); >> >> - if (pte) >> - clear_page(pte); >> return pte; >> } >> -- >> 2.7.4 >> -- Sincerely yours, Mike.