[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v4 04/16] generic-sections: add section core helpers
- To: Nicholas Piggin <npiggin@xxxxxxxxx>
- From: "Luis R. Rodriguez" <mcgrof@xxxxxxxxxx>
- Date: Thu, 25 Aug 2016 23:38:44 -0700
- Cc: gnomes@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, realmz6@xxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, benh@xxxxxxxxxxxxxxxxxxx, ming.lei@xxxxxxxxxxxxx, heiko.carstens@xxxxxxxxxx, linux@xxxxxxxxxxxxxxxxxx, platform-driver-x86@xxxxxxxxxxxxxxx, James.Bottomley@xxxxxxxxxxxxxxxxxxxxx, jcmvbkbc@xxxxxxxxx, paulus@xxxxxxxxx, hpa@xxxxxxxxx, masami.hiramatsu.pt@xxxxxxxxxxx, mchehab@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, markus.heiser@xxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, msalter@xxxxxxxxxx, davem@xxxxxxxxxxxxx, mpe@xxxxxxxxxxxxxx, x86@xxxxxxxxxx, anil.s.keshavamurthy@xxxxxxxxx, fontana@xxxxxxxxxxxxxxx, mingo@xxxxxxxxxx, catalin.marinas@xxxxxxx, dvhart@xxxxxxxxxxxxx, dwmw2@xxxxxxxxxxxxx, mhiramat@xxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, rusty@xxxxxxxxxxxxxxx, keescook@xxxxxxxxxxxx, arnd@xxxxxxxx, linux-kbuild@xxxxxxxxxxxxxxx, jani.nikula@xxxxxxxxx, will.deacon@xxxxxxx, pali.rohar@xxxxxxxxx, rostedt@xxxxxxxxxxx, acme@xxxxxxxxxx, jbaron@xxxxxxxxxx, ananth@xxxxxxxxxxxxxxxxxx, bp@xxxxxxxxx, jpoimboe@xxxxxxxxxx, linux@xxxxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, andriy.shevchenko@xxxxxxxxxxxxxxx, mcb30@xxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, alan@xxxxxxxxxxxxxxx, jgross@xxxxxxxx, chris@xxxxxxxxxx, pebolle@xxxxxxxxxx, tony.luck@xxxxxxxxx, ananth@xxxxxxxxxx, paul.gortmaker@xxxxxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, gregkh@xxxxxxxxxxxxxxxxxxx, luto@xxxxxxxxxxxxxx, ak@xxxxxxxxxxxxxxx, mmarek@xxxxxxxx, david.vrabel@xxxxxxxxxx, jolsa@xxxxxxxxxx, jkosina@xxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, torvalds@xxxxxxxxxxxxxxxxxxxx, korea.drzix@xxxxxxxxx
- Delivery-date: Fri, 26 Aug 2016 06:39:14 +0000
- List-id: Xen developer discussion <xen-devel.lists.xen.org>
On Aug 25, 2016 8:00 PM, "Nicholas Piggin" <npiggin@xxxxxxxxx> wrote:
>
> On Thu, 25 Aug 2016 19:52:39 +0200
> "Luis R. Rodriguez" <mcgrof@xxxxxxxxxx> wrote:
>
> > On Thu, Aug 25, 2016 at 04:51:21PM +1000, Nicholas Piggin wrote:
> > > On Thu, 25 Aug 2016 08:05:40 +0200
> > > "Luis R. Rodriguez" <mcgrof@xxxxxxxxxx> wrote:
> > > > > Oh, that makes more sense. The SECTION stuff and custom sections was
> > > > > confusing me. I would prefer just to drop all the LINUX_SECTION naming
> > > > > and make it match the functionality you're using. For example:
> > > > >
> > > > > +DEFINE_LINKTABLE(struct jump_entry, __jump_table);
> > > > > +
> > > > > /* mutex to protect coming/going of the the jump_label table */
> > > > > static DEFINE_MUTEX(jump_label_mutex);
> > > > >
> > > > > @@ -274,8 +277,6 @@ static void __jump_label_update(struct static_key *key,
> > > > >
> > > > > void __init jump_label_init(void)
> > > > > {
> > > > > - struct jump_entry *iter_start = __start___jump_table;
> > > > > - struct jump_entry *iter_stop = __stop___jump_table;
> > > > > struct static_key *key = NULL;
> > > > > struct jump_entry *iter;
> > > > >
> > > > > @@ -292,9 +293,10 @@ void __init jump_label_init(void)
> > > > > return;
> > > > >
> > > > > jump_label_lock();
> > > > > - jump_label_sort_entries(iter_start, iter_stop);
> > > > > + jump_label_sort_entries(LINUX_SECTION_START(__jump_table),
> > > > > + LINUX_SECTION_END(__jump_table));
> > > > >
> > > > > Now I think this is a fine abstraction to have.
> > > >
> > > > OK will keep this one.
> > > >
> > > > > I think it would look
> > > > > even cleaner if you had:
> > > > >
> > > > > LINKTABLE_START(__jump_table)
> > > > > LINKTABLE_END(__jump_table)
> > > > >
> > > > > Then do we need to even have the LINUX_SECTION middle man at all?
> > > >
> > > > Ah, thing is we use this for both linktables and section ranges.
> > > > Or do we want macros for both that do the same thing ?
> > >
> > > I think it would make the code using it more readable.
> >
> > Alrighty... so:
> >
> > LINKTABLE_START()
> > LINKTABLE_END()
> >
> > SECTION_RANGE_START()
> > SECTION_RANGE_END()
> >
> > And these macros do the exact same thing. Ie, nothing shared. Right?
>
> Yeah I think so. Internally they would probably be aliased to the
> same common definition (unless you had some type check or something),
> but user would know about such details.
What name should we use for such common macro definition ?
Luis
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|