From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751833AbeCOMfm (ORCPT ); Thu, 15 Mar 2018 08:35:42 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34098 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751414AbeCOMfi (ORCPT ); Thu, 15 Mar 2018 08:35:38 -0400 Message-Id: <20180315123202.630084556@infradead.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Mar 2018 13:19:08 +0100 From: Peter Zijlstra To: Ingo Molnar , linux-kernel@vger.kernel.org Cc: Dan Williams , David Howells , Daniel Vetter , David Airlie , Stanimir Varbanov , Chris Mason , Anna Schumaker , Joel Becker , James Hogan , Ralf Baechle , Linus Torvalds , George Spelvin , "Peter Zijlstra (Intel)" Subject: [PATCH 06/11] sched/wait,fscache: Replace wait_on_atomic_t usage References: <20180315121902.942902000@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=peterz-wait_var-6.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the wait_on_atomic_t() usage to the new wait_var_event() API. Cc: David Howells Signed-off-by: Peter Zijlstra (Intel) --- fs/fscache/cookie.c | 7 ++++--- include/linux/fscache-cache.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) --- a/fs/fscache/cookie.c +++ b/fs/fscache/cookie.c @@ -557,9 +557,10 @@ void __fscache_disable_cookie(struct fsc * n_active reaches 0). This makes sure outstanding reads and writes * have completed. */ - if (!atomic_dec_and_test(&cookie->n_active)) - wait_on_atomic_t(&cookie->n_active, atomic_t_wait, - TASK_UNINTERRUPTIBLE); + if (!atomic_dec_and_test(&cookie->n_active)) { + wait_var_event(&cookie->n_active, + !atomic_read(&cookie->n_active)); + } /* Make sure any pending writes are cancelled. */ if (cookie->def->type != FSCACHE_COOKIE_TYPE_INDEX) --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h @@ -496,7 +496,7 @@ static inline bool __fscache_unuse_cooki static inline void __fscache_wake_unused_cookie(struct fscache_cookie *cookie) { - wake_up_atomic_t(&cookie->n_active); + wake_up_var(&cookie->n_active); } /**