Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1310318pxb; Fri, 26 Feb 2021 07:43:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJfD/ipuejCVxcpWdENrh35HHc7AIthlKLfCcwfcBFOrlKWB1rQdUzKavibJfww8rGq0Fc X-Received: by 2002:a17:907:216b:: with SMTP id rl11mr3991696ejb.147.1614354206037; Fri, 26 Feb 2021 07:43:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614354206; cv=none; d=google.com; s=arc-20160816; b=jTYUYVwv6jRUib4gACECE6Be/n3nf8ECwBYa0gEaRHa9r2SDLsRM4U6qV7kxAXXwT7 me3/EbT0adiSlV8Sx1MWbCBrJaw24fp4EEtwC/ZKbOOB/w7d3veGZ3rxpcfFWUqVBzem oyb2UjVknP+lPWfznSD28g6fNXYE9to1xIJzyr4Je+2yvWNWrjXFuDT+426Xf5sZKDPX jY5aZ6JuknMj4n+xKv64G4pkV+nrSUbJXaWtx9yPbQGg6w83/Y6UBpyPY2atkmbwlcjC 9pFn0TlNksZmoJAOG+QAG/A6FAhWxFpn2krTFx/CKdMIlrHiDJ2RlDNoudxGX35t3wB1 36ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:mime-version:user-agent:message-id :in-reply-to:date:references:cc:to:from; bh=DkJ2m8Ry1BVW0jg2ZQAbMN1sGWBtLXygEsIy31CzPm8=; b=Ic9bWxqRcbXOwi2+9sVl6uKAJwJYOKYI6JKtuQWLclMYzRg+LLoRby5eyBdl5nYQfm EAhMva/SbXKPHgxjxoiJC5X3t1schEgwQrNx96xy73lyapd/MfexuUXXgbvUaW38sO7u of+nt+ILS3jSw4yjrI7fLcKeblPXl81m83syayyl5foXjJ2Puc2c+iiQxHIkocT8ZWdH aoxrHIaalzbKVGpDii5j9zIG2Ea9GZUBsnkZOIdivg5P932zz+E6mGeqZ1QfLr4O22wE 60iPqgDbFklPYOgneYK8lzhrGAHiIQGmaQiAtrxAnPTwrfa6TMuOfSZOhCEDrwdKJsj/ teQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i15si5835361edl.581.2021.02.26.07.43.00; Fri, 26 Feb 2021 07:43:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230070AbhBZPjw (ORCPT + 99 others); Fri, 26 Feb 2021 10:39:52 -0500 Received: from out01.mta.xmission.com ([166.70.13.231]:59482 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229571AbhBZPju (ORCPT ); Fri, 26 Feb 2021 10:39:50 -0500 Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lFfCV-000SD1-1a; Fri, 26 Feb 2021 08:38:43 -0700 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=fess.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lFfCU-000gGq-17; Fri, 26 Feb 2021 08:38:42 -0700 From: ebiederm@xmission.com (Eric W. Biederman) To: chenzhou Cc: Baoquan He , Catalin Marinas , , , , , , , , , , , , , , , , , , , , , References: <20210130071025.65258-1-chenzhou10@huawei.com> <20210130071025.65258-2-chenzhou10@huawei.com> <20210224141939.GA28965@arm.com> <20210225072426.GH3553@MiWiFi-R3L-srv> <121fa1e6-f1a3-d47f-bb1d-baaacf96fddc@huawei.com> Date: Fri, 26 Feb 2021 09:38:37 -0600 In-Reply-To: <121fa1e6-f1a3-d47f-bb1d-baaacf96fddc@huawei.com> (chenzhou's message of "Fri, 26 Feb 2021 14:45:25 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1lFfCU-000gGq-17;;;mid=;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19FonAfyXHc11Z6qU3W8XfsdQm1v4+5X8w= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa05.xmission.com X-Spam-Level: X-Spam-Status: No, score=-0.3 required=8.0 tests=ALL_TRUSTED,BAYES_20, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01, T_TooManySym_02,XMSubLong autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -0.0 BAYES_20 BODY: Bayes spam probability is 5 to 20% * [score: 0.1917] * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;chenzhou X-Spam-Relay-Country: X-Spam-Timing: total 502 ms - load_scoreonly_sql: 0.12 (0.0%), signal_user_changed: 13 (2.6%), b_tie_ro: 11 (2.2%), parse: 1.68 (0.3%), extract_message_metadata: 20 (4.0%), get_uri_detail_list: 3.2 (0.6%), tests_pri_-1000: 8 (1.6%), tests_pri_-950: 1.80 (0.4%), tests_pri_-900: 1.49 (0.3%), tests_pri_-90: 101 (20.1%), check_bayes: 98 (19.6%), b_tokenize: 13 (2.6%), b_tok_get_all: 10 (1.9%), b_comp_prob: 4.1 (0.8%), b_tok_touch_all: 68 (13.5%), b_finish: 1.09 (0.2%), tests_pri_0: 330 (65.9%), check_dkim_signature: 0.78 (0.2%), check_dkim_adsp: 2.6 (0.5%), poll_dns_idle: 0.57 (0.1%), tests_pri_10: 4.2 (0.8%), tests_pri_500: 15 (3.0%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v14 01/11] x86: kdump: replace the hard-coded alignment with macro CRASH_ALIGN X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org chenzhou writes: > On 2021/2/25 15:25, Baoquan He wrote: >> On 02/24/21 at 02:19pm, Catalin Marinas wrote: >>> On Sat, Jan 30, 2021 at 03:10:15PM +0800, Chen Zhou wrote: >>>> Move CRASH_ALIGN to header asm/kexec.h for later use. Besides, the >>>> alignment of crash kernel regions in x86 is 16M(CRASH_ALIGN), but >>>> function reserve_crashkernel() also used 1M alignment. So just >>>> replace hard-coded alignment 1M with macro CRASH_ALIGN. >>> [...] >>>> @@ -510,7 +507,7 @@ static void __init reserve_crashkernel(void) >>>> } else { >>>> unsigned long long start; >>>> >>>> - start = memblock_phys_alloc_range(crash_size, SZ_1M, crash_base, >>>> + start = memblock_phys_alloc_range(crash_size, CRASH_ALIGN, crash_base, >>>> crash_base + crash_size); >>>> if (start != crash_base) { >>>> pr_info("crashkernel reservation failed - memory is in use.\n"); >>> There is a small functional change here for x86. Prior to this patch, >>> crash_base passed by the user on the command line is allowed to be 1MB >>> aligned. With this patch, such reservation will fail. >>> >>> Is the current behaviour a bug in the current x86 code or it does allow >>> 1MB-aligned reservations? >> Hmm, you are right. Here we should keep 1MB alignment as is because >> users specify the address and size, their intention should be respected. >> The 1MB alignment for fixed memory region reservation was introduced in >> below commit, but it doesn't tell what is Eric's request at that time, I >> guess it meant respecting users' specifying. > I think we could make the alignment unified. Why is the alignment system reserved and > user specified different? Besides, there is no document about the 1MB alignment. > How about adding the alignment size(16MB) in doc if user specified > start address as arm64 does. Looking at what the code is doing. Attempting to reserve a crash region at the location the user specified. Adding unnecessary alignment constraints is totally broken. I am not even certain enforcing a 1MB alignment makes sense. I suspect it was added so that we don't accidentally reserve low memory on x86. Frankly I am not even certain that makes sense. Now in practice there might be an argument for 2MB alignment that goes with huge page sizes on x86. But until someone finds that there are actual problems with 1MB alignment I would not touch it. The proper response to something that isn't documented and confusing is not to arbitrarily change it and risk breaking users. Especially in this case where it is clear that adding additional alignment is total nonsense. The proper response to something that isn't clear and documented is to dig in and document it, or to leave it alone and let it be the next persons problem. In this case there is no reason for changing this bit of code. All CRASH_ALIGN is about is a default alignment when none is specified. It is not a functional requirement but just something so that things come out nicely. Eric