Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2511163rwo; Sun, 23 Jul 2023 17:35:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlER6jSjawu9oPLF+ll0gbMU9t0/aA90ofYfpkrfpxXkYtHoeNsbAUkg3kZ4CWMpWgo04ONA X-Received: by 2002:a17:906:77cf:b0:992:ef60:ab0d with SMTP id m15-20020a17090677cf00b00992ef60ab0dmr8928707ejn.69.1690158947431; Sun, 23 Jul 2023 17:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690158947; cv=none; d=google.com; s=arc-20160816; b=XxvCxTf7XVFs3OYJk4OWul2c+TK2qOAg6Whlvr7B2mXvgwaZveBEJrlyTW2h6tCsjR 7IZO3PVEf7xwOfbgBLtDkiQRJ8x173UhZfBhd/eEbMRu/z1HlJroxbTL3dYu9TQ26Fvq rQ8zdO5UsrneHXMgMe4I3dkXTmXXOAhgl6dAc6M+1tiZXDXEonsPKigQU+Wkhada1Jv/ SGRCAlVb/twxh1Nod2mfP0ZKv7aYqN+PrEy3/g2AJVnNokYd1U8cEEdklAQIb6ut6qBx Qciij9gyqs96zgsHotAhJk8+wtdQKOB+aCXQjX0q0d21EyUokGaWcvTzJuOYUdwiDpxj 704g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=XpKfjKSl5tBYGYbFTH9D8TsruW8hZ+h9uOlwyv+SlFI=; fh=7DFDo8ihEnRe7Y1piThtvtGXetlWVmAb71I1HziHbR8=; b=XaHtOkDbJZZh9HsaTTDar52wv6sfcNYpMKMODWRc9yQVCG2pbqKeySQC7uxc5WW7gD euPaqqzkhEhZ7N+MWlco/WAK+67QkuPhm3/vtmA9UVV0FSBfDFa7D+WI7BOp00wy18Xd okOy4M9eZpieXv13swv00pYxX/+b5a2lwvLriFspSzb+pgzIi0T21x+pM5nax2irTeil mtjXX7iazLJCMFAWkXJTNxuEF/2UlGUiSAOU/GHT4YAIHiYvdWPzjYV37SNk2m2QiuHz BAoDqy04PtbBmnETm2wQf0x+CgcSy9ts7JkbLRw2FGiv3+F2jtbcNEXo/oEEHH3RHMn0 TY0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OeTc83l2; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v21-20020a170906565500b00997d315d050si5696350ejr.84.2023.07.23.17.35.10; Sun, 23 Jul 2023 17:35:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@suse.de header.s=susede2_rsa header.b=OeTc83l2; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229477AbjGXADi (ORCPT + 99 others); Sun, 23 Jul 2023 20:03:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjGXADh (ORCPT ); Sun, 23 Jul 2023 20:03:37 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 223AABD for ; Sun, 23 Jul 2023 17:03:26 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AA904202DC; Mon, 24 Jul 2023 00:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1690157005; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XpKfjKSl5tBYGYbFTH9D8TsruW8hZ+h9uOlwyv+SlFI=; b=OeTc83l2pt89CI4bY4ZLb+4Htj75WNkiVjOClOPwcARVbvEa2j+xEID7TFeRDilPk353kD br7D7PhM0HqDmZRbSkGhpIoVMeaBQ+EOBxetg0oq4Ls+k6G5EyVPfaAjQkyym2V+7sE2Lp Hvb89umn4Iyj6NHegg0ls/oNptlXL/c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1690157005; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XpKfjKSl5tBYGYbFTH9D8TsruW8hZ+h9uOlwyv+SlFI=; b=FZ9hh5g1kdHPtFUzQ0pOshqIXv1qO8cjMtdOjboDb0k4t1G9cg9roqK+Ys01VOa17E51ip BAmbmlm6xISOagBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1D34413476; Mon, 24 Jul 2023 00:03:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id g3ZFMMu/vWT5LgAAMHmgww (envelope-from ); Mon, 24 Jul 2023 00:03:23 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Chuck Lever III" Cc: "Chuck Lever" , "Jeff Layton" , "Linux NFS Mailing List" Subject: Re: [PATCH 10/14] SUNRPC: change svc_pool_wake_idle_thread() to return nothing. In-reply-to: <3A9F5306-EAEE-427C-80D2-E0CD81212238@oracle.com> References: <168966227838.11075.2974227708495338626.stgit@noble.brown>, <168966228866.11075.18415964365983945832.stgit@noble.brown>, , <168972938409.11078.8409356274248659649@noble.neil.brown.name>, <9EEE82A6-6D25-4939-A4F5-BAC8E9986FF3@oracle.com>, <168980881867.11078.6059884952065090216@noble.neil.brown.name>, , <3A9F5306-EAEE-427C-80D2-E0CD81212238@oracle.com> Date: Mon, 24 Jul 2023 10:03:18 +1000 Message-id: <169015699813.11078.13302996883028676357@noble.neil.brown.name> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,NO_DNS_FOR_FROM,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, T_SPF_HELO_TEMPERROR,T_SPF_TEMPERROR 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-nfs@vger.kernel.org On Fri, 21 Jul 2023, Chuck Lever III wrote: >=20 > > On Jul 19, 2023, at 7:44 PM, Chuck Lever III wro= te: > >=20 > >=20 > >=20 > >> On Jul 19, 2023, at 7:20 PM, NeilBrown wrote: > >>=20 > >> On Wed, 19 Jul 2023, Chuck Lever III wrote: > >>>=20 > >>>> On Jul 18, 2023, at 9:16 PM, NeilBrown wrote: > >>>>=20 > >>>> On Tue, 18 Jul 2023, Chuck Lever wrote: > >>>>> On Tue, Jul 18, 2023 at 04:38:08PM +1000, NeilBrown wrote: > >>>>>> No callers of svc_pool_wake_idle_thread() care which thread was woke= n - > >>>>>> except one that wants to trace the wakeup. For now we drop that > >>>>>> tracepoint. > >>>>>=20 > >>>>> That's an important tracepoint, IMO. > >>>>>=20 > >>>>> It might be better to have svc_pool_wake_idle_thread() return void > >>>>> right from it's introduction, and move the tracepoint into that > >>>>> function. I can do that and respin if you agree. > >>>>=20 > >>>> Mostly I agree. > >>>>=20 > >>>> It isn't clear to me how you would handle trace_svc_xprt_enqueue(), > >>>> as there would be no code that can see both the trigger xprt, and the > >>>> woken rqst. > >>>>=20 > >>>> I also wonder if having the trace point when the wake-up is requested > >>>> makes any sense, as there is no guarantee that thread with handle that > >>>> xprt. > >>>>=20 > >>>> Maybe the trace point should report when the xprt is dequeued. i.e. > >>>> maybe trace_svc_pool_awoken() should report the pid, and we could have > >>>> trace_svc_xprt_enqueue() only report the xprt, not the rqst. > >>>=20 > >>> I'll come up with something that rearranges the tracepoints so that > >>> svc_pool_wake_idle_thread() can return void. > >>=20 > >> My current draft code has svc_pool_wake_idle_thread() returning bool - > >> if it found something to wake up - purely for logging. > >=20 > > This is also where I have ended up. I'll post an update probably tomorrow > > my time. Too much other stuff going on to finish it today. >=20 > Pushed to https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git > in branch topic-sunrpc-thread-scheduling >=20 Thanks. One little thing to fix. In SUNRPC: Report when no service thread is available. you now have - return false; + + trace_svc_pool_starved(serv, pool); + percpu_counter_inc(&pool->sp_threads_starved); + return NULL; That should still be "return false" at the end; NeilBrown