Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753203AbbEFPcj (ORCPT ); Wed, 6 May 2015 11:32:39 -0400 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:60306 "EHLO e28smtp03.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751459AbbEFPcf (ORCPT ); Wed, 6 May 2015 11:32:35 -0400 Message-ID: <554A351D.8060700@linux.vnet.ibm.com> Date: Wed, 06 May 2015 21:07:01 +0530 From: Raghavendra K T Organization: IBM User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Tahsin Erdogan CC: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, peterz@infradead.org, Waiman.Long@hp.com, borntraeger@de.ibm.com, oleg@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/spinlocks: Fix regression in spinlock contention detection References: <1430799331-20445-1-git-send-email-tahsin@google.com> In-Reply-To: <1430799331-20445-1-git-send-email-tahsin@google.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15050615-0009-0000-0000-0000053FF822 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1012 Lines: 25 On 05/05/2015 09:45 AM, Tahsin Erdogan wrote: > A spinlock is regarded as contended when there is at least one waiter. > Currently, the code that checks whether there are any waiters rely on > tail value being greater than head. However, this is not true if tail > reaches the max value and wraps back to zero, so arch_spin_is_contended() > incorrectly returns 0 (not contended) when tail is smaller than head. > > The original code (before regression) handled this case by casting the > (tail - head) to an unsigned value. This change simply restores that > behavior. > > Fixes: d6abfdb20223 ("x86/spinlocks/paravirt: Fix memory corruption on > unlock") > Signed-off-by: Tahsin Erdogan > --- Tahsin, Perhaps we need to CC stable (3.19) too..? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/