Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1983122ybh; Fri, 13 Mar 2020 10:49:11 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvvuFWGvz09FDTZoPMlHqlFT08VukL6llH4ggOccOuK/iqtWAqTForDChai7J3+8K70B9k/ X-Received: by 2002:a05:6808:8cd:: with SMTP id k13mr2509529oij.34.1584121750974; Fri, 13 Mar 2020 10:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584121750; cv=none; d=google.com; s=arc-20160816; b=KU61m6d0klPjLG2ytTlYWRFhsZUx+kB/SJZESkzbTRjn+VEoUbKg7b0u4D4l5oY9xu 2HBxHqtiMc63KsG4hwZt0u5nmp19q9M3YnwQJlewlHAJuMdLvXPO2qQR1pELkWqDpGA8 8U5ctFCgewQ7xwSx+QaWw6Zxipi0te732GtdvpOBKbylXQqTpGFsl1/BD7MpUzikspvk 398Y3ad6BP7Iz8DaXAV5pGNzgO6Q1UM1v8NEOWexjG1k3pqFbNwKqghvBjDJvmpLeGTa +oPuXGiAQUrkqW7o/Cz62HWYAI2sIt7Hx81m3PMuONXSY1xhb98+9vALnrK7RGNDa6ZZ tRpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=xMVsqt3Yh+Cbi4MYJMWrJZSaHFBKxHqr5j4y9H7DhP4=; b=hPtLZ20pfiuGTLONuoS26eMNwx1Do70nG1JBVGpaNXLR0iSStk55O7kyAy/8C1uoMt oiZUk9cH1DtGEOspe+efyN+0o5ldFAbfoIBBEg5I/Vauahzja54K3OstPPj15vVrl+vT Pxu5AU4vAaJK9sRkXe4K9RDjqtml7M25YHRbcdaxBx8gwSAqVHN49I3zexd1LBuDr9aR Eofj9PvAl6voxdnp9zG7R+u76021H1aorajPMGznsDSZbunmvRgLbn9W82owd23Ohicy P37On+kCxPaWf+ZPHYcVZI/isrzCWspb1ZmS+M5ifdFG3Fpt8N6/CDAFKy0waYCW2IYP r1mQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10si4940673otj.235.2020.03.13.10.48.58; Fri, 13 Mar 2020 10:49:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727193AbgCMRr2 (ORCPT + 99 others); Fri, 13 Mar 2020 13:47:28 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:47718 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727085AbgCMRrW (ORCPT ); Fri, 13 Mar 2020 13:47:22 -0400 Received: from localhost ([127.0.0.1] helo=flow.W.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1jCoP1-00017r-Bs; Fri, 13 Mar 2020 18:47:19 +0100 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , "Paul E . McKenney" , Joel Fernandes , Steven Rostedt , Linus Torvalds , Thomas Gleixner , Sebastian Andrzej Siewior Subject: [PATCH 4/9] sched/swait: Prepare usage in completions Date: Fri, 13 Mar 2020 18:46:56 +0100 Message-Id: <20200313174701.148376-5-bigeasy@linutronix.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200313174701.148376-1-bigeasy@linutronix.de> References: <20200313174701.148376-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner As a preparation to use simple wait queues for completions: - Provide swake_up_all_locked() to support complete_all() - Make __prepare_to_swait() public available This is done to enable the usage of complete() within truly atomic contexts on a PREEMPT_RT enabled kernel. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/sched/sched.h | 3 +++ kernel/sched/swait.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 9ea647835fd6f..fdc77e7963242 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2492,3 +2492,6 @@ static inline bool is_per_cpu_kthread(struct task_str= uct *p) return true; } #endif + +void swake_up_all_locked(struct swait_queue_head *q); +void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wa= it); diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c index e83a3f8449f65..c528f238c68d6 100644 --- a/kernel/sched/swait.c +++ b/kernel/sched/swait.c @@ -32,6 +32,12 @@ void swake_up_locked(struct swait_queue_head *q) } EXPORT_SYMBOL(swake_up_locked); =20 +void swake_up_all_locked(struct swait_queue_head *q) +{ + while (!list_empty(&q->task_list)) + swake_up_locked(q); +} + void swake_up_one(struct swait_queue_head *q) { unsigned long flags; @@ -69,7 +75,7 @@ void swake_up_all(struct swait_queue_head *q) } EXPORT_SYMBOL(swake_up_all); =20 -static void __prepare_to_swait(struct swait_queue_head *q, struct swait_qu= eue *wait) +void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wa= it) { wait->task =3D current; if (list_empty(&wait->task_list)) --=20 2.25.1