Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S642454AbdD1Tdw (ORCPT ); Fri, 28 Apr 2017 15:33:52 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:37807 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425594AbdD1Tdp (ORCPT ); Fri, 28 Apr 2017 15:33:45 -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: Fri, 28 Apr 2017 16:33:34 -0300 User-Agent: KMail/5.2.3 (Linux/4.4.0-72-generic; KDE/5.28.0; x86_64; ; ) In-Reply-To: <20170428005135.GA3963@fireball> References: <20170426082209.12127-1-takahiro.akashi@linaro.org> <1605356.Vp6YPvtjly@morokweng> <20170428005135.GA3963@fireball> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-TM-AS-MML: disable x-cbid: 17042819-0028-0000-0000-000001AFB61F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042819-0029-0000-0000-000014AFBB68 Message-Id: <2404647.dtAsaUPUyE@morokweng> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-28_12:,, 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-1704280242 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1179 Lines: 29 Am Freitag, 28. April 2017, 09:51:39 BRT schrieb AKASHI Takahiro: > On Thu, Apr 27, 2017 at 07:00:04PM -0300, Thiago Jung Bauermann wrote: > > 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. > > Ah, I haven't noticed that, but x86 doesn't have arch_kexec_walk_mem and > how can it work for x86? Looking at v4.9's kexec_add_buffer, the logic has been this way before I factored kexec_locate_mem_hole out of it. So x86 has been behaving this way for a while. > > Isn't it possible to walk resources from top to bottom? > > Yes, it will be, but it seems to me that such a behavior is not intuitive > and even confusing if it doesn't come with explicit explanation. Yes, I should have put a comment pointing out that assumption. -- Thiago Jung Bauermann IBM Linux Technology Center