From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754799AbdIHIY2 (ORCPT ); Fri, 8 Sep 2017 04:24:28 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:43842 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751599AbdIHIY0 (ORCPT ); Fri, 8 Sep 2017 04:24:26 -0400 X-Google-Smtp-Source: AOwi7QBwEHNHEUv/JuD93OGrvura0MV8PQq3er8axKpZ0Xt4EOvYfYFg11zN6Wo4GAb5auzfre7pfw== Subject: Re: [PATCH 4/4] sched/deadline: use C bitfields for the state flags To: luca abeni , linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Ingo Molnar , Juri Lelli , Steven Rostedt , Mathieu Poirier References: <1504778971-13573-1-git-send-email-luca.abeni@santannapisa.it> <1504778971-13573-5-git-send-email-luca.abeni@santannapisa.it> From: Daniel Bristot de Oliveira Message-ID: <2abbd6e5-1c2e-0577-1894-e1282decfca0@redhat.com> Date: Fri, 8 Sep 2017 10:24:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1504778971-13573-5-git-send-email-luca.abeni@santannapisa.it> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/07/2017 12:09 PM, luca abeni wrote: > Ask the compiler to use a single bit for storing true / false values, > instead of wasting the size of a whole int value. > Tested with gcc 5.4.0 on x86_64, and the compiler produces the expected > Assembly (similar to the Assembly code generated when explicitly accessing > the bits with bitmasks, "&" and "|"). > > Signed-off-by: luca abeni Reviewed-by: Daniel Bristot de Oliveira -- Daniel > --- > include/linux/sched.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 68b3833..e03cc69 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -472,10 +472,10 @@ struct sched_dl_entity { > * conditions between the inactive timer handler and the wakeup > * code. > */ > - int dl_throttled; > - int dl_boosted; > - int dl_yielded; > - int dl_non_contending; > + int dl_throttled : 1; > + int dl_boosted : 1; > + int dl_yielded : 1; > + int dl_non_contending : 1; > > /* > * Bandwidth enforcement timer. Each -deadline task has its >