Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pP8aQ-0002sN-I3 for mharc-grub-devel@gnu.org; Mon, 06 Feb 2023 15:59:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP8aO-0002oq-61 for grub-devel@gnu.org; Mon, 06 Feb 2023 15:59:36 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP8aM-0004Pf-7m for grub-devel@gnu.org; Mon, 06 Feb 2023 15:59:35 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316KOjqK014251; Mon, 6 Feb 2023 20:59:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=e1gzcABB4EeXlJSb6yOSDxajNubyVNnUvBQcOyKkwkw=; b=pKhcL+mJr7sYOvJQZ21SOTjiq6dWwR6zhBR72QYz6TMIP0eUVujGA8qg8YXlW9REav4K njzcs4iJ+4kBqA6ljpc4pEU0NpK1v2y95aNSXkS3M1T44CzIqg3K77poMU3KEUWhilsf 6mkvxmwtrrCFym501hO9A28s3iGK1j5JA4OP72hfu/FhANQPrgGpat/JOW+hoKlPtVBv xEJp18i65QZSwKhXlG1of5zcELhG8dk0WWojkqizbGbdPRDwpHTJ87jt29u34bY9ho1M 2TWpLX9dGhsV1I7IHwr2DJT4DRgCDAcDtKHHEGPAD43D9lI8yoTVYaHBifcyeX3lXxGK fQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk8jj8n5h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Feb 2023 20:59:30 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 316KSsVk027477; Mon, 6 Feb 2023 20:59:30 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk8jj8n52-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Feb 2023 20:59:30 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316IUiFt001953; Mon, 6 Feb 2023 20:59:29 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([9.208.130.99]) by ppma02dal.us.ibm.com (PPS) with ESMTPS id 3nhf077m38-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Feb 2023 20:59:29 +0000 Received: from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com [10.39.53.230]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316KxRFq34341326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 20:59:27 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 26BAB5805A; Mon, 6 Feb 2023 20:59:27 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 65ADB58054; Mon, 6 Feb 2023 20:59:26 +0000 (GMT) Received: from [9.47.158.152] (unknown [9.47.158.152]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 20:59:26 +0000 (GMT) Message-ID: <5c77c9e2-4434-1e34-d6fa-0056300c8455@linux.ibm.com> Date: Mon, 6 Feb 2023 15:59:25 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v4 3/6] ieee1275: support runtime memory claiming Content-Language: en-US To: Robbie Harwood , grub-devel@gnu.org, dkiper@net-space.pl Cc: development@efficientek.com, dja@axtens.net, sudhakar@linux.ibm.com, nasastry@in.ibm.com, avnish@imap.linux.ibm.com References: <20230206150325.3756840-1-stefanb@linux.ibm.com> <20230206150325.3756840-4-stefanb@linux.ibm.com> From: Stefan Berger In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: DtnymzQEBbq8hKYQ7hyvs-9QfEIeSgHy X-Proofpoint-GUID: zbX1Aszi8WUBw3t1KPLpeg2yURwxHbwZ Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxscore=0 clxscore=1015 impostorscore=0 suspectscore=0 priorityscore=1501 phishscore=0 malwarescore=0 bulkscore=0 mlxlogscore=923 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060178 Received-SPF: pass client-ip=148.163.156.1; envelope-from=stefanb@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.148, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2023 20:59:36 -0000 On 2/6/23 15:09, Robbie Harwood wrote: > Stefan Berger writes: > >> -/* The maximum heap size we're going to claim */ >> +/* The maximum heap size we're going to claim at boot. Not used by sparc. */ >> #ifdef __i386__ >> #define HEAP_MAX_SIZE (unsigned long) (64 * 1024 * 1024) >> -#else >> +#else /* __powerpc__ */ >> #define HEAP_MAX_SIZE (unsigned long) (32 * 1024 * 1024) >> #endif > > In the version of this patch I've been carrying, the max heap is > increased a good bit: > >> #define HEAP_MAX_SIZE (unsigned long) (1 * 1024 * 1024 * 1024) > > Should it be made larger here as well? HEAP_MAX_SIZE is only used here and this function is called on initialization from grub_machine_init() static void grub_claim_heap (void) { grub_err_t err; grub_uint32_t total = HEAP_MAX_SIZE; err = grub_ieee1275_total_mem (&rmo_top); /* * If we cannot size the available memory, we can't be sure we're leaving * space for the kernel, initrd and things Linux loads early in boot. So only * allow further allocations from firmware on success */ if (err == GRUB_ERR_NONE) grub_mm_add_region_fn = grub_ieee1275_mm_add_region; #if defined(__powerpc__) if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY)) { /* if we have an error, don't call CAS, just hope for the best */ if (err == GRUB_ERR_NONE && rmo_top < (512 * 1024 * 1024)) grub_ieee1275_ibm_cas (); } #endif grub_machine_mmap_iterate (heap_init, &total); } #endif This seems to only be for the *initial* heap size and doesn't matter anymore later on for ppc. This is shared code also with ieee1275 i386 ... Stefan > > Full commit: > https://github.com/rhboot/grub2/commit/e572ccc0edb3423976e8301978617382994ed52a > > Be well, > --Robbie