From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932279AbcFNRww (ORCPT ); Tue, 14 Jun 2016 13:52:52 -0400 Received: from smtprelay0227.hostedemail.com ([216.40.44.227]:44624 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932121AbcFNRws (ORCPT ); Tue, 14 Jun 2016 13:52:48 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::,RULES_HIT:41:355:379:541:599:988:989:1183:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:1801:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3867:3871:3872:3874:4605:5007:6261:7875:7901:7903:10004:10400:10848:11026:11232:11658:11914:12114:12517:12519:13069:13255:13311:13357:13439:14659:14721:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: boy89_6f7fba710f147 X-Filterd-Recvd-Size: 1958 Date: Tue, 14 Jun 2016 13:52:45 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: LKML , Ingo Molnar , Thomas Gleixner , Clark Williams , Andrew Morton , Nick Piggin Subject: Re: [PATCH] sched: Do not release current rq lock on non contended double_lock_balance() Message-ID: <20160614135245.65448383@grimm.local.home> In-Reply-To: <20160614115820.GD30921@twins.programming.kicks-ass.net> References: <20160613123732.3a8ccc57@gandalf.local.home> <20160614115820.GD30921@twins.programming.kicks-ass.net> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > CPU 0 CPU 1 > > ----- ----- > > [ wake up ] > > spin_lock(cpu1_rq->lock); > > spin_lock(cpu1_rq->lock) > > double_lock_balance() > > [ release cpu1_rq->lock ] > > spin_lock(cpu1_rq->lock) > > [due to ticket, now acquires > > cpu1_rq->lock ] > > > > [goes to push task] > > double_lock_balance() > > [ release cpu1_rq->lock ] > > [ acquires lock ] > > spin_lock(cpu2_rq->lock) > > [ blocks as cpu2 is using it ] > > > > Also, its not entirely clear this scenario helps illustrate how your > change is better; because here the lock _is_ contended, so we'll fail > the trylock, no? Sorry, I should have been more specific that the double lock balance was grabbing cpu2_rq (another rq lock), where there was no contention. -- Steve