Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp292824ybz; Tue, 21 Apr 2020 21:13:19 -0700 (PDT) X-Google-Smtp-Source: APiQypI7UoOeJEtfXeXkm7fDPq/pALB53AoxpSx4FfS2jgWnv+NIPWsmw0F1F6YbI93uMMY2Ccyc X-Received: by 2002:a05:6402:1b08:: with SMTP id by8mr21596747edb.286.1587528799249; Tue, 21 Apr 2020 21:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587528799; cv=none; d=google.com; s=arc-20160816; b=c04mT0YeVAzR/oyyOKsLizjnzSexzHfm+AU3jglOuzdVRnfGrvY8ea+x9gPLhQELSO 7aQJOqpeuyqgAXNxLdWeCFKlpRD98iY1ps106ahiFUXYpWWIrF3tEi9z37qSRE8anz93 C0sWpvGEj8GOmJ2WR/bsIEfIOGil92LJ+KTLSrWFi21A0fykuFNqWlWrH+IYXktrQW1I CDLeqhyUlKMa4SI1tJpAWIFFS/pdbNGJUPhugWnOzmFBDN05M/5MjvNW288bWUdcLVtp rVmJcHEPjP4lauMRYK4W1+C3vROgkx87b78KCAz4rLBFQXnyb57IJtSwirqYSFrfPICX gBpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=iGZdoSlrosxe5Tnadue/8FQ2eb912rWWmJi3tDaR9I0=; b=HuEOzQJ7zcObwZIOD8UMm5dVMPz5e5mJznzsQFLmGPYlS1ji0PXgzojWW49btaLJ1D vlCawFQRxcKUVwhgCibDnFkYtMXdkirmOdxuupehczwNFupPyHhz/wxRXT/ULrw8GvKH bqElXqOF+bVvM1IxZyS0a/wwinuwN2cZiqFpHvwSB3J4y/KZ3slfEzyXtdrmfzIttVqS Nv4jg/fHQXexXQHGz7qbFKFXvv4CR1ewFcF18uNwACaTyY/WctRlaThbYDkEo00KZbbN m2Jk9KC6eEXCvHmlIB7nTNkrEwtBGVx9Q9WpBCIKYvAv53aBE3lc3mw0tUT6Ud5MKdQJ HIfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q25si2769740ejb.274.2020.04.21.21.12.56; Tue, 21 Apr 2020 21:13:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726468AbgDVELv (ORCPT + 99 others); Wed, 22 Apr 2020 00:11:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:60050 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726456AbgDVELt (ORCPT ); Wed, 22 Apr 2020 00:11:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E36AEAD82; Wed, 22 Apr 2020 04:11:46 +0000 (UTC) From: Davidlohr Bueso To: tglx@linutronix.de, pbonzini@redhat.com Cc: bigeasy@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, torvalds@linux-foundation.org, will@kernel.org, joel@joelfernandes.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, dave@stgolabs.net, Davidlohr Bueso Subject: [PATCH 2/5] rcuwait: Let rcuwait_wake_up() return whether or not a task was awoken Date: Tue, 21 Apr 2020 21:07:36 -0700 Message-Id: <20200422040739.18601-3-dave@stgolabs.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422040739.18601-1-dave@stgolabs.net> References: <20200422040739.18601-1-dave@stgolabs.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Propagating the return value of wake_up_process() back to the caller can come in handy for future users, such as for statistics or accounting purposes. Signed-off-by: Davidlohr Bueso --- include/linux/rcuwait.h | 2 +- kernel/exit.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/linux/rcuwait.h b/include/linux/rcuwait.h index 2ffe1ee6d482..6ebb23258a27 100644 --- a/include/linux/rcuwait.h +++ b/include/linux/rcuwait.h @@ -25,7 +25,7 @@ static inline void rcuwait_init(struct rcuwait *w) w->task = NULL; } -extern void rcuwait_wake_up(struct rcuwait *w); +extern int rcuwait_wake_up(struct rcuwait *w); /* * The caller is responsible for locking around rcuwait_wait_event(), diff --git a/kernel/exit.c b/kernel/exit.c index 9f9015f3f6b0..f3beb637acf7 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -227,8 +227,9 @@ void release_task(struct task_struct *p) goto repeat; } -void rcuwait_wake_up(struct rcuwait *w) +int rcuwait_wake_up(struct rcuwait *w) { + int ret = 0; struct task_struct *task; rcu_read_lock(); @@ -248,8 +249,10 @@ void rcuwait_wake_up(struct rcuwait *w) task = rcu_dereference(w->task); if (task) - wake_up_process(task); + ret = wake_up_process(task); rcu_read_unlock(); + + return ret; } EXPORT_SYMBOL_GPL(rcuwait_wake_up); -- 2.16.4