Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30163C43461 for ; Thu, 10 Sep 2020 21:48:33 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7679206E9 for ; Thu, 10 Sep 2020 21:48:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pNtMzG5D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7679206E9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=agtlM1gYBJClgc1SMOfaB1TXOJlzfx4poOf74bvaM3o=; b=pNtMzG5DZqv37Ef+i5LY8A3g9 djR/XmpIFe0XCTKI+gWpBLFhlkG47/Ft7nKW3kKTMfC3oxqhvMjrVbKfuhSCbXMqZgAC6lb1yPk7u zuTNGTEOiiUkUE+AmfR8FemXd1wkgtqSe3agVqDbA91Mg8Tw2OTL6yy2aY1mBIv/UeVrqAJk4e4SP geV/yP61S8jMTKYYOdgXG2K4FLFsQmM0ETG1ZiW5l6kfylZw58F4KTKDUXId16LyBw76WTAouISB5 2ccldzpqtwBaM8jwcd2ybWDDEjm1n/oQTGaqwQc0hIxS+3e2r2fBd4J28MGiDjq0RUyi6bMve6vjz ER98uv/0g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGUPU-00025i-E3; Thu, 10 Sep 2020 21:47:16 +0000 Received: from kernel.crashing.org ([76.164.61.194]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGUPR-000257-K7 for linux-arm-kernel@lists.infradead.org; Thu, 10 Sep 2020 21:47:14 +0000 Received: from localhost (gate.crashing.org [63.228.1.57]) (authenticated bits=0) by kernel.crashing.org (8.14.7/8.14.7) with ESMTP id 08ALknRT031996 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Sep 2020 16:46:53 -0500 Message-ID: <44acc22377958a57c738f5139c5b5df2841c2544.camel@kernel.crashing.org> Subject: Re: [PATCH] arm64: Enable PCI write-combine resources under sysfs From: Benjamin Herrenschmidt To: Jason Gunthorpe , Lorenzo Pieralisi Date: Fri, 11 Sep 2020 07:46:47 +1000 In-Reply-To: <20200910171033.GG904879@nvidia.com> References: <20200831151827.pumm2p54fyj7fz5s@amazon.com> <20200902113207.GA27676@e121166-lin.cambridge.arm.com> <20200902142922.xc4x6m33unkzewuh@amazon.com> <20200902164702.GA30611@e121166-lin.cambridge.arm.com> <20200903110844.GB11284@e121166-lin.cambridge.arm.com> <28d333afc73bd854390f8c39691a735040ba5b39.camel@kernel.crashing.org> <20200910094600.GA22840@e121166-lin.cambridge.arm.com> <20200910123758.GC904879@nvidia.com> <20200910151721.GA25809@e121166-lin.cambridge.arm.com> <20200910171033.GG904879@nvidia.com> X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200910_174713_787917_A2BF344E X-CRM114-Status: GOOD ( 20.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leon Romanovsky , linux-pci@vger.kernel.org, Bjorn Helgaas , catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, Clint Sbisa Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 2020-09-10 at 14:10 -0300, Jason Gunthorpe wrote: > Can you explain what this actually does on ARM? > > Can it ever speculate loads across page boundaries, or speculate > loads > that never exist in the program? ie will we get random unpredicable > MemRds? Probably, at least on powerpc you will as well, that's the only way to get write combine. > Does it/could it "combine writes"? I assume so for ARM, definitely for powerpc. > > > If the CPU fails to generate a 64 byte TLP then the device will > > > still > > > operate correctly but does a different, slower, flow. > > > > Side note: on ARM that TLP is not a native interconnect > > transaction, > > reworded, it depends on what the system-bus->PCI logic does in > > this respect. > > I think the issue is that ARM never defined what the bits set by > pgprot_writecombine() do at a system level so we see implementations > that do not cause write combining at the PCI-E interface for those > bits. (I assume from what I've heard) Nobody did. I think only x86 has a real "write combine" attribute. I tried to untangled that mess years ago and didnt' get to the bottom of it, but basically, on non-x86 archs, pgprot_writecombine will give you what you asked ... and more. > > That's why I looped you in - that's what worries me about > > "enabling" > > arch_can_pci_mmap_wc() on arm64. If we enable it and we have perf > > regressions that's not OK. > > > > Or we *can* enable arch_can_pci_mmap_wc() but force the mellanox > > driver (or more broadly all drivers following this message push > > semantics) to use "something else" for WC detection. > > arch_can_pci_mmap_wc() really only controls the sysfs resource file > and it seems very unclear who in userspace uses that these days. dpdk under some circumstances afaik. > vfio is now the right way to do that stuff. I don't see an obvious > way to get WC memory in VFIO though... Which would be a performance issue on a number of things I suppose... Cheers, Ben. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel