kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* where is __percpu_seg initialized?
@ 2016-04-23  7:24 =?gb18030?B?wuS62w==?=
  2016-04-23 14:02 ` Dave Tian
  0 siblings, 1 reply; 3+ messages in thread
From: =?gb18030?B?wuS62w==?= @ 2016-04-23  7:24 UTC (permalink / raw)
  To: kernelnewbies

Hi all:
I knew the kernel implement the per-cpu variable via __percpu_seg. For example on x86 architecture, it's defined as:


#ifdef CONFIG_X86_64
#define __percpu_seg		gs
#define __percpu_mov_op		movq
#else
#define __percpu_seg		fs
#define __percpu_mov_op		movl
#endif 
    
But I'm curious where __percpu_seg is initialized?? I fail to find the relative code. Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160423/2c2d99ff/attachment.html 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* where is __percpu_seg initialized?
  2016-04-23  7:24 where is __percpu_seg initialized? =?gb18030?B?wuS62w==?=
@ 2016-04-23 14:02 ` Dave Tian
  2018-03-28  3:06   ` =?gb18030?B?wuS62w==?=
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Tian @ 2016-04-23 14:02 UTC (permalink / raw)
  To: kernelnewbies

load_percpu_segment, which is called by switch_to_new_gdt in setup_per_cpu_areas.

-daveti


> On Apr 23, 2016, at 3:24 AM, ?? <losemyheaven@qq.com> wrote:
> 
> Hi all:
> I knew the kernel implement the per-cpu variable via __percpu_seg. For example on x86 architecture, it's defined as:
> 
> #ifdef CONFIG_X86_64
> #define __percpu_seg		gs
> #define __percpu_mov_op		movq
> #else
> #define __percpu_seg		fs
> #define __percpu_mov_op		movl
> #endif 
>     
> But I'm curious where __percpu_seg is initialized?? I fail to find the relative code. Thanks.
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

* where is __percpu_seg initialized?
  2016-04-23 14:02 ` Dave Tian
@ 2018-03-28  3:06   ` =?gb18030?B?wuS62w==?=
  0 siblings, 0 replies; 3+ messages in thread
From: =?gb18030?B?wuS62w==?= @ 2018-03-28  3:06 UTC (permalink / raw)
  To: kernelnewbies

setup_per_cpu_areas just prepare a per-cpu area for each
possible cpu, and it doesn't try to start up other possible cpu(s).


The address of  a per-cpu area corresponding to this cpu will be 
written to its per-cpu-area register , before starting up.


Starting up other non-boot cpu happens in start_secondary function.


Larry


------------------ Original ------------------
From:  "Dave Tian"<dave.jing.tian@gmail.com>;
Date:  Sat, Apr 23, 2016 10:02 PM
To:  "??"<losemyheaven@qq.com>;
Cc:  "kernelnewbies"<kernelnewbies@kernelnewbies.org>; 
Subject:  Re: where is __percpu_seg initialized?



load_percpu_segment, which is called by switch_to_new_gdt in setup_per_cpu_areas.

-daveti


> On Apr 23, 2016, at 3:24 AM, ?? <losemyheaven@qq.com> wrote:
> 
> Hi all:
> I knew the kernel implement the per-cpu variable via __percpu_seg. For example on x86 architecture, it's defined as:
> 
> #ifdef CONFIG_X86_64
> #define __percpu_seg		gs
> #define __percpu_mov_op		movq
> #else
> #define __percpu_seg		fs
> #define __percpu_mov_op		movl
> #endif 
>     
> But I'm curious where __percpu_seg is initialized?? I fail to find the relative code. Thanks.
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180328/af86be6a/attachment.html>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-28  3:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-23  7:24 where is __percpu_seg initialized? =?gb18030?B?wuS62w==?=
2016-04-23 14:02 ` Dave Tian
2018-03-28  3:06   ` =?gb18030?B?wuS62w==?=

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).