Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1568779ybl; Thu, 30 Jan 2020 02:08:25 -0800 (PST) X-Google-Smtp-Source: APXvYqx1fKB0d1sCHhiuYpaBp6rIO0j1S+ilPu8nohkWmvFYNYMnV29SR7lYUWJpZWCmwY/EL2di X-Received: by 2002:a9d:53cb:: with SMTP id i11mr3021873oth.158.1580378905700; Thu, 30 Jan 2020 02:08:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580378905; cv=none; d=google.com; s=arc-20160816; b=VRlYVmX2z7gG+yYi1VwYd3tF7kake/oDoxM+71A4Z6OcWXBBYVZcgpwKkYP2NYBlJx bcZgOVMKu+wMLZEppiOjdRwjW5ON34SVyARCpNmjqMUt45lK7jNqJreMOMkcnPI027qM xnR3d4ADtSBjNNUpgRoKicxsjPGHE5v/pQUzcC4g0VexsCSG+bu/CSxPttjevgzyotSj A6BurajMqc/0EI0B9o3XfxJBR0waP5OoeumwoFQk53yJducHb3WChh+IJRJFCVIoSM1T LKA9FffjUa9+xVqfnpoiOTDSw409ntaiHnKpcThsrrQzpQTPcVkF1WV1/qntJ7PlDgSb mmgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=UMa1e7CIB/ICH+nou7ITTylFB/1HYBUx8QMl9FpjHbE=; b=FB1V65jnjqwBVF49aCgI09imv8woB3UBZje0PIv+o70PB+gu9FVb+kzy03f8RFoamt p1iHWIrsVSOef++T9ayNJCKrNs2MjGEXzJgAThDSUy9BXjDg7+zRQSA5vDCq1Ff34/0r s5hmjWa4wAR8CcK8hWF1Qh2uH1YTxDpdjd3eOI7dVsGhycT2XMgFOHgo1+0MNlrxjtRQ CJ3NVg69X69gHjyt157LNNB94Nv/UY4lltUuz49f5o0F6n4kOgQIxHC2Jl5gj6JQQ/FY yR8jiJ4JVn0//JqqJXD7xQKqoLwmXFQBGz2lQ59yEPiOWbNvqvWZfu7gq7eYWI7piCG7 31Gg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5si2821947otf.37.2020.01.30.02.08.13; Thu, 30 Jan 2020 02:08:25 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727084AbgA3KGQ (ORCPT + 99 others); Thu, 30 Jan 2020 05:06:16 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:36428 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbgA3KGQ (ORCPT ); Thu, 30 Jan 2020 05:06:16 -0500 Received: by mail-lf1-f67.google.com with SMTP id f24so1894458lfh.3; Thu, 30 Jan 2020 02:06:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UMa1e7CIB/ICH+nou7ITTylFB/1HYBUx8QMl9FpjHbE=; b=f4peSxZHZ4OjdRhuPvtSOmdIJ9UlrhodwItFng5/y5lcXf8D+/c3fEd0Fe+rCGPQux stkxhXnM/aEa38+rFK4xk+3xBv6KSKxzA+fwjQ8ipWBOiZEwmGYsWkh/pBsEIX4+p8yv 5ivGAmZRBv+6ElYBG2X6OhuofkCh/EePCoO7396gCAMZP8Zr8w9iu9kK6h+wDgByGQgs mwiEwOmF7U+EiGkgXai+QAunzx3KrxyUdFgXKSih/m18Wexw90zIr0+XHayCtWSA0nAX rJ2rg9RmUiff7avM+niecfiJgwX79JC5eCvRgcm7LTAqNtaFlklCveK4avAIlIVFWbwS S+jw== X-Gm-Message-State: APjAAAUqkctAXzcooU0Ip+Kt0pbda6HvKKwFocpsdWvpWY1NjMac0RJ+ tH2xyaRDdAeMhJjvHanQKXfSoNcL X-Received: by 2002:a19:4849:: with SMTP id v70mr2248063lfa.30.1580378774190; Thu, 30 Jan 2020 02:06:14 -0800 (PST) Received: from xi.terra (c-12aae455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.170.18]) by smtp.gmail.com with ESMTPSA id u23sm2517545lfg.89.2020.01.30.02.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jan 2020 02:06:13 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.92.3) (envelope-from ) id 1ix6iH-0000Ae-Dp; Thu, 30 Jan 2020 11:06:17 +0100 Date: Thu, 30 Jan 2020 11:06:17 +0100 From: Johan Hovold To: Davidlohr Bueso Cc: oneukum@suse.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH 7/8] usb, cdc-acm: optimize barrier usage for Rmw atomic bitops Message-ID: <20200130100617.GA8871@localhost> References: <20200129181545.25302-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200129181545.25302-1-dave@stgolabs.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 29, 2020 at 10:15:45AM -0800, Davidlohr Bueso wrote: > We can avoid the unnecessary barrier on non LL/SC architectures, > such as x86. Instead, use the smp_mb__after_atomic() call. > > Signed-off-by: Davidlohr Bueso Reviewed-by: Johan Hovold > --- > drivers/usb/class/cdc-acm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c > index 62f4fb9b362f..0bc4b558f387 100644 > --- a/drivers/usb/class/cdc-acm.c > +++ b/drivers/usb/class/cdc-acm.c > @@ -842,7 +842,7 @@ static void acm_tty_unthrottle(struct tty_struct *tty) > clear_bit(ACM_THROTTLED, &acm->flags); > > /* Matches the smp_mb__after_atomic() in acm_read_bulk_callback(). */ > - smp_mb(); > + smp_mb__after_atomic(); > > acm_submit_read_urbs(acm, GFP_KERNEL); > } We have another barrier in USB serial which can also be relaxed this way. I'll post a patch shortly. Johan