Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754868AbdIGKK3 (ORCPT ); Thu, 7 Sep 2017 06:10:29 -0400 Received: from mail.sssup.it ([193.205.80.98]:55497 "EHLO mail.santannapisa.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754550AbdIGKKZ (ORCPT ); Thu, 7 Sep 2017 06:10:25 -0400 From: luca abeni To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Ingo Molnar , Juri Lelli , Steven Rostedt , Daniel Bristot de Oliveira , Mathieu Poirier , luca abeni Subject: [PATCH 4/4] sched/deadline: use C bitfields for the state flags Date: Thu, 7 Sep 2017 12:09:31 +0200 Message-Id: <1504778971-13573-5-git-send-email-luca.abeni@santannapisa.it> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504778971-13573-1-git-send-email-luca.abeni@santannapisa.it> References: <1504778971-13573-1-git-send-email-luca.abeni@santannapisa.it> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1026 Lines: 32 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 --- 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 -- 2.7.4