Received: by 10.213.65.16 with SMTP id m16csp240136imf; Mon, 12 Mar 2018 01:58:23 -0700 (PDT) X-Google-Smtp-Source: AG47ELtDnLpovVdNOoMAVfVQIgCsYx7AB9yRkqXawUE+ssRVvgDh5S1/2RLRD/pzLPJvN92Erxom X-Received: by 10.98.55.7 with SMTP id e7mr7347777pfa.112.1520845103167; Mon, 12 Mar 2018 01:58:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520845103; cv=none; d=google.com; s=arc-20160816; b=F3Iimkk+axGr7+UvIM3uTBaNO2zwH4DaqdV5mt88D+gUCXqUvaQQk1vJF7fuOIwxWE fDxgZJ+/uTVD4v5J/2IbzCEMZtOqNh+4KpTW6SXz1lPBbagKgOSQaDACdmqzBclC6K8u Xrb3zw4JiBy9Ok3CXDR04IckGIviWknPZ4kJ108VI4TZkaYazI8zpZc2k7dn0Cd38HnY pKV8DNfNwNfOXQK9ehiEaF64nQUoL2+/u11qpWepITBsZ8ROImf2o8cYSEqwIifSBr0X XH3l77jPO8Rut7RP/DyjvBnpKh6CFDmN0AP6s7PO1rkcQifRUAP6I0U33C0VMnusl+Cy EtUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=UXFoLunWhLVldsfu4VcEX/I7M4kQ7x0dEp7lkk3W3dE=; b=rELzQEhFYB5Gh+oT0TpIe0g97llIc0iUgCFDnBdrVtzeC81ns73I0FOTLQU0T454TL LwxZBbWE2FJLnQ13tO7gdiflFp2Des8j9se6w16bj9Y1ixcXB9keIStZb7vCJIdg9hTf TVX3AJFos6oKbxVNdP7F+VHRXfP20Q76wfL0+fLzSqIvWK01FaM9OqsuKH0Lpnct0xR3 NXv2iAv5YhFa5JRLTxBsl+uI0h0vcHNVRm7wv/YiI53SBc3mTeqYpYCirlr2JTQDNKx7 /qqh2ueRQipeFnVEphyPrkOS8bW614unRs6DeWexk5wlGv6FkZsRn96g/LZC9jUQxEHN PWSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=cANDF2tl; 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 d6-v6si5878328plm.88.2018.03.12.01.58.08; Mon, 12 Mar 2018 01:58:23 -0700 (PDT) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=cANDF2tl; 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 S1752434AbeCLI46 (ORCPT + 99 others); Mon, 12 Mar 2018 04:56:58 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50876 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750765AbeCLI45 (ORCPT ); Mon, 12 Mar 2018 04:56:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UXFoLunWhLVldsfu4VcEX/I7M4kQ7x0dEp7lkk3W3dE=; b=cANDF2tlKvT+p9bHSaDcTNlfA pnDLxgc98ZqmyJo992cJJnwIT3EZAiChaeaZxslB4LV1hsuBP6hcKpP8HEoHGMF+iMUiYoP2U+Zfe xRoCXmvbsHV7g/+6aGZe9+LIf0AJVL5FAyf9Z2wqBjmoENDGpXdt5NzmpjNhPeZBvfPEcSuAVk75q ZvQN4s1OgCICaDZxi13pKCC2M+ECv3L9Ob3hgVSt8G7U9JXWXTr2hbMjSBkfwrZIEMFKuNrP6o8JU knei3wRsvTEElFzQnJxADdYQ5x3fv93BWPaG7fz05M0NzXIYPxpizZHsdKuvROSjxSyZVA4UKwQuw OKb6oUl8w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1evJGC-0005rh-7U; Mon, 12 Mar 2018 08:56:48 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 687712029FA14; Mon, 12 Mar 2018 09:56:46 +0100 (CET) Date: Mon, 12 Mar 2018 09:56:46 +0100 From: Peter Zijlstra To: Boqun Feng Cc: =?utf-8?B?54Sm5pmT5Yas?= , linux-kernel@vger.kernel.org, Alan Stern , will.deacon@arm.com, torvalds@linux-foundation.org, npiggin@gmail.com, mingo@kernel.org, mpe@ellerman.id.au, oleg@redhat.com, benh@kernel.crashing.org, Paul McKenney Subject: Re: smp_mb__after_spinlock requirement too strong? Message-ID: <20180312085646.GE4064@hirez.programming.kicks-ass.net> References: <20180312054412.yqyde34ly3kjoajj@tardis> <20180312085600.aczjkpn73axzs2sb@tardis> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180312085600.aczjkpn73axzs2sb@tardis> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 12, 2018 at 04:56:00PM +0800, Boqun Feng wrote: > So I think the purpose of smp_mb__after_spinlock() is to provide RCsc > locks, it's just the comments before that may be misleading. We want > RCsc locks in schedule code because we want writes in different critical > section are ordered even outside the critical sections, for case like: > > CPU 0 CPU 1 CPU 2 > > {A =0 , B = 0} > lock(rq0); > write A=1; > unlock(rq0); > > lock(rq0); > read A=1; > write B=2; > unlock(rq0); > > read B=2; > smp_rmb(); > read A=1; > > I think we need to fix the comments rather than loose the requirement. > Peter? Yes, ISTR people relying on schedule() being RCsc, and I just picked a bad exmaple.