Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750867AbdGYGlS (ORCPT ); Tue, 25 Jul 2017 02:41:18 -0400 Received: from mail.santannapisa.it ([193.205.80.98]:63178 "EHLO mail.santannapisa.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750745AbdGYGlR (ORCPT ); Tue, 25 Jul 2017 02:41:17 -0400 Date: Tue, 25 Jul 2017 08:41:10 +0200 From: Luca Abeni To: Peter Zijlstra 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: <20170725084110.62ac2e73@luca> In-Reply-To: <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> <20170724090452.d25zlcbobdegfmxt@hirez.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 Content-Length: 1825 Lines: 43 On Mon, 24 Jul 2017 11:04:52 +0200 Peter Zijlstra wrote: > 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 :-) Thanks for the suggestions; I'll test the C bitfields and I'll see how the assembly generated by gcc compares with the inline functions (I did not propose this idea originally because I got the impression that people tend not to trust gcc) Thanks, Luca