Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp343411imu; Tue, 27 Nov 2018 13:17:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/U/xlQTQCgWDaeKTnQ+fYRbUYZwjB2D7Y7AkewvvoUjh5AdXrhvcY1u3lnsfn7NxucGgfm6 X-Received: by 2002:a63:a30a:: with SMTP id s10mr28853622pge.234.1543353466950; Tue, 27 Nov 2018 13:17:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543353466; cv=none; d=google.com; s=arc-20160816; b=FKhzsCA1xg0myeIQy1/l8uBNdA7s8zON4LBet8NiSWpFVr0u2XgJMN7Cwj3P7f9Xay gKnccNOze2PpuqZD5Rby1PnkdnUTJepxBgsofTBCgTzdgj0cbiRzz/LYsv3z21Jspsvw fww1Iz8HLh9jo3mYG5xiZDgwVuiZcSRWzuFRb0FmtlFqSaMSQ/4f32BszszjvKGK2Rzz atX9TKbRMIjcdWamHkWUyTt2qVF99NJLw6YTZsnJnO/wkE6zEB89N6Y+rNk9vKkiWFNs fnOqiBf03QSAKZ6pEgPgfqIv2mHB69S9rblSIumZqF8VTygVOiEj4iCSfwqHylCANF7Q Cb1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=POLOYIiJuU8CSX2TWzyy+YnWmRatYsfe9ljSBPA02cc=; b=RF8TfXU58xIceu/O8BfWTWbEXRAmLkol3QaIAw1DGRrcw7RbWmBOQpvRtQq/1dm7oE D5Gx3uRu3W2DI6bZnH+hbJjaQDiQ91dIOXiVXVpn8HO0/V+9ASpqX6nxA7KVKMp8WU1J f8qyfys0qx6FqwFRo5m676sH6REasGAnaBz9/LpTVqwB6OUfnb+9ED/ic2E/F+rYHS3Z 3DMSi8K1F2WSv8pkC3m1VnLblWuNc/edKAxPnwq9PqZUqF/H8sMWkBB4g92T8WedPbWz GXrbMHR868NYvSZMs70YrLdLmixrgrBF3jSBkSzgMjfLtF/zLfYli+CwG7EeO9a7WizC 6bTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZFvCYUdP; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g17si4675246pgi.578.2018.11.27.13.17.29; Tue, 27 Nov 2018 13:17:46 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZFvCYUdP; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbeK1IPP (ORCPT + 99 others); Wed, 28 Nov 2018 03:15:15 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:45721 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbeK1IPP (ORCPT ); Wed, 28 Nov 2018 03:15:15 -0500 Received: by mail-pg1-f194.google.com with SMTP id y4so8423022pgc.12; Tue, 27 Nov 2018 13:16:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=POLOYIiJuU8CSX2TWzyy+YnWmRatYsfe9ljSBPA02cc=; b=ZFvCYUdPkDH7NO0rp6JgX1scwTdNTO8jtyDg7Rwsfu2WJCKOnycrvqEYrFlEr/cmKI aeOjz2bskKgyZvu8lcXfVqHlDRi4k+fbk+EhjmScBxi53fhER9x9BZuIh3e9DiQDnjfC RjfTuHmUzn9LmJsIs5uiHMe1h/8aVb3BUmqJdd/qfjMS679ratilbx3u/6LPkZl+oUGb eQ54kVVLrev7o8CxgOLedEcQEP6KaTbhGB49Hvl8daEeetNklnYqDYubYvVENHDZxrwS brHRLhvU8eZZBLcZlOlAdQXRnLZjl/sVWsDae715iO1f+vPg9/obZv0J4ZGjRa6wOqad TrHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=POLOYIiJuU8CSX2TWzyy+YnWmRatYsfe9ljSBPA02cc=; b=JOXNzdmVwkwJSO0c1X2bLD0077wWMOxQmNR/J3gmNyDy/ttkTSd2PyP+Fms5S/I2oL kofYSZVGkFWknaCYAGqQYqEETymkacPniSJP2gQw5YZEGuK6iACgUqmLHeoLFkIGFvdz GgpKcqbG2InRUVcqTPxlR4CUyK7sKWAG9d98hKwMY2RmjnNtfgyyKZDjSxTMHTqSBDGt hio5rosDEaHxSDXctYz8g2LiUrYiiOKRyVX10yrxLnB+l07y3oiAexYa30M+zlkY1akn R8oNnUcQ5QslZfhUjVgFlY9j2mYtVCr1xUeWDKuQzcmBe63ljQa4N8l2uEfLoBLJuCCQ n5ZA== X-Gm-Message-State: AA+aEWa4PXdcjl29dZzMJA6mN8SfEd+R5voVTLjqUGAIl8pcbQkrvUbX ASIjsvEs4R/3EBtx/7cMQr4z8PCrkqY= X-Received: by 2002:a63:fe48:: with SMTP id x8mr31264176pgj.261.1543353363014; Tue, 27 Nov 2018 13:16:03 -0800 (PST) Received: from localhost (g206.124-44-15.ppp.wakwak.ne.jp. [124.44.15.206]) by smtp.gmail.com with ESMTPSA id 69sm6193028pgg.86.2018.11.27.13.16.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Nov 2018 13:16:02 -0800 (PST) Date: Wed, 28 Nov 2018 06:16:00 +0900 From: Stafford Horne To: Mike Rapoport 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 Subject: Re: [PATCH 4/5] openrisc: simplify pte_alloc_one_kernel() Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1543182277-8819-5-git-send-email-rppt@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > Signed-off-by: Mike Rapoport Acked-by: Stafford Horne > --- > 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 >