Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752986AbdGXJFK (ORCPT ); Mon, 24 Jul 2017 05:05:10 -0400 Received: from merlin.infradead.org ([205.233.59.134]:45406 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751539AbdGXJFE (ORCPT ); Mon, 24 Jul 2017 05:05:04 -0400 Date: Mon, 24 Jul 2017 11:04:52 +0200 From: Peter Zijlstra To: Luca Abeni Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli , Claudio Scordino , Steven Rostedt , Tommaso Cucinotta , Daniel Bristot de Oliveira , Joel Fernandes , Mathieu Poirier Subject: Re: [RFC v5 2/9] sched/deadline: improve the tracking of active utilization Message-ID: <20170724090452.d25zlcbobdegfmxt@hirez.programming.kicks-ass.net> References: <1490327582-4376-1-git-send-email-luca.abeni@santannapisa.it> <1490327582-4376-3-git-send-email-luca.abeni@santannapisa.it> <20170324132041.6fxayfe3id4af3n5@hirez.programming.kicks-ass.net> <20170324224715.4098dbfb@nowhere> <20170724100609.4ec38473@luca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170724100609.4ec38473@luca> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1411 Lines: 31 On Mon, Jul 24, 2017 at 10:06:09AM +0200, Luca Abeni wrote: > > Yes, grouping all the flags in a single field was my intention too... I > > planned to submit a patch to do this after merging the reclaiming > > patches... But maybe it is better to do this first :) > > I implemented this change, but before submitting the patch I have a > small question. > I implemented some helpers to access the various > {throttled,boosted,yielded,non_contending} flags. I have some > "dl_{throttled,boosted,...}()" inline functions for reading the values > of the flags, and some inline functions for setting / clearing the > flags. For these, I have two possibilities: > - using two separate "dl_set_{throttled,...}()" and > "dl_clear_{throttled,..}()" functions for each flag > - using one single "dl_set_{throttled,...}(dl, value)" function per > flag, in which the flag's value is specified. > > I have no preferences (with the first proposal, I introduce more inline > functions, but I think the functions can be made more efficient / > optimized). Which one of the two proposals is preferred? (or, there is > a third, better, idea that I overlooked?) - Use bitfields and let the compiler sort it out. - Use macros to generate all the inlines as per the first. Personally, because I'm lazy, I'd try the bitfield thing first and see what kind code that generates. If that's not too horrendous, keep it :-)