Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752153AbcDPXBq (ORCPT ); Sat, 16 Apr 2016 19:01:46 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:36332 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751893AbcDPXBn (ORCPT ); Sat, 16 Apr 2016 19:01:43 -0400 Date: Sat, 16 Apr 2016 19:01:42 -0400 (EDT) Message-Id: <20160416.190142.1728042848852620447.davem@davemloft.net> To: santosh.shilimkar@oracle.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net][PATCH v2 2/2] RDS: Fix the atomicity for congestion map update From: David Miller In-Reply-To: <1460655807-26236-3-git-send-email-santosh.shilimkar@oracle.com> References: <1460655807-26236-1-git-send-email-santosh.shilimkar@oracle.com> <1460655807-26236-3-git-send-email-santosh.shilimkar@oracle.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 16 Apr 2016 16:01:43 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 729 Lines: 18 From: Santosh Shilimkar Date: Thu, 14 Apr 2016 10:43:27 -0700 > Two different threads with different rds sockets may be in > rds_recv_rcvbuf_delta() via receive path. If their ports > both map to the same word in the congestion map, then > using non-atomic ops to update it could cause the map to > be incorrect. Lets use atomics to avoid such an issue. > > Full credit to Wengang for > finding the issue, analysing it and also pointing out > to offending code with spin lock based fix. > > Reviewed-by: Leon Romanovsky > Signed-off-by: Wengang Wang > Signed-off-by: Santosh Shilimkar Applied.