LKML Archive on lore.kernel.org
 help / color / Atom feed
From: luca abeni <luca.abeni@santannapisa.it>
To: linux-kernel@vger.kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Juri Lelli <juri.lelli@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	luca abeni <luca.abeni@santannapisa.it>
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> (raw)
In-Reply-To: <1504778971-13573-1-git-send-email-luca.abeni@santannapisa.it>

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 <luca.abeni@santannapisa.it>
---
 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

  parent reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 10:09 [PATCH 0/4] SCHED_DEADLINE fixes and cleanups luca abeni
2017-09-07 10:09 ` [PATCH 1/4] sched/sched.h: remove duplicate prototype of __dl_clear_params() luca abeni
2017-09-08  8:33   ` Daniel Bristot de Oliveira
2017-10-10 10:55   ` [tip:sched/core] sched/headers: Remove " tip-bot for luca abeni
2017-09-07 10:09 ` [PATCH 2/4] sched/deadline: fix switching to -deadline luca abeni
2017-10-10 10:56   ` [tip:sched/core] sched/deadline: Fix " tip-bot for Luca Abeni
2017-09-07 10:09 ` [PATCH 3/4] sched/deadline: rename __dl_clear() to __dl_sub() luca abeni
2017-09-08  8:26   ` Daniel Bristot de Oliveira
2017-10-10 10:56   ` [tip:sched/core] sched/deadline: Rename " tip-bot for Peter Zijlstra
2017-09-07 10:09 ` luca abeni [this message]
2017-09-08  8:24   ` [PATCH 4/4] sched/deadline: use C bitfields for the state flags Daniel Bristot de Oliveira
2017-10-10 10:57   ` [tip:sched/core] sched/deadline: Use " tip-bot for luca abeni
2017-10-02  8:18 ` [PATCH 0/4] SCHED_DEADLINE fixes and cleanups Peter Zijlstra

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1504778971-13573-5-git-send-email-luca.abeni@santannapisa.it \
    --to=luca.abeni@santannapisa.it \
    --cc=bristot@redhat.com \
    --cc=juri.lelli@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git