Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2246698imu; Thu, 24 Jan 2019 09:30:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN6qiHnu5I+2J2rqDu3eEplSlkL1HkTFI7dbEG6nbLRS1wMpzfimFmwfrnKNeT04C5E8o+C3 X-Received: by 2002:a62:c302:: with SMTP id v2mr7394224pfg.155.1548351039248; Thu, 24 Jan 2019 09:30:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548351039; cv=none; d=google.com; s=arc-20160816; b=FJfVobxMaLfum7UJxxPvtCRjkEUVnwlCGitNp8j4dh0KLnVvICLg9f70/cgBdqF/V4 e8G1UIyMTmrjxKilngVWL+aYxyJ54vdP2KBdvTrdAHhYcz8fj/wlmP2jzNhJVqoEDnG7 2rNCzlRW+tSMRd75ZZNr9XUirvoTzM9gTiII5KeYTdw/kMKfcaic3NlVsihFeBD066tp mReEW9prK3boLaHXfKIfZQlg0K2TYD866EJurnOanlGvu6wDwqvyPfqP2RdDNM4ReYOV ArgUe+1E9C5+C0ScpphX4W1nyCPhXWvymQC3yhXBuBq5cjHop8k/k6uW0oSmt6zf0LhJ av7Q== 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; bh=TFzzz0IFQ9CZ5MVrisIRlnxjYE4CyblzFDdro0d8jCM=; b=cwQkCKVUFJKAlZd0wh6aggRFihB5H3S/kzsvLHIPkXmMj/11ari9rrkWBh34WRjwhA dnxSAHmocRlRDqBqxzXuEanlw3fm6Dkd6TV717PBNzYEv+AQxuyvvgptqEn0rRHnW1nr oa0HiwdFiJJ27u8kYuc4nv58HVOzM0YSUcg0A/hUOGVL3WL+L6W+GnNTrBrS5Dn/nnLG lF8/sN0U6PNSWsIhAeT/96B5rODQtNMNNVpQibDiTcb8smp3SYsI5ZmUzDj9lMfgaIuE gHq2mlInL3aPUgkt5kU5jsPcpyCQN1P+2pAhhSHa5zCwe6g3drGvlUHyDuBSl4+H349m rlpw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x64si21210992pfx.87.2019.01.24.09.30.23; Thu, 24 Jan 2019 09:30:39 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729080AbfAXR2q (ORCPT + 99 others); Thu, 24 Jan 2019 12:28:46 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:33102 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727765AbfAXR2o (ORCPT ); Thu, 24 Jan 2019 12:28:44 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1F2751596; Thu, 24 Jan 2019 09:28:44 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 994253F6A8; Thu, 24 Jan 2019 09:28:42 -0800 (PST) Date: Thu, 24 Jan 2019 17:28:40 +0000 From: Mark Rutland To: Mike Rapoport Cc: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Nicholas Piggin , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v14 02/12] powerpc/irq: use memblock functions returning virtual address Message-ID: <20190124172839.GB11163@lakrids.cambridge.arm.com> References: <1c8e658c094022a15e4b9f5ef5c191caab3c0dff.1548346225.git.christophe.leroy@c-s.fr> <20190124165153.GB5531@lakrids.cambridge.arm.com> <20190124172553.GE13790@rapoport-lnx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190124172553.GE13790@rapoport-lnx> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 24, 2019 at 07:25:53PM +0200, Mike Rapoport wrote: > On Thu, Jan 24, 2019 at 04:51:53PM +0000, Mark Rutland wrote: > > On Thu, Jan 24, 2019 at 04:19:33PM +0000, Christophe Leroy wrote: > > > Since only the virtual address of allocated blocks is used, > > > lets use functions returning directly virtual address. > > > > > > Those functions have the advantage of also zeroing the block. > > > > > > Suggested-by: Mike Rapoport > > > Acked-by: Mike Rapoport > > > Signed-off-by: Christophe Leroy > > > > [...] > > > > > +static void *__init alloc_stack(void) > > > +{ > > > + void *ptr = memblock_alloc(THREAD_SIZE, THREAD_SIZE); > > > + > > > + if (!ptr) > > > + panic("cannot allocate stacks"); > > > + > > > + return ptr; > > > +} > > > > I believe memblock_alloc() will panic() if it cannot allocate memory, > > since that goes: > > > > memblock_alloc() > > -> memblock_alloc_try_nid() > > -> panic() > > > > So you can get rid of the panic() here, or if you want a custom panic > > message, you can use memblock_alloc_nopanic(). > > As we've already discussed it in [1], I'm working on removing the > _nopanic() versions and dropping the panic() calls from memblock_alloc() > and friends. > > I've posted v2 of the patches earlier this week [2]. > > > [...] > > [1] https://lore.kernel.org/lkml/20190108143428.GB14063@rapoport-lnx/ > [2] https://lore.kernel.org/lkml/1548057848-15136-1-git-send-email-rppt@linux.ibm.com/ Fair enough. Feel free to take the ack regardless, then! Thanks, Mark.