linux-smp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dawei Li <daweilics@gmail.com>
To: linux-newbie@vger.kernel.org, kernel-janitors@vger.kernel.org,
	 linux-smp@vger.kernel.org
Subject: when/how is the schedule() function actually called?
Date: Thu, 7 Dec 2023 13:59:55 +0800	[thread overview]
Message-ID: <CAG5MgCpdTt5ZpSVg==YN92zr+0_ug+3sUOAwdjXJEu0a1BkWFg@mail.gmail.com> (raw)

Greetings!

I am reading several resources regarding the linux kernel scheduling
in kernel 2.6.34.
There seems to be the periodic scheduler (tick_periodic()), which
invokes the scheduler_tick() function, then the entity_tick()
function, and then the resched_task() function. However, eventually,
the resched_task() function doesn't invoke the schedule() function; it
only invokes the set_tsk_need_resched() function. So, it is only
setting the need_resched flag.
My question is, when/how is the schedule() function actually called?
Also, I notice that at many locations in the code, when there is the
need to do a scheduling, the code is just setting the need_resched
flag. Same question: when/how is the schedule() function actually
called?

Not sure if this list is still active. Appreciate any response.
Thanks!

                 reply	other threads:[~2023-12-07  6:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAG5MgCpdTt5ZpSVg==YN92zr+0_ug+3sUOAwdjXJEu0a1BkWFg@mail.gmail.com' \
    --to=daweilics@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-newbie@vger.kernel.org \
    --cc=linux-smp@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).