From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751845AbdCBUqi (ORCPT ); Thu, 2 Mar 2017 15:46:38 -0500 Received: from mail.kernel.org ([198.145.29.136]:58378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751467AbdCBUqe (ORCPT ); Thu, 2 Mar 2017 15:46:34 -0500 Date: Thu, 2 Mar 2017 15:38:41 -0500 From: Steven Rostedt To: Peter Zijlstra Cc: Ingo Molnar , LKML , Andrew Morton Subject: Re: [PATCH] sched/rt: Document why has_pushable_tasks() isn't called with a runqueue lock Message-ID: <20170302153841.4a30097e@gandalf.local.home> In-Reply-To: <20170301083701.GX6515@twins.programming.kicks-ass.net> References: <20170228164856.3d2e81bd@gandalf.local.home> <20170301083701.GX6515@twins.programming.kicks-ass.net> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; 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 On Wed, 1 Mar 2017 09:37:01 +0100 Peter Zijlstra wrote: > On Tue, Feb 28, 2017 at 04:48:56PM -0500, Steven Rostedt wrote: > > > + /* > > + * Normally, has_pushable_tasks() would be performed within the > > + * runqueue lock being held. But if it was not set when entering > > "not set" what? I'm having trouble parsing this. I always forgot that with documentation, pronouns should be avoided. "But if has_pushable_tasks is false when entering" > > > + * this hard interrupt handler function, then to have it set would ", then to have it set to true would" > > + * require a wake up. A wake up of an RT task will either cause a > > + * schedule if the woken task is higher priority than the running > > + * task, or it would try to do a push from the CPU doing the wake > > + * up. Grabbing the runqueue lock in such a case would more likely > > + * just cause unnecessary contention. > > + */ > > if (has_pushable_tasks(rq)) { > > raw_spin_lock(&rq->lock); > > push_rt_task(rq);