Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752776AbcDZRpa (ORCPT ); Tue, 26 Apr 2016 13:45:30 -0400 Received: from mail-yw0-f171.google.com ([209.85.161.171]:36112 "EHLO mail-yw0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752272AbcDZRpT (ORCPT ); Tue, 26 Apr 2016 13:45:19 -0400 Date: Tue, 26 Apr 2016 13:45:13 -0400 From: Tejun Heo To: Peter Hurley Cc: Roman Pen , Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, David Howells Subject: Re: [PATCH 1/1] [RFC] workqueue: fix ghost PENDING flag while doing MQ IO Message-ID: <20160426174513.GM7822@mtj.duckdns.org> References: <1461597771-25352-1-git-send-email-roman.penyaev@profitbricks.com> <20160425154847.GZ7822@mtj.duckdns.org> <571EC2B9.6000802@hurleysoftware.com> <20160426151507.GK7822@mtj.duckdns.org> <571FA51F.2040702@hurleysoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <571FA51F.2040702@hurleysoftware.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 969 Lines: 30 Hello, Peter. On Tue, Apr 26, 2016 at 10:27:59AM -0700, Peter Hurley wrote: > > It's unlikely to make any measureable difference. Is xchg() actually > > cheaper than store + rmb? > > store + mfence (full barrier), yes. Roughly 2x faster. > > https://lkml.org/lkml/2015/11/2/607 Ah, didn't know that. Thanks for the pointer. > > I'm not necessarily against making all clearings of > > PENDING to be followed by a rmb or use xhcg. Reasons 2-4 are pretty > > weak tho. > > I agree 2 and 3 are not the best reasons. > Actually, it looks that I'm in the minority anyway, and that style-wise, > naked barrier is preferred. As long as what's happening is clearly documented, I think either is fine. I'm gonna go with Roman's mb patch for -stable fix but think it'd be nice to have a separate patch to consolidate the paths which clear PENDING and make them use xchg. If you can spin up a patch for that, I'd be happy to apply it to wq/for-3.7. Thanks. -- tejun