From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752786AbcIAGtD (ORCPT ); Thu, 1 Sep 2016 02:49:03 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:36812 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751340AbcIAGtC (ORCPT ); Thu, 1 Sep 2016 02:49:02 -0400 Subject: Re: [RFC][PATCH] Fix a race between rwsem and the scheduler To: Benjamin Herrenschmidt , Peter Zijlstra References: <4050f2ce-1aee-d2aa-39e3-36e995b56252@gmail.com> <20160830121937.GQ10138@twins.programming.kicks-ass.net> <20160830130426.GA17795@redhat.com> <20160830141321.GB2794@worktop> <20160830165746.GA29218@redhat.com> <20160830183416.GV10138@twins.programming.kicks-ass.net> <1472592498.2388.40.camel@kernel.crashing.org> <20160831133104.GD10153@twins.programming.kicks-ass.net> <1472680030.2388.95.camel@kernel.crashing.org> Cc: Oleg Nesterov , LKML , Nicholas Piggin From: Balbir Singh Message-ID: Date: Thu, 1 Sep 2016 16:49:12 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1472680030.2388.95.camel@kernel.crashing.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/09/16 07:47, Benjamin Herrenschmidt wrote: > On Wed, 2016-08-31 at 15:31 +0200, Peter Zijlstra wrote: >> On Wed, Aug 31, 2016 at 07:28:18AM +1000, Benjamin Herrenschmidt >> wrote: >> >>> >>> On powerpc we have a sync deep in _switch to achieve that. >> >> OK, for giggles, could you (or Balbir) check what happens if you take >> that sync out? >> >> There should be enough serialization in the generic code to cover the >> case that code mentions. >> >> ARM64 has a stronger barrier in its context switch code, but that's >> because they need to sync against external agents (like their TLB and >> cache) and no amount of generic locking is going to cover that. > > The problem is no amount of testing can tell you it works for sure :-) > > I would be nervous not having a real full sync in _switch. All we have > along the scheduler path is lwsync's and our isync based load construct > for spin_lock, I'm not sure what other assumptions we have around that > sync in there... > I would agree, I am not sure of the assumptions either. Balbir Singh.