Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1695417
| From | Luca Abeni <luca.abeni@santannapisa.it> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC v5 2/9] sched/deadline: improve the tracking of active utilization |
| Date | 2017-07-25 08:50 +0200 |
| Message-ID | <u71Pj-7Qu-3@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <toh3P-72e-15@gated-at.bofh.it> <toxrX-279-11@gated-at.bofh.it> <toFfQ-7EU-9@gated-at.bofh.it> <u6GBc-2ba-5@gated-at.bofh.it> <u6Hxg-2M9-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, 24 Jul 2017 11:04:52 +0200
Peter Zijlstra <peterz@infradead.org> 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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [RFC v5 2/9] sched/deadline: improve the tracking of active utilization Luca Abeni <luca.abeni@santannapisa.it> - 2017-07-24 10:10 +0200
Re: [RFC v5 2/9] sched/deadline: improve the tracking of active utilization Peter Zijlstra <peterz@infradead.org> - 2017-07-24 11:10 +0200
Re: [RFC v5 2/9] sched/deadline: improve the tracking of active utilization Luca Abeni <luca.abeni@santannapisa.it> - 2017-07-25 08:50 +0200
csiph-web