From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Run queue corruption issue
Date: Tue, 17 May 2016 16:20:27 -0700 [thread overview]
Message-ID: <20160517232027.GA25530@kroah.com> (raw)
In-Reply-To: <CAGWPBMY_=exa9B8KvQr3p+F73LFG2UY2ucCumbUPCOUZLrk6Kg@mail.gmail.com>
On Tue, May 17, 2016 at 06:55:07PM -0400, Jerrin Shaji George wrote:
> Hi All,
>
> I wanted help with a piece of code that I have been working on.
>
> Please see -
>
> https://gist.github.com/jerrinsg/333e584d1f65dc95b9f13b61dcebdaa7
>
> I have written two function, migrate_to and migrate_back. migrate_to is used
> to remove a process from the run queue, and migrate_back is used to insert this
> process back into the run queue.
>
> The gist is from a taken from a larger project, where we are working on building
> a mechanism to support thread migration across heterogeneous processors.
> migrate_to_call() will be called by a thread which wants to remove itself from
> the run queue (hence, it will pass the current task struct as the migration
> argument). Once the other processor completes execution of the assigned task, it
> will interrupt the main processor, which runs an interrupt handler, which in
> turn calls the migrate_back_call() function. It passes the task struct of the
> process that was removed from the run queue earlier to this function.
>
> This mechanism works fine the first few times, but when this process is repeated
> many times in a loop, I am seeing a run queue corruption:
> https://gist.github.com/jerrinsg/0ab09cd435d8d2cb6ae692c7e6f4f26b
>
> Is there anything wrong in the process dequeue or enqueue function that I have
> written? Please help!
volatile doesn't mean what you think it does, please don't use it in the
kernel.
And why are you using "raw_spin_lock()"?
> Kernel used: Linux 3.13
Wow that's obsolete and buggy, why use such an old thing?
greg k-h
next prev parent reply other threads:[~2016-05-17 23:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-17 22:55 Run queue corruption issue Jerrin Shaji George
2016-05-17 23:20 ` Greg KH [this message]
2016-05-18 5:29 ` Jerrin Shaji George
2016-05-18 6:16 ` Greg KH
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=20160517232027.GA25530@kroah.com \
--to=greg@kroah.com \
--cc=kernelnewbies@lists.kernelnewbies.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.