From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751867AbbCTKZ5 (ORCPT ); Fri, 20 Mar 2015 06:25:57 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:48342 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751620AbbCTKZz (ORCPT ); Fri, 20 Mar 2015 06:25:55 -0400 Date: Fri, 20 Mar 2015 11:25:42 +0100 From: Peter Zijlstra To: Steven Rostedt Cc: LKML , Ingo Molnar , Thomas Gleixner , Clark Williams , linux-rt-users , Mike Galbraith , "Paul E. McKenney" , =?iso-8859-1?Q?J=F6rn?= Engel Subject: Re: [PATCH v5] sched/rt: Use IPI to trigger RT task push migration instead of pulling Message-ID: <20150320102542.GY23123@twins.programming.kicks-ass.net> References: <20150318144946.2f3cc982@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150318144946.2f3cc982@gandalf.local.home> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 18, 2015 at 02:49:46PM -0400, Steven Rostedt wrote: > +static int find_next_push_cpu(struct rq *rq) > +{ > + struct rq *next_rq; > + int cpu; > + > + while (1) { We typically tend to write: for (;;), instead, however would a do { } while () loop not make more sense here? do { cpu = rto_next_cpu(rq); if (cpu >= nr_cpu_ids) break; next_rq = cpu_rq(cpu); } while (next_rq->rt.highest_prio.next >= rq->rt.highest_prio.curr); > + return cpu; > +}