mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Richard Kennedy <richard@rsk.demon.co.uk>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	lkml <linux-kernel@vger.kernel.org>,
	Dipankar Sarma <dipankar@in.ibm.com>
Subject: Re: [PATCH] RCU: remove alignment padding from rcu_data on 64 bit builds
Date: Fri, 06 May 2011 08:20:45 +0200	[thread overview]
Message-ID: <1304662845.3131.23.camel@edumazet-laptop> (raw)
In-Reply-To: <1304610604.1984.6.camel@castor.rsk>

Le jeudi 05 mai 2011 à 16:50 +0100, Richard Kennedy a écrit :
> Reorder rcu_data to remove 8 bytes of alignment padding on 64 bit builds
> so saving a total of 16 bytes per cpu, (rcu_sched_data & rcu_bh_data).
>     
> When CONFIG_NO_HZ is set, it shrinks the size of this structure from 264
> to 256 bytes allowing it to fit into one fewer cache lines.
> 
> Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
> ---
> 
> patch against v2.6.39-rc6
> compiled & tested on x86_64
> 
> I've been running with this patch for some weeks and have not seen any
> issues.
> 
> regards
> Richard
> 
> 
> 
> diff --git a/kernel/rcutree.h b/kernel/rcutree.h
> index e8f057e..fcced0f 100644
> --- a/kernel/rcutree.h
> +++ b/kernel/rcutree.h
> @@ -176,6 +176,9 @@ struct rcu_data {
>  	bool		qs_pending;	/* Core waits for quiesc state. */
>  	bool		beenonline;	/* CPU online at least once. */
>  	bool		preemptable;	/* Preemptable RCU? */
> +
> +	int cpu;
> +
>  	struct rcu_node *mynode;	/* This CPU's leaf of hierarchy */
>  	unsigned long grpmask;		/* Mask to apply to leaf qsmask. */
>  
> @@ -238,8 +241,6 @@ struct rcu_data {
>  	unsigned long n_rp_gp_started;
>  	unsigned long n_rp_need_fqs;
>  	unsigned long n_rp_need_nothing;
> -
> -	int cpu;
>  };
>  

We could shrink this structure more, converting some 64bit fields to
32bit ones.

Rationale is the algo is working well on 32bit arches, no need to use
64bit fields.

candidates : completed, gpnum, passed_quiesc_completed, qlen,
qlen_last_fqs_check, blimit.

Counters might be converted too.




  reply	other threads:[~2011-05-06  6:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05 15:50 Richard Kennedy
2011-05-06  6:20 ` Eric Dumazet [this message]
2011-05-06 12:13   ` Richard Kennedy
2011-05-08 14:53     ` Paul E. McKenney

Reply instructions:

You may reply publicly 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=1304662845.3131.23.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=richard@rsk.demon.co.uk \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®