[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 03/10] sched: credit2: save IRQ state during locking
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Date: Tue, 23 Feb 2021 02:34:56 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Fn4xI64B+KozaWUtPjUMMalIz9nsigT141zdrSuovfQ=; b=dnJ6JWrECpTgYrkflvlaqJwEjXebtzyNyQxPPl356g+Vr1vNrGG0UKHj8uUtQ5CXSVrAG9BidHev7KHyfwFWxkm1ZlZ65XLSTMht1U//8j8B+G+LjcKdLg5ax9oZADCD+pIEmc2/WnEg8IB8OiTR1vPY8bSnnuFGAorTMPbQ2Gj54R3ilLAvVbtlKyfI/4915iDLTKK2bl207KLt6Kyc3OCM96eHgAmjHAK6z8o68l1AsO/hj54RTn0zcMHqMnn6vIUzJdad9LTT+vUtF4LhhwzQ2KWsJfOcEVOiZq9pN4MULnJbWGKfTksncT1R+/tc4k3MqQfvpKrRRNxJDWrQxQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a/0LdzXELduml+jUaLJtNvT+Wx2FNmyZTe49zUVTc283TNgbc+Kc7DBmx1uV9R3sJ2YlVjl7duoCoOQIPlvwvoDssF2o1HrlfcTgoHelS/A1QyupTfCHM4ZlMMmuICNNWxNYHZx4WM+bO5cmUkM0bCVRJ56Kp6uE4cHCjOoFbMAJBwxyiOFaT8mjHt74l1zAvjNiRCN4HgF6/BMxDHyZ4MWlSbwjcJWnusAVRgPREN1oa7lf9kMkH0ddXnL9Ccziz3btUcS4WKi/rNLaek0i0uWMVP2AhckZ8g/HzeOc7rOJW4Vfz0C+AD/nxk3uKzc4UF7cLm+zqDOK3M2gT7B3Bg==
- Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=epam.com;
- Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>
- Delivery-date: Tue, 23 Feb 2021 02:35:17 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHXCYx5L/8BTjhE1kmjLesetNwagA==
- Thread-topic: [RFC PATCH 03/10] sched: credit2: save IRQ state during locking
With XEN preemption enabled, scheduler functions can be called with
IRQs disabled (for example, at end of IRQ handler), so we should
save and restore IRQ state in schedulers code.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
---
xen/common/sched/credit2.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index eb5e5a78c5..b3a9786425 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -2297,7 +2297,8 @@ static void
csched2_context_saved(const struct scheduler *ops, struct sched_unit *unit)
{
struct csched2_unit * const svc = csched2_unit(unit);
- spinlock_t *lock = unit_schedule_lock_irq(unit);
+ unsigned long flags;
+ spinlock_t *lock = unit_schedule_lock_irqsave(unit, &flags);
s_time_t now = NOW();
LIST_HEAD(were_parked);
@@ -2329,7 +2330,7 @@ csched2_context_saved(const struct scheduler *ops, struct
sched_unit *unit)
else if ( !is_idle_unit(unit) )
update_load(ops, svc->rqd, svc, -1, now);
- unit_schedule_unlock_irq(lock, unit);
+ unit_schedule_unlock_irqrestore(lock, flags, unit);
unpark_parked_units(ops, &were_parked);
}
--
2.29.2
|