From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752256AbcHKW2W (ORCPT ); Thu, 11 Aug 2016 18:28:22 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40905 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751636AbcHKW2S (ORCPT ); Thu, 11 Aug 2016 18:28:18 -0400 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com Date: Thu, 11 Aug 2016 11:26:47 -0700 From: "Paul E. McKenney" To: Johannes Berg , linux-kernel@vger.kernel.org, Johannes Berg , Peter Zijlstra , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Ingo Molnar Subject: Re: [PATCH 1/2] Revert "drm/fb-helper: Reduce READ_ONCE(master) to lockless_dereference" Reply-To: paulmck@linux.vnet.ibm.com References: <1470909022-687-1-git-send-email-johannes@sipsolutions.net> <20160811103859.GL6232@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160811103859.GL6232@phenom.ffwll.local> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16081122-0020-0000-0000-00000989082B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005579; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000181; SDB=6.00743365; UDB=6.00350032; IPR=6.00515914; BA=6.00004658; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012317; XFM=3.00000011; UTC=2016-08-11 22:28:16 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16081122-0021-0000-0000-0000547DE3D0 Message-Id: <20160811182647.GD3482@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-11_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608110286 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 11, 2016 at 12:38:59PM +0200, Daniel Vetter wrote: > On Thu, Aug 11, 2016 at 11:50:21AM +0200, Johannes Berg wrote: > > From: Johannes Berg > > > > This reverts commit fa7d81bb3c269a2ee38b6e4d569d9eb8be1a78ad. > > > > As Peter explained: > > [...] lockless_dereference() is _stronger_ than READ_ONCE(), not weaker. > > > > [...] > > > > Also, clue is in the name: 'dereference', you don't actually dereference > > the pointer here, only load it. > > > > My next patch breaks compile on this, because it assumes you want to > > deference and thus also need the struct type visible (which it isn't > > here), so revert it. > > > > Cc: Peter Zijlstra > > Signed-off-by: Johannes Berg > > Reviewed-by: Daniel Vetter > > And ack-by: me for merging through whatever tree this makes sense for. > -Daniel Initial testing says that the change below must precede the change to the definition of lockless_dereference(), so the two should go together. If my upcoming testing of the two changes together pans out, I will give you a Tested-by -- I am guessing that you don't want to wait until the next merge window for these changes. Thanx, Paul > > --- > > drivers/gpu/drm/drm_fb_helper.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > > index ce54e985d91b..0a06f9120b5a 100644 > > --- a/drivers/gpu/drm/drm_fb_helper.c > > +++ b/drivers/gpu/drm/drm_fb_helper.c > > @@ -464,7 +464,7 @@ static bool drm_fb_helper_is_bound(struct drm_fb_helper *fb_helper) > > > > /* Sometimes user space wants everything disabled, so don't steal the > > * display if there's a master. */ > > - if (lockless_dereference(dev->master)) > > + if (READ_ONCE(dev->master)) > > return false; > > > > drm_for_each_crtc(crtc, dev) { > > -- > > 2.8.1 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch >