Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932249AbdIHDHf convert rfc822-to-8bit (ORCPT ); Thu, 7 Sep 2017 23:07:35 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:41704 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753867AbdIHDHe (ORCPT ); Thu, 7 Sep 2017 23:07:34 -0400 Date: Thu, 07 Sep 2017 20:07:33 -0700 (PDT) Message-Id: <20170907.200733.1562967291105061977.davem@davemloft.net> To: Haakon.Bugge@oracle.com Cc: santosh.shilimkar@oracle.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org, knut.omang@oracle.com Subject: Re: [PATCH net v2] rds: Fix incorrect statistics counting From: David Miller In-Reply-To: <20170906163551.20387-1-Haakon.Bugge@oracle.com> References: <20170906163551.20387-1-Haakon.Bugge@oracle.com> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 07 Sep 2017 20:07:34 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 641 Lines: 19 From: H?kon Bugge Date: Wed, 6 Sep 2017 18:35:51 +0200 > In rds_send_xmit() there is logic to batch the sends. However, if > another thread has acquired the lock and has incremented the send_gen, > it is considered a race and we yield. The code incrementing the > s_send_lock_queue_raced statistics counter did not count this event > correctly. > > This commit counts the race condition correctly. > > Changes from v1: > - Removed check for *someone_on_xmit()* > - Fixed incorrect indentation > > Signed-off-by: H?kon Bugge > Reviewed-by: Knut Omang Applied.