Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4408169rwo; Tue, 25 Jul 2023 05:51:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlHtKXCBulp8whA0TR1qEscfO8+IbqUzIELjvucHwmCnqCGZmvsxxYUhr9cK7dkV4o8yxgj7 X-Received: by 2002:a2e:924b:0:b0:2b6:e536:a2a3 with SMTP id v11-20020a2e924b000000b002b6e536a2a3mr8595410ljg.19.1690289492174; Tue, 25 Jul 2023 05:51:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690289492; cv=none; d=google.com; s=arc-20160816; b=es5H62k6qxBCCIw7vypPWqSlWiUJfL66KiC9BR7vgaGEu+D3zOrKnZNj8EA4Qiur8T 9/iP69lED356qKbtC7MQbK+z1F9CjN0rY+IplmMpx+/ORVOgr8oPEJTrVkLr6TKq2twp 2dTp7sureHEGCX3LEVKwXKrLMAzZ41TwFbdfLjo50G+XHr9GvgmUZ7ejQBTNVLdIcIp3 ffeOZaeEnhMejLy/6IPniagwwI16hY8+WLSQ0WFVUku4q6R3PV7jQ2APCF03iy+PJ4rE VOW3VTzH84uD/52cQTgSKHHazn1BJsq43Wm6sskw1LhpxVyYzVb+aXOHtF8mWDxHFjv8 g34w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rj19k1Vm+sor8RHKIaaTyN5cpuhdwmNlFlHX6MThlJU=; fh=contHsaVNN9ONul82p16JPM98uP+9qAZFX0BOo3SX18=; b=MX0bw4TWd3W6BbPLBi5qXC8qIEWQr15L4ghL5NV/P9zcxooFf5BgG7QHgDw9O1Ye7A 7ST1cMp7BWrio2x99sz+i1OlrJ499SHVBDfX3PJPGGqH3ukouNXphUHERwS8ErCAVoFW ZURo1RT/0IP7X+fsLtL/42U5L3SZLobR3oCNkMII9zlmcj5FDCA43J/vZOh6nhgxUGQc kgt/E1Ufl54cbn5dI59qkPswD8184dqkrfbo4oj7EdGpSwqz/gM+nXlI6iZcWAjbJ+SG 36ZBfR+j+4ulRS9k8ltDjUx4KjM0Hw6Sqxz0yDZwXANKT2HUwO6YBfzgL9+UyYqEV2S2 jbXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=NJaEqarA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t15-20020a1709064f0f00b0099b6bff4a56si6712803eju.6.2023.07.25.05.50.48; Tue, 25 Jul 2023 05:51:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=NJaEqarA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233110AbjGYMDq (ORCPT + 99 others); Tue, 25 Jul 2023 08:03:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbjGYMDo (ORCPT ); Tue, 25 Jul 2023 08:03:44 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC7E710D4 for ; Tue, 25 Jul 2023 05:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rj19k1Vm+sor8RHKIaaTyN5cpuhdwmNlFlHX6MThlJU=; b=NJaEqarAmxWfb7fTD3TOMqIgEJ HVBm/Mvv13s8gZSzbr85BbBjs4K4jyWqnnCi/JeSubb+peZ+MSJnAdEImZLfdM+uCgidjtlFlwSVi 7ONWGFrMyLqP5eTsDVQmT2DJYTiSuu3B+dSxNLpYT8gra/cmu0k5idT2RegbvgIJwqKx6sMUQEDlG 2SCK8Ky8egGiWGscZ2JGKw9+b1wM4dWmr/XBO/z/snxvS9zcUgeaw10lnVFBygvsr2KISOBHqymCS Ff+WMjn5qb/zucydLLzhJZRkU8FQYJhaXKayB0sbb4OtMZvCYTCz1TIU8zi9E6N6jJlJ70wrrEsgT lMEurEPw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qOGlN-0047ZH-11; Tue, 25 Jul 2023 12:03:37 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id C2AD8300155; Tue, 25 Jul 2023 14:03:36 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A9F352612ABE5; Tue, 25 Jul 2023 14:03:36 +0200 (CEST) Date: Tue, 25 Jul 2023 14:03:36 +0200 From: Peter Zijlstra To: Davidlohr Bueso Cc: mingo@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcuwait: Add might_sleep() annotations Message-ID: <20230725120336.GG3765278@hirez.programming.kicks-ass.net> References: <20230724160337.20851-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230724160337.20851-1-dave@stgolabs.net> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 24, 2023 at 09:03:36AM -0700, Davidlohr Bueso wrote: > ... as with regular waitqueues. No immediate objection, but please, tell us more. What made you get up this fine morning and write this patch? > Signed-off-by: Davidlohr Bueso > --- > include/linux/rcuwait.h | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/include/linux/rcuwait.h b/include/linux/rcuwait.h > index 27343424225c..c0fcac903d03 100644 > --- a/include/linux/rcuwait.h > +++ b/include/linux/rcuwait.h > @@ -74,7 +74,10 @@ extern void finish_rcuwait(struct rcuwait *w); > }) > > #define rcuwait_wait_event(w, condition, state) \ > - ___rcuwait_wait_event(w, condition, state, 0, schedule()) > +do { \ > + might_sleep(); \ > + ___rcuwait_wait_event(w, condition, state, 0, schedule()); \ > +} while (0) > > #define __rcuwait_wait_event_timeout(w, condition, state, timeout) \ > ___rcuwait_wait_event(w, ___wait_cond_timeout(condition), \ > @@ -84,6 +87,7 @@ extern void finish_rcuwait(struct rcuwait *w); > #define rcuwait_wait_event_timeout(w, condition, state, timeout) \ > ({ \ > long __ret = timeout; \ > + might_sleep(); \ > if (!___wait_cond_timeout(condition)) \ > __ret = __rcuwait_wait_event_timeout(w, condition, \ > state, timeout); \ > -- > 2.41.0 >