Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* Check for preemption only when returning from interrupt ?
       [not found] <55684262-1dab-503a-eb4a-f030b6fcc57e@gmail.com>
@ 2020-05-20  9:38 ` Taeung Song
  0 siblings, 0 replies; only message in thread
From: Taeung Song @ 2020-05-20  9:38 UTC (permalink / raw)
  To: kernelnewbies

Hi,

After reading arch/x86/entry/entry_64.S
I think preemption is checked
only when returning from interrupt (not exception like syscall)

Is is right ? (based on x86)

All scenario of checking for preemption in my opinion:
(1) check kernel preemption after interrupt
https://github.com/torvalds/linux/blob/master/arch/x86/entry/entry_64.S#L672

(2) check user preemption after interrupt
https://github.com/torvalds/linux/blob/master/arch/x86/entry/entry_64.S#L620
prepare_exit_to_usermode()
        -> exit_to_usermode_loop()
             -> if (cached_flags & _TIF_NEED_RESCHED)
                       schedule();

Thanks,
Taeung

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <55684262-1dab-503a-eb4a-f030b6fcc57e@gmail.com>
2020-05-20  9:38 ` Check for preemption only when returning from interrupt ? Taeung Song

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

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

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


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