[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAHP4M8WXa-xby4gzUT7ngkuDYhKNReRJ46xHmxzQWzaKvFxFpg@mail.gmail.com>
Date: Mon, 11 Dec 2023 17:52:33 +0530
From: Ajay Garg <ajaygargnsit@...il.com>
To: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Queries on sleeping and scheduling in interrupt-context
Hi everyone.
I am not 100% sure about some of the best practices while writing code
in interrupt-context.
Will be grateful to have confirmation of my thoughts from the experts :)
For all the queries, we assume that there are no thread-affinities to
any processor.
Also, we assume there are no locking/synchronisation worries as of now.
1.
A thread in interrupt-context is not schedulable.
Is this a mandate that is true under all conditions?
2.
Assuming the answer to 1. is yes :
On uniprocessor systems, code in interrupt-context *must never*
sleep/spin to wait (since the current thread cannot be scheduled,
which means that no other thread can get scheduled on the singular
processor, which means that the condition will never become true).
Is my understanding correct?
3.
Assuming the answer to 1. is yes :
On multiprocessor systems, code in interrupt-context *can* sleep/spin
to wait (since another thread can get scheduled on a different
processor, and the condition can then become true, and the current
thread can then come out of sleeping/spinning/waiting).
Is my understanding correct?
Once again, many thanks in advance for all the help.
Thanks and Regards,
Ajay
Powered by blists - more mailing lists