kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: CVS <cvs268@gmail.com>
To: William Tambe <tambewilliam@gmail.com>
Cc: Kernel Newbies <kernelnewbies@kernelnewbies.org>
Subject: Re: Regarding Linux kernel SMP and task switching CPU
Date: Sun, 12 Jul 2020 22:30:32 +0530	[thread overview]
Message-ID: <CAK-9PRBW7tiMv5vF_aPJ8tP7YUuPh1wXvxDeVYy0vd2PG8twRw@mail.gmail.com> (raw)
In-Reply-To: <CAF8i9mNeJoF0WwU0MYJZYcDUuxxFHqAq4HS-24BEPK35XZWHkw@mail.gmail.com>

> update mm_struct->context when a task migrates to another CPU
You might be able to do that using rq->prev_mm or  rq->active_mm
in move_queued_task() and ttwu_remote() functions...

Reference :
https://elixir.bootlin.com/linux/v5.7.8/source/kernel/sched/core.c#L1472
https://elixir.bootlin.com/linux/v5.7.8/source/kernel/sched/core.c#L2257

...however, i begin to cringe as I started to write the above.
Why? Because it sounds like a hack to me! :-)

> update mm_struct->context when a task migrates to another CPU
So, again, why do you want to do this?

BTW, in the interest of saving time, let us practice 5-Whys
(Reference: https://en.wikipedia.org/wiki/Five_whys)
and jump straight to the actual use-case / final problem
that you are trying to solve ...and work ahead from there.

May be there are pre-existing cleaner approaches to your problem
that do NOT involve fiddling with the Linux kernel internals.

regards
CVS

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

  reply	other threads:[~2020-07-12 17:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09 11:01 Regarding Linux kernel SMP and task switching CPU William Tambe
2020-07-12 11:00 ` CVS
2020-07-12 16:24   ` William Tambe
2020-07-12 17:00     ` CVS [this message]
2020-07-13  4:20     ` Valdis Klētnieks

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=CAK-9PRBW7tiMv5vF_aPJ8tP7YUuPh1wXvxDeVYy0vd2PG8twRw@mail.gmail.com \
    --to=cvs268@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=tambewilliam@gmail.com \
    /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 NNTP newsgroup(s).