From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932403AbcBAWSK (ORCPT ); Mon, 1 Feb 2016 17:18:10 -0500 Received: from casper.infradead.org ([85.118.1.10]:55994 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753773AbcBAWSF (ORCPT ); Mon, 1 Feb 2016 17:18:05 -0500 Date: Mon, 1 Feb 2016 23:18:01 +0100 From: Peter Zijlstra To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Thomas Gleixner , Juri Lelli , Clark Williams , Andrew Morton Subject: Re: [RFC][PATCH 4/4] sched: Add debugfs/sched/deadline_bw file to show current bandwidths Message-ID: <20160201221801.GA6357@twins.programming.kicks-ass.net> References: <20160201202624.079532484@goodmis.org> <20160201202742.317361821@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160201202742.317361821@goodmis.org> 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 Mon, Feb 01, 2016 at 03:26:28PM -0500, Steven Rostedt wrote: > +static void *dl_next(struct seq_file *m, void *v, loff_t *pos) > +{ > + long cpu = (long)v; > + > + /* to keep from returning zero, v is always cpu + 1 */ > + cpu--; > + cpu = cpumask_next(cpu, cpu_possible_mask); > + > + (*pos)++; > + > + if (cpu >= num_possible_cpus()) And that wants to be: nr_cpu_ids, imagine the bitmap having holes in. > + cpu = 0; > + else > + cpu++; > + > + return (void *)cpu; > +}