Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1963698rdf; Sun, 5 Nov 2023 23:45:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGcLi3GNvbyKYeAeyq3HMZVokkN2wH4wiAk1GPFDGBYwwAQzdUoAc2dE7xg/tfq0XTquTn X-Received: by 2002:a17:90b:4fc2:b0:27d:8a04:f964 with SMTP id qa2-20020a17090b4fc200b0027d8a04f964mr11701171pjb.24.1699256705783; Sun, 05 Nov 2023 23:45:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699256705; cv=none; d=google.com; s=arc-20160816; b=F4NrKofFSjsLf1oBOlZcqleI7zf3LzWpgTqgVfxSpvYF6RF7I9a/sAiaoICgMOwa2X +kg3CeLU7Kd293v3dCyv+kydVNoAlbyxCsxbQZTOMRAStnpV9xSt7h/9oy+DYV82J3i9 5sx/ln6YptEF5FJLWnjDb7+vY6Qpptj4fcUccTq1a+frsMB5hmwMmN+1sCzvrEvOo6YY 3CLz8tISXC11VRKdZbk5hl+tQha/sn8N6TAdEDovJRHDs+asRea8RhZmYQcPq3Mx2DY6 ljv6fLeBcUtJvoYJnViyeAtZ1zUQOvvZl13CCKr+8dZ3BJbN6TI1N+goJ/qcBtmMZel/ PG3w== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=1p3rQwMzI/mGBAxdbJw7PuEw6iVSxDWAb1yAoeGTAhw=; fh=AiwEGqVPDrXIkT5+YH+WDZJWLCn0V6gAYuHIBe7R06M=; b=QcvnKkC1Eox0W86XoL6Lq/PsycDkGwXESEL/QnXUeMJN1Q+uFB3oTtnG1Bp3svlaCW kmLfqp90Bk2qFHtVweuadvzNZbjHsg2qfe5JZG+uIleJE8/2T3hcN4M/SOkf5Ysp+nUO WeLrfdsRnLbLc77accQRBaDADYeBOsIVFFcZd68Pqr9Xt+cjK0uZCSFjcjB6fD5JKPs1 ph1LLkV0Gf/XCP9/MwD+4nXN/YeMf9znP/hCEPcEXO0o7F7RfzpHkqT2mo4JAsrMLNrQ 2lp1fNxksDuRtlryvRQqtEVmVV8l1hgfGm2FMW5ESdqfyFou+Ms3AdPTDy/LT7dvdTK9 0qFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id t13-20020a17090a024d00b0027995cf4342si7533971pje.55.2023.11.05.23.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 23:45:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 21CCF80A9750; Sun, 5 Nov 2023 23:45:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230497AbjKFHo4 (ORCPT + 99 others); Mon, 6 Nov 2023 02:44:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbjKFHoz (ORCPT ); Mon, 6 Nov 2023 02:44:55 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7708F93; Sun, 5 Nov 2023 23:44:52 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 611E46732D; Mon, 6 Nov 2023 08:44:48 +0100 (CET) Date: Mon, 6 Nov 2023 08:44:48 +0100 From: Christoph Hellwig To: Petr =?utf-8?B?VGVzYcWZw61r?= Cc: Niklas Schnelle , Christoph Hellwig , Bjorn Helgaas , Marek Szyprowski , Robin Murphy , Petr Tesarik , Ross Lagerwall , linux-pci , linux-kernel@vger.kernel.org, iommu@lists.linux.dev, Matthew Rosato , Halil Pasic Subject: Re: Memory corruption with CONFIG_SWIOTLB_DYNAMIC=y Message-ID: <20231106074448.GB17777@lst.de> References: <104a8c8fedffd1ff8a2890983e2ec1c26bff6810.camel@linux.ibm.com> <20231103195949.0af884d0@meshulam.tesarici.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231103195949.0af884d0@meshulam.tesarici.cz> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 05 Nov 2023 23:45:02 -0800 (PST) On Fri, Nov 03, 2023 at 07:59:49PM +0100, Petr Tesařík wrote: > I don't think it's possible to improve the allocation logic without > modifying the page allocator and/or the DMA atomic pool allocator to > take additional constraints into account. > > I had a wild idea back in March, but it would require some intrusive > changes in the mm subsystem. Among other things, it would make memory > zones obsolete. I mean, people may actually like to get rid of DMA, > DMA32 and NORMAL, but you see how many nasty bugs were introduced even > by a relatively small change in SWIOTLB. Replacing memory zones with a > system based on generic physical allocation constraints would probably > blow up the universe. ;-) It would be very nice, at least for DMA32 or the 30/31-bit DMA pools used on some architectures. For the x86-style 16MB zone DMA I suspect just having a small pool on the side that's not even exposed to the memory allocator would probably work better. I think a lot of the MM folks would love to be able to kill of the extra zones.