The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Jason Baron <jbaron@redhat.com>,
	mingo@elte.hu, peterz@infradead.org, hpa@zytor.com,
	tglx@linutronix.de, andi@firstfloor.org, roland@redhat.com,
	rth@redhat.com, masami.hiramatsu.pt@hitachi.com,
	fweisbec@gmail.com, avi@redhat.com, davem@davemloft.net,
	sam@ravnborg.org, ddaney@caviumnetworks.com,
	michael@ellerman.id.au, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] jump label: move jump table to r/w section
Date: Tue, 23 Nov 2010 19:27:03 -0500	[thread overview]
Message-ID: <20101124002703.GB29158@Krystal> (raw)
In-Reply-To: <1290557049.30543.417.camel@gandalf.stny.rr.com>

* Steven Rostedt (rostedt@goodmis.org) wrote:
> On Tue, 2010-11-23 at 18:55 -0500, Mathieu Desnoyers wrote:
> > * Jason Baron (jbaron@redhat.com) wrote:
> > > Since we writing the jump table it should be be in R/W kernel
> > > section. Move it to DATA_DATA
> > > 
> > > Signed-off-by: Jason Baron <jbaron@redhat.com>
> > > ---
> > >  include/asm-generic/vmlinux.lds.h |   14 ++++----------
> > >  1 files changed, 4 insertions(+), 10 deletions(-)
> > > 
> > > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> > > index bd69d79..9ca894d 100644
> > > --- a/include/asm-generic/vmlinux.lds.h
> > > +++ b/include/asm-generic/vmlinux.lds.h
> > > @@ -161,6 +161,10 @@
> > >  	VMLINUX_SYMBOL(__start___tracepoints) = .;			\
> > >  	*(__tracepoints)						\
> > >  	VMLINUX_SYMBOL(__stop___tracepoints) = .;			\
> > > +	. = ALIGN(8);							\
> > 
> > Past churn with various architectures and compiler with tracepoints,
> > markers and immediate values lead me to hint at the following approach
> > for jump label structure alignment:
> > 
> > . = ALIGN(32);
> > 
> > and to modify jump_label.h to have:
> > 
> > struct jump_entry {
> > 	jump_label_t code;
> > 	jump_label_t target;
> > 	jump_label_t key;
> > } __attribute__((aligned(32)));
> > 
> > Otherwise, the compiler is free to choose on which value it prefers to
> > align the jump_entry structures, which might not match the address at
> > which the linker scripts puts the beginning of the jump table.
> > 
> > In this case, given that we put put the jump label table after the
> > tracepoint table, we should be already aligned on 32 bytes. But I would
> > recommend to put the . = ALIGN(32) in the linker script anyway, just for
> > documentation purpose (and it should not add any padding in this case).
> > 
> > This is not a problem introduced by this patch, it also applies to the
> > current jump label code.
> 
> Agreed, but this change could probably wait for 2.6.38.
> 
> Also, if this is done, then an it should be wrapped in a
> #ifdef CONFIG_JUMP_LABEL and only inserted if we are using jump labels.
> Otherwise we may add a 32 byte hole for nothing. I know it's small, but
> why waste it if you don't need to.

The lack of proper alignment did cause nasty hard-to-identify/reproduce
regressions based on the compiler used, target platform and data layout.
It's up to you, but I'd be much more comfortable merging this in 2.6.37.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com

  reply	other threads:[~2010-11-24  1:07 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 21:27 [PATCH 0/3] jump label: updates for 2.6.37 Jason Baron
2010-11-23 21:27 ` [PATCH 1/3] jump label: add enabled/disabled state to jump label key entries Jason Baron
2010-11-23 23:43   ` Mathieu Desnoyers
2010-11-24  0:00     ` Steven Rostedt
2010-11-24  0:24       ` Mathieu Desnoyers
2010-11-24 18:24         ` Jason Baron
2010-11-24 18:39           ` Peter Zijlstra
2010-11-24 19:07             ` Jason Baron
2010-11-24  8:20   ` Peter Zijlstra
2010-11-24 14:54     ` Jason Baron
2010-11-24 15:11       ` Peter Zijlstra
2010-11-24 15:19         ` Jason Baron
2010-11-24 15:24           ` Peter Zijlstra
2010-11-24 15:42             ` Jason Baron
2010-11-24 15:53               ` Steven Rostedt
2010-11-25  2:39                 ` Michael Ellerman
2010-11-25  6:52                   ` Peter Zijlstra
2010-11-25 13:14                     ` Mathieu Desnoyers
2010-11-25 13:42                     ` Michael Ellerman
2010-11-25 21:26                       ` Benjamin Herrenschmidt
2010-11-24 16:56               ` David Daney
2010-11-24 15:15       ` Steven Rostedt
2010-11-24 15:21         ` Jason Baron
2010-11-24 15:25           ` Peter Zijlstra
2010-11-24 15:57           ` Steven Rostedt
2010-11-24 19:18             ` Jason Baron
2010-11-24 15:21         ` Peter Zijlstra
2010-11-23 21:27 ` [PATCH 2/3] jump label: move jump table to r/w section Jason Baron
2010-11-23 23:55   ` Mathieu Desnoyers
2010-11-24  0:04     ` Steven Rostedt
2010-11-24  0:27       ` Mathieu Desnoyers [this message]
2010-11-24  0:35         ` Steven Rostedt
2010-11-24  2:18     ` Steven Rostedt
2010-11-24  2:59       ` Steven Rostedt
2010-11-23 21:27 ` [PATCH 3/3] jump label: add docs Jason Baron
2010-11-23 21:36 ` [PATCH 0/3] jump label: updates for 2.6.37 H. Peter Anvin
2010-11-23 23:11   ` Steven Rostedt
2010-11-23 23:32     ` H. Peter Anvin
2010-11-24  0:10       ` Steven Rostedt
2010-11-24  0:36         ` Steven Rostedt
2010-11-24  0:37           ` H. Peter Anvin
2010-11-23 21:42 ` Steven Rostedt
2010-11-23 21:56   ` Jason Baron
2010-11-23 23:10     ` Steven Rostedt
2010-11-24  8:29       ` Peter Zijlstra
2010-11-24  9:21         ` Andi Kleen
2010-11-24 12:47         ` Steven Rostedt
2010-11-24 13:49           ` Steven Rostedt

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=20101124002703.GB29158@Krystal \
    --to=mathieu.desnoyers@polymtl.ca \
    --cc=andi@firstfloor.org \
    --cc=avi@redhat.com \
    --cc=davem@davemloft.net \
    --cc=ddaney@caviumnetworks.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=michael@ellerman.id.au \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=roland@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=rth@redhat.com \
    --cc=sam@ravnborg.org \
    --cc=tglx@linutronix.de \
    /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