Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5485407imu; Mon, 26 Nov 2018 00:48:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/V4d8QADciFMwXUYCKUFaoW16kA9zoHAfsv+Jnho5Z+VJp2wyLSP9F6AxU9bC8mQsUqJCec X-Received: by 2002:a63:63c3:: with SMTP id x186mr23991845pgb.330.1543222117444; Mon, 26 Nov 2018 00:48:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543222117; cv=none; d=google.com; s=arc-20160816; b=EYUW4sZ6xAvnwbG/VnJX122Itp6xAjyAmjj3hmWotOJQ6QT2ZcsiSlqDDKHPtlsZLk jri/ENaRS+xzFmEn5XMSA2J/jJH+HUn2+POIrYQnJJWXEspz3kDULg5dQBt7UJuEqc4R i3zSPn+vspPzwCzglzGStQRkZTw6j4XJ/qS1dkLW90sLEAeXlsP/WgPSIp/xPMTPx4LO FPd7uhviF8AKNbuqg3GwnqXiyRU/VGx5sEMgBf79Ls9I3Rc4VR+0pFQK7/0lRF4bc8R8 5I5tVMbuL9Rj3xFuL5rbmzdREi3P/sjs++vXMAqntDPxWHDfMIT7CY2j/AinjNHZ0YGU 7Rcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=SXbx+5pWnHTJ6tOGBMqBKwvs5gKwlnEpIyMWIDwCXB0=; b=z5YcZEt/ok6LHSDmRffZyL09I+oHg1J24MvPiFy+ARBZh626fpbhR2b2yarapbKvM/ DcRD/SFBTS+8msWbDjQX3k+RH7esWj1L6nnh8Q4/NKHZwh/RoJ9ArRgpKpOdkxt8fgmg jOj2e53EYh0TRKpF3QwDs2d7wxdroK405Dq6jOp/Etfh1YhCnknY/L56wFleMa7AQ+VU cbPPZG68iy0WyzhtW/Hgulx1i8XvxUm8gkVJqqaSZ0PBFu08dIh4+AqdjUfPemya3sai ZOmqjJlbJotDYcYERoAeM3YwlPPFInf0sl2mkqRx9HIGXX4AhG82d6yiOBGNZ82Zfh6q PUVA== 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 bh5si7003371plb.42.2018.11.26.00.48.22; Mon, 26 Nov 2018 00:48:37 -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 S1726298AbeKZTlA (ORCPT + 99 others); Mon, 26 Nov 2018 14:41:00 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39500 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726233AbeKZTlA (ORCPT ); Mon, 26 Nov 2018 14:41:00 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wAQ8dhcB044371 for ; Mon, 26 Nov 2018 03:47:34 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2p0apa6qek-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 26 Nov 2018 03:47:34 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 26 Nov 2018 08:47:31 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 26 Nov 2018 08:47:24 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wAQ8lNKR59637766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 26 Nov 2018 08:47:23 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A4ECE4C044; Mon, 26 Nov 2018 08:47:23 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D40AA4C058; Mon, 26 Nov 2018 08:47:21 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.8.115]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 26 Nov 2018 08:47:21 +0000 (GMT) Date: Mon, 26 Nov 2018 10:47:20 +0200 From: Mike Rapoport To: Christoph Hellwig 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 , Stafford Horne , 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 5/5] arch: simplify several early memory allocations References: <1543182277-8819-1-git-send-email-rppt@linux.ibm.com> <1543182277-8819-6-git-send-email-rppt@linux.ibm.com> <20181126082134.GA10530@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181126082134.GA10530@infradead.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18112608-0028-0000-0000-000003217A05 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18112608-0029-0000-0000-000023DD7D03 Message-Id: <20181126084719.GC14863@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-26_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=776 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811260082 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 26, 2018 at 12:21:34AM -0800, Christoph Hellwig wrote: > > static void __init *early_alloc_aligned(unsigned long sz, unsigned long align) > > { > > - void *ptr = __va(memblock_phys_alloc(sz, align)); > > - memset(ptr, 0, sz); > > - return ptr; > > + return memblock_alloc(sz, align); > > } > > What is the point of keeping this wrapper? No point indeed. I'll remove it in v2. > > static void __init *early_alloc(unsigned long sz) > > { > > - void *ptr = __va(memblock_phys_alloc(sz, sz)); > > - memset(ptr, 0, sz); > > - return ptr; > > + return memblock_alloc(sz, sz); > > } > > Same here. > Here it provides a shortcut for allocations with align == size, but can be removed as well. -- Sincerely yours, Mike.