Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6255568pxu; Wed, 23 Dec 2020 19:16:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwR7lWrV1gH/pEWXDdGlFZrniQgM06UavPGwT3loQtT/Ju81Aa1XPRY+QRS/GvJp8nzGNFX X-Received: by 2002:a05:6402:14c5:: with SMTP id f5mr26755374edx.232.1608779785303; Wed, 23 Dec 2020 19:16:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608779785; cv=none; d=google.com; s=arc-20160816; b=W+CA8vZGtMw7xoC3k5YWhAa7uSxVCmipLmt1PkHRY+gLvFGQoTq1Mg1CLPmDCMkUDg zbksylF6SG9G7Ax7LLlZQhTN91ygJlhYwGcYxGqWzWUVaPid4tRv9rlXTl/2KYdmdNKe JeRxvOF10KJIG1Og3Q4xuYH4dZH0HQHeEpUU5FtkPezjEfqDINxfbyB1mfyIP/ip8JGb w4kCAf5YU/vz3YMKv6a+gafxDc3e1Doolly7FoyWlzyRnviFodfHD3YICiz+bNxYOVW5 0FPAdKmJid8XhVVUXFswoSOzgMCUT0S/5sA9cbcfyz0md20gdfNJoWKuxTiaFGw9FKbK alsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=J+i6gcZmOD8HUoz+lDJFoOvh/g8DQKNaaWL0fWsv2dk=; b=jUQZobUXhKqC3hx280YQIlgLH0Fnx7vzRUTHgYZyND3IwVzwChIWFnbgXb7R1xEUZx ftkiwi/tot2B7i/Q74tSQM3mgUj2sm97TgWov7Af5k35voYKExbd6igob1BVG/HS379a a0jjTtfiTUuP7yJWN6MovXDGuTYTUgOWYmoXpabHt/sxK5eQzWozF6Zwy/WdMdnVHcyu 6izjHpe05u07OeyCz/74qThXcUCAVz+eSK18J0TQzZSnPnsQDNicndhJFmsJFY8NQW2O 9EnVOMR7QGw74IxcWk/jZmcv7fYkL2W2khm/3QrfoUiyfuKEK5Qp9ZqrnW5tI8CqTAOh Q+uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=QiX9dZis; 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=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si15079561edx.473.2020.12.23.19.16.03; Wed, 23 Dec 2020 19:16:25 -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; dkim=pass header.i=@ibm.com header.s=pp1 header.b=QiX9dZis; 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=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728685AbgLXDPJ (ORCPT + 99 others); Wed, 23 Dec 2020 22:15:09 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:19160 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728280AbgLXDPJ (ORCPT ); Wed, 23 Dec 2020 22:15:09 -0500 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0BO31wFi090316; Wed, 23 Dec 2020 22:14:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : reply-to : references : mime-version : content-type : in-reply-to; s=pp1; bh=J+i6gcZmOD8HUoz+lDJFoOvh/g8DQKNaaWL0fWsv2dk=; b=QiX9dZispPraRPQVUc+b0oB2TUQIi7r6UN4WYdXH6UMSS2EdgjwrItKMI+Ksu6e2KOws EE+pTTAhAE/CkvOHIfXrqGYq2cMa9AhMEQl+3eh+5vyliR+0kRlOUXn/uG4/hQ4zkJ6Y I27VZ9+wdeGTU2b6qED+9N5vncFMJ3+7cBZ/b6foFDvcQH6ic4PGIPrfQLcvVcdARcBf DeGQ3lHfghq4wBgTh0UDhrlSxjkXkC0rtIg4o9nijyxHG1GmkFPJhjbgBzCA/FgkkMhK 4CFhSYU836MCNndqpF6BGbyQAuqIbNDcNDWDGExSTdqbptm7g4WlQ+0H/Xdo0sU0ffAI Zg== Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 35mhta1a7m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Dec 2020 22:14:19 -0500 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0BO3DHGW012721; Thu, 24 Dec 2020 03:14:16 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma02fra.de.ibm.com with ESMTP id 35hdgut98h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Dec 2020 03:14:16 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0BO3EEO023527682 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Dec 2020 03:14:14 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E4ABDA404D; Thu, 24 Dec 2020 03:14:13 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7A716A4040; Thu, 24 Dec 2020 03:14:12 +0000 (GMT) Received: from ram-ibm-com.ibm.com (unknown [9.80.236.76]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 24 Dec 2020 03:14:12 +0000 (GMT) Date: Wed, 23 Dec 2020 19:14:09 -0800 From: Ram Pai To: Thiago Jung Bauermann Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Michael Ellerman , Satheesh Rajendran Subject: Re: [PATCH] powerpc/mm: Limit allocation of SWIOTLB on server machines Message-ID: <20201224031409.GB4102@ram-ibm-com.ibm.com> Reply-To: Ram Pai References: <20201218062103.76102-1-bauerman@linux.ibm.com> <20201223205838.GA4102@ram-ibm-com.ibm.com> <87o8ikukye.fsf@manicouagan.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87o8ikukye.fsf@manicouagan.localdomain> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343,18.0.737 definitions=2020-12-23_14:2020-12-23,2020-12-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 mlxscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012240014 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 23, 2020 at 09:06:01PM -0300, Thiago Jung Bauermann wrote: > > Hi Ram, > > Thanks for reviewing this patch. > > Ram Pai writes: > > > On Fri, Dec 18, 2020 at 03:21:03AM -0300, Thiago Jung Bauermann wrote: > >> On server-class POWER machines, we don't need the SWIOTLB unless we're a > >> secure VM. Nevertheless, if CONFIG_SWIOTLB is enabled we unconditionally > >> allocate it. > >> > >> In most cases this is harmless, but on a few machine configurations (e.g., > >> POWER9 powernv systems with 4 GB area reserved for crashdump kernel) it can > >> happen that memblock can't find a 64 MB chunk of memory for the SWIOTLB and > >> fails with a scary-looking WARN_ONCE: > >> > >> ------------[ cut here ]------------ > >> memblock: bottom-up allocation failed, memory hotremove may be affected > >> WARNING: CPU: 0 PID: 0 at mm/memblock.c:332 memblock_find_in_range_node+0x328/0x340 > >> Modules linked in: > >> CPU: 0 PID: 0 Comm: swapper Not tainted 5.10.0-rc2-orig+ #6 > >> NIP: c000000000442f38 LR: c000000000442f34 CTR: c0000000001e0080 > >> REGS: c000000001def900 TRAP: 0700 Not tainted (5.10.0-rc2-orig+) > >> MSR: 9000000002021033 CR: 28022222 XER: 20040000 > >> CFAR: c00000000014b7b4 IRQMASK: 1 > >> GPR00: c000000000442f34 c000000001defba0 c000000001deff00 0000000000000047 > >> GPR04: 00000000ffff7fff c000000001def828 c000000001def820 0000000000000000 > >> GPR08: 0000001ffc3e0000 c000000001b75478 c000000001b75478 0000000000000001 > >> GPR12: 0000000000002000 c000000002030000 0000000000000000 0000000000000000 > >> GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000002030000 > >> GPR20: 0000000000000000 0000000000010000 0000000000010000 c000000001defc10 > >> GPR24: c000000001defc08 c000000001c91868 c000000001defc18 c000000001c91890 > >> GPR28: 0000000000000000 ffffffffffffffff 0000000004000000 00000000ffffffff > >> NIP [c000000000442f38] memblock_find_in_range_node+0x328/0x340 > >> LR [c000000000442f34] memblock_find_in_range_node+0x324/0x340 > >> Call Trace: > >> [c000000001defba0] [c000000000442f34] memblock_find_in_range_node+0x324/0x340 (unreliable) > >> [c000000001defc90] [c0000000015ac088] memblock_alloc_range_nid+0xec/0x1b0 > >> [c000000001defd40] [c0000000015ac1f8] memblock_alloc_internal+0xac/0x110 > >> [c000000001defda0] [c0000000015ac4d0] memblock_alloc_try_nid+0x94/0xcc > >> [c000000001defe30] [c00000000159c3c8] swiotlb_init+0x78/0x104 > >> [c000000001defea0] [c00000000158378c] mem_init+0x4c/0x98 > >> [c000000001defec0] [c00000000157457c] start_kernel+0x714/0xac8 > >> [c000000001deff90] [c00000000000d244] start_here_common+0x1c/0x58 > >> Instruction dump: > >> 2c230000 4182ffd4 ea610088 ea810090 4bfffe84 39200001 3d42fff4 3c62ff60 > >> 3863c560 992a8bfc 4bd0881d 60000000 <0fe00000> ea610088 4bfffd94 60000000 > >> random: get_random_bytes called from __warn+0x128/0x184 with crng_init=0 > >> ---[ end trace 0000000000000000 ]--- > >> software IO TLB: Cannot allocate buffer > >> > >> Unless this is a secure VM the message can actually be ignored, because the > >> SWIOTLB isn't needed. Therefore, let's avoid the SWIOTLB in those cases. > > > > The above warn_on is conveying a genuine warning. Should it be silenced? > > Not sure I understand your point. This patch doesn't silence the > warning, it avoids the problem it is warning about. Sorry, I should have explained it better. My point is... If CONFIG_SWIOTLB is enabled, it means that the kernel is promising the bounce buffering capability. I know, currently we do not have any kernel subsystems that use bounce buffers on non-secure-pseries-kernel or powernv-kernel. But that does not mean, there wont be any. In case there is such a third-party module needing bounce buffering, it wont be able to operate, because of the proposed change in your patch. Is that a good thing or a bad thing, I do not know. I will let the experts opine. RP