From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d3rSp-0003zb-TO for kexec@lists.infradead.org; Thu, 27 Apr 2017 22:00:42 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3RLx89A144943 for ; Thu, 27 Apr 2017 18:00:19 -0400 Received: from e24smtp05.br.ibm.com (e24smtp05.br.ibm.com [32.104.18.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 2a3j0kk62m-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 27 Apr 2017 18:00:17 -0400 Received: from localhost by e24smtp05.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 27 Apr 2017 19:00:15 -0300 Received: from d24av03.br.ibm.com (d24av03.br.ibm.com [9.8.31.95]) by d24relay04.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3RM0ChS66388142 for ; Thu, 27 Apr 2017 19:00:12 -0300 Received: from d24av03.br.ibm.com (localhost [127.0.0.1]) by d24av03.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v3RM0DmE008430 for ; Thu, 27 Apr 2017 19:00:13 -0300 From: Thiago Jung Bauermann Subject: Re: [PATCH] kexec: allocate buffer in top-down, if specified, correctly Date: Thu, 27 Apr 2017 19:00:04 -0300 In-Reply-To: <20170426082209.12127-1-takahiro.akashi@linaro.org> References: <20170426082209.12127-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 Message-Id: <1605356.Vp6YPvtjly@morokweng> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: AKASHI Takahiro Cc: kexec@lists.infradead.org, dyoung@redhat.com, vgoyal@redhat.com, bhe@redhat.com, linux-kernel@vger.kernel.org Hello, Am Mittwoch, 26. April 2017, 17:22:09 BRT schrieb AKASHI Takahiro: > The current kexec_locate_mem_hole(kbuf.top_down == 1) stops searching at > the first memory region that has enough space for requested size even if > some of higher regions may also have. kexec_locate_mem_hole expects arch_kexec_walk_mem to walk memory from top to bottom if top_down is true. That is what powerpc's version does. Isn't it possible to walk resources from top to bottom? > This behavior is not consistent with locate_hole(hole_end == -1) function > of kexec-tools. > > This patch fixes the bug, going though all the memory regions anyway. This patch would break powerpc, because at the end of the memory walk kbuf would have the lowest memory hole. If it's not possible to walk resources in reverse order, then this patch needs to change powerpc to always walk memory from bottom to top. -- Thiago Jung Bauermann IBM Linux Technology Center _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423218AbdD0WAi (ORCPT ); Thu, 27 Apr 2017 18:00:38 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52337 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1033143AbdD0WAc (ORCPT ); Thu, 27 Apr 2017 18:00:32 -0400 From: Thiago Jung Bauermann To: AKASHI Takahiro Cc: dyoung@redhat.com, bhe@redhat.com, vgoyal@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kexec: allocate buffer in top-down, if specified, correctly Date: Thu, 27 Apr 2017 19:00:04 -0300 User-Agent: KMail/5.2.3 (Linux/4.4.0-72-generic; KDE/5.28.0; x86_64; ; ) In-Reply-To: <20170426082209.12127-1-takahiro.akashi@linaro.org> References: <20170426082209.12127-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-TM-AS-MML: disable x-cbid: 17042722-0032-0000-0000-000005595DAE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042722-0033-0000-0000-000011DE5E57 Message-Id: <1605356.Vp6YPvtjly@morokweng> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-27_18:,, 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-1703280000 definitions=main-1704270348 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Am Mittwoch, 26. April 2017, 17:22:09 BRT schrieb AKASHI Takahiro: > The current kexec_locate_mem_hole(kbuf.top_down == 1) stops searching at > the first memory region that has enough space for requested size even if > some of higher regions may also have. kexec_locate_mem_hole expects arch_kexec_walk_mem to walk memory from top to bottom if top_down is true. That is what powerpc's version does. Isn't it possible to walk resources from top to bottom? > This behavior is not consistent with locate_hole(hole_end == -1) function > of kexec-tools. > > This patch fixes the bug, going though all the memory regions anyway. This patch would break powerpc, because at the end of the memory walk kbuf would have the lowest memory hole. If it's not possible to walk resources in reverse order, then this patch needs to change powerpc to always walk memory from bottom to top. -- Thiago Jung Bauermann IBM Linux Technology Center