Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1383056ybf; Thu, 27 Feb 2020 09:55:35 -0800 (PST) X-Google-Smtp-Source: APXvYqybJYAyHHSg9+bycBzOIEzyam7z7J2NO+iTXKrAAh5lV9iswe17uKwQj+oHXINnGS1JS6yA X-Received: by 2002:aca:af09:: with SMTP id y9mr140640oie.101.1582826135402; Thu, 27 Feb 2020 09:55:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582826135; cv=none; d=google.com; s=arc-20160816; b=eRAtyIaJg4+M3puJX6xJqyfaLAL2/os09U8lWM2/TWR6GNGRJcO6RpV1hBSJ+uEpfq 4xYE82UER15jjvFSIprmYlN8/CDLnu2cf/TfgWp01SMsczLalWp4bOi6XjBcIQSUPsif IFu9CholQfXpxYg1VdJgEC61duOAVjhiEYdO4sPteBUatGakexOVNo8gIcxpSalKcst/ yZQ8S9kiSSFx60lhQXaP4Z0bo/1LcleCXC0wSASsFYOc7OquL25rvP8b/itneoEvnm+J YR/4bX1aOSMDbRlpbrk28SV6eUOu1fEd5SzqQu0XvKeixGw0M+BrcptKBMRKch1pzSsn 4JTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=+dYeYLYaKlIOFdZHwXK4htTgq17kIxYo8KedUxfv+mo=; b=n6EJIvrHSy83puNKRTrwiSckut1nhhdqs0NeYu0neFWu7+harIdeZC209g71innsmS 41E3gR2o5SsIVmJAncxhHrm+1LYyUXfFdgIz6XciSBQmgDkW6bZUnMl73qP9wcnU49YT nKyfMfLF7bKlw1jCQIBreoWqmfzxxnNGAC7lKTepTNoiw1S7c+iL9aYpIDbqsiUT/R8v 0TjjsnNSE6MkcJ9cIE7MoJbLMN9g0s3AAhuerj6yyjEnu2OMMb7kMkAp0fb6JAgH2ofY GTJLvKWMRFGR71WEr2slBAuLTZHFNbG7nm0f7jp3TZtM5QdB/+KZQ8R0JetKuhi6QYxM T19Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h128si247953oif.258.2020.02.27.09.55.19; Thu, 27 Feb 2020 09:55:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730273AbgB0RzN (ORCPT + 99 others); Thu, 27 Feb 2020 12:55:13 -0500 Received: from ale.deltatee.com ([207.54.116.67]:57282 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726877AbgB0RzM (ORCPT ); Thu, 27 Feb 2020 12:55:12 -0500 Received: from s0106ac1f6bb1ecac.cg.shawcable.net ([70.73.163.230] helo=[192.168.11.155]) by ale.deltatee.com with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j7NMx-0004I6-PN; Thu, 27 Feb 2020 10:54:45 -0700 To: Jason Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-mm@kvack.org, Dan Williams , Michal Hocko , David Hildenbrand , Andrew Morton , Christoph Hellwig , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Eric Badger References: <20200221182503.28317-1-logang@deltatee.com> <20200227171704.GK31668@ziepe.ca> <20200227174311.GL31668@ziepe.ca> From: Logan Gunthorpe Message-ID: <7e573498-81c1-7f00-c1ff-ed16e12a5b96@deltatee.com> Date: Thu, 27 Feb 2020 10:54:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200227174311.GL31668@ziepe.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 70.73.163.230 X-SA-Exim-Rcpt-To: ebadger@gigaio.com, peterz@infradead.org, luto@kernel.org, dave.hansen@linux.intel.com, bp@alien8.de, mingo@redhat.com, tglx@linutronix.de, benh@kernel.crashing.org, will@kernel.org, catalin.marinas@arm.com, hch@lst.de, akpm@linux-foundation.org, david@redhat.com, mhocko@kernel.org, dan.j.williams@intel.com, linux-mm@kvack.org, platform-driver-x86@vger.kernel.org, linux-sh@vger.kernel.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-ia64@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, jgg@ziepe.ca X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH v3 0/7] Allow setting caching mode in arch_add_memory() for P2PDMA X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-02-27 10:43 a.m., Jason Gunthorpe wrote: > Hm, AFAIK WC memory is not compatible with the spinlocks/mutexs/etc in > Linux, so while it is true the memory has no side effects, there would > be surprising concurrency risks if anything in the kernel tried to > write to it. > > Not compatible means the locks don't contain stores to WC memory the > way you would expect. AFAIK on many CPUs extra barriers are required > to keep WC stores ordered, the same way ARM already has extra barriers > to keep UC stores ordered with locking.. > > The spinlocks are defined to contain UC stores though. > > If there is no actual need today for WC I would suggest using UC as > the default. Ok, that sounds sensible. I'll do that in the next revision. Thanks, Logan