Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2708046imm; Sun, 30 Sep 2018 03:10:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV628yiQZddtfKXrlhFUyF3Y1L5t+sd0rasDb5exC0OL0lwy5yIXWXmD/MGwl6YXDej8sS6+b X-Received: by 2002:a63:fc23:: with SMTP id j35-v6mr2919840pgi.1.1538302237006; Sun, 30 Sep 2018 03:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538302236; cv=none; d=google.com; s=arc-20160816; b=q8jf2HNP6oxioIkC7ncMR3M8F9jfVBcppakI+2L5T6/zr3zphmlnNGK1BV7I4SqHhQ jsKCvTgaBfq0XrBTL+VpsdmWebfPdOsKMfZxDTmUH8rASZfn/lX5pwAYKbjk3r/jrLS8 Z6MjNI+edWYqbcfp5uie1AoyuCR9cGiwJYGnoKPPobFvQmGpE8bxoXzI90i8W/I8dcXt sHNu+CCKnbyjKUL4DZkQYRmYYKxzGjvvgzSwN2QareYc2XTX6OIvZ++l7wTVIt4mNPHi lBRPEoFDEd0S7x8uDu6YTZ07nWTVXGy2/28DPQsggFUPG46UXF+auAXNKz4q9aCYUWbY xC2Q== 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=aaL4FyWzkTOUjJRMBpTR+NBGaOOZyWqf7BvZG8UaUww=; b=wwO7RLG9C7fcR0nXmCnPDOCKLfgFaQ7vUfWHmAoo/tIn2wVfP8+NiYo4E7Od08qQdy EGyZ8otnQaWmw0yEeyxa6MyobMxAgkfUHILLi6/5yfWz4Z/FA/4gI7hsuHT8jDkthNB+ wytIdBOun6Atbl63/yfyTNdg6WT5daLQhwXDkKDJr24h9ynyzkcD6Vy/C5CZsDtnPYhW bAcqRGOEJAPBV0TkwVp4ozRpkJ2DqphLjXEgoaWjX54pgoh/bBbud9/2i6JGBEOzMOFY /orVzHFYe8vhj6sWKAM9b5CRXtkhpn1x14PoHLuTax/h9ya9Hx31/DC0qObmbLa46WOd Wn0w== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3-v6si9350168pfn.97.2018.09.30.03.10.22; Sun, 30 Sep 2018 03:10:36 -0700 (PDT) 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728187AbeI3Qmg (ORCPT + 99 others); Sun, 30 Sep 2018 12:42:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50708 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727861AbeI3Qmg (ORCPT ); Sun, 30 Sep 2018 12:42:36 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 37E9581F0B; Sun, 30 Sep 2018 10:10:13 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-158.pek2.redhat.com [10.72.12.158]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8ECAF608E5; Sun, 30 Sep 2018 10:10:06 +0000 (UTC) Date: Sun, 30 Sep 2018 18:10:01 +0800 From: Dave Young To: AKASHI Takahiro Cc: catalin.marinas@arm.com, will.deacon@arm.com, dhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, bhe@redhat.com, arnd@arndb.de, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, prudo@linux.ibm.com, james.morse@arm.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v15 05/16] kexec_file: kexec_walk_memblock() only walks a dedicated region at kdump Message-ID: <20180930101001.GE6950@dhcp-128-65.nay.redhat.com> References: <20180928064841.14117-1-takahiro.akashi@linaro.org> <20180928064841.14117-6-takahiro.akashi@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180928064841.14117-6-takahiro.akashi@linaro.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sun, 30 Sep 2018 10:10:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/28/18 at 03:48pm, AKASHI Takahiro wrote: > In kdump case, there exists only one dedicated memblock region as usable > memory (crashk_res). With this patch, kexec_walk_memblock() runs a given > callback function on this region. > > Cosmetic change: 0 to MEMBLOCK_NONE at for_each_free_mem_range*() > > Signed-off-by: AKASHI Takahiro > Cc: Dave Young > Cc: Vivek Goyal > Cc: Baoquan He Acked-by: Dave Young > --- > kernel/kexec_file.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c > index 370d7eab49fe..2f615a7968dd 100644 > --- a/kernel/kexec_file.c > +++ b/kernel/kexec_file.c > @@ -511,8 +511,11 @@ static int kexec_walk_memblock(struct kexec_buf *kbuf, > phys_addr_t mstart, mend; > struct resource res = { }; > > + if (kbuf->image->type == KEXEC_TYPE_CRASH) > + return func(&crashk_res, kbuf); > + > if (kbuf->top_down) { > - for_each_free_mem_range_reverse(i, NUMA_NO_NODE, 0, > + for_each_free_mem_range_reverse(i, NUMA_NO_NODE, MEMBLOCK_NONE, > &mstart, &mend, NULL) { > /* > * In memblock, end points to the first byte after the > @@ -526,8 +529,8 @@ static int kexec_walk_memblock(struct kexec_buf *kbuf, > break; > } > } else { > - for_each_free_mem_range(i, NUMA_NO_NODE, 0, &mstart, &mend, > - NULL) { > + for_each_free_mem_range(i, NUMA_NO_NODE, MEMBLOCK_NONE, > + &mstart, &mend, NULL) { > /* > * In memblock, end points to the first byte after the > * range while in kexec, end points to the last byte > -- > 2.19.0 > > > _______________________________________________ > kexec mailing list > kexec@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kexec Thanks Dave