Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21647240rwd; Thu, 29 Jun 2023 20:18:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlEgoVlpqAw25DvVZP8J5HXqGSdTHRKe5Dzph4RU4VP84zigt+pt9lBUDC6kbxnw5KznMDuj X-Received: by 2002:a05:6358:e907:b0:134:e34e:ec49 with SMTP id gk7-20020a056358e90700b00134e34eec49mr1422152rwb.2.1688095085144; Thu, 29 Jun 2023 20:18:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688095085; cv=none; d=google.com; s=arc-20160816; b=fSWVYekksP09wlk81UsamFARV1eQdpcyTMJGV9zHdr+92iCMo37QXmwnCv66G+DrFj rt5VfxdZ1T+j0no6a0nKvn4WzXwrqSFmmbLmRUn9Hp3aMbP+nPHprGtNuR4y0Dhx4JCI nB2GKfJeuw93wanBb+6d7Fm7v6sW5xvVtzicFgZPk4Vq8PK7mteZNyuBQAbs4RWhSfK2 4OOp18WScK+wu+jovfav54zUKA+sASsWQVZOsQSPS6pwV1z1+eBBOC+fIfY+9vYM/xXh NfafdTZVm0jKIhl8GCMHzF3X9aDH2YZAo0T4fXd9Ika5AEP3OFicp3quNgoCoB/s3/0g bokA== 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=lrYkjCgtfX+pFT+t0RZkQHZfWWVcJ3Ln+joYhGnMJRU=; fh=prpaJtz2kvK6JgUs4447rtm1pDQU9vyI1Km5GBTBT9o=; b=p3zfNI+t7X77K2zNJjln5BExrztTP+8LbrTWRGBeYd+cTGG0tMhriiUpBRzSjuiTNi JvWeUdljqASzH/3r8tzE/V8AyRHbRtSVGgRpUK5L/5n/QO9KXqgTw0MJq5ZyK4ANyiUc CuE1qYUsfx2kc4xGIy26GM/U8GLRepxC4OmLhHdT4LZRWw/pxCtO3joIHJped2IIo09A 5SDGkC9vEMqJI0ULTL+9fESYfhEWX3wJDV32EcaoB9eb4aBHeGg92opOZITbnw7u6SHH Rz2dcodF7NnDZl7hdxN0nSjU2dPeuXoFIFyK6PH4fjFf8GvNM+jqFqEUEJD1cGmQrBKz x5Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=VW2DP5Sv; 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 o19-20020a656a53000000b00553ce421356si13623396pgu.56.2023.06.29.20.17.42; Thu, 29 Jun 2023 20:18:05 -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=VW2DP5Sv; 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 S229459AbjF3DE4 (ORCPT + 99 others); Thu, 29 Jun 2023 23:04:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232006AbjF3DEw (ORCPT ); Thu, 29 Jun 2023 23:04:52 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C39AD3588 for ; Thu, 29 Jun 2023 20:04:51 -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-out1.suse.de (Postfix) with ESMTPS id A8133211DE; Fri, 30 Jun 2023 03:04:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688094289; 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=lrYkjCgtfX+pFT+t0RZkQHZfWWVcJ3Ln+joYhGnMJRU=; b=VW2DP5SvfHXGR+OcYbd187a1r19ZkLm1t2hJPg7m8bjHZJKgWDWM7sZZBhRGI86PuKVv9p FswO3nQlzmN33MLmp3E7OytJkL9XP7wLwComJUYdYdU0EexIlfilrgqNAqomVDwHwn5T/F rkQcsdnWAuT249b8EGy9iLAp0kzryPs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688094289; 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=lrYkjCgtfX+pFT+t0RZkQHZfWWVcJ3Ln+joYhGnMJRU=; b=PRW3kBtyfn4CwT3Y84beXTk4qW6VNYWItSrMdCnjnykn7Z2w1stkXlhB1kSxrG6CW55CI/ yarzUpobNWb5VDDQ== 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 7613E1391D; Fri, 30 Jun 2023 03:04:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id whRsCk9GnmSQTgAAMHmgww (envelope-from ); Fri, 30 Jun 2023 03:04:47 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Chuck Lever" Cc: linux-nfs@vger.kernel.org, "Chuck Lever" , lorenzo@kernel.org, jlayton@redhat.com, david@fromorbit.com Subject: Re: [PATCH RFC 0/8] RPC service thread scheduler optimizations In-reply-to: <168809295522.9283.8453285193952262503@noble.neil.brown.name> References: <168806401782.1034990.9686296943273298604.stgit@morisot.1015granger.net>, <168809295522.9283.8453285193952262503@noble.neil.brown.name> Date: Fri, 30 Jun 2023 13:04:44 +1000 Message-id: <168809428416.9283.10675552657236895730@noble.neil.brown.name> 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_PASS,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-nfs@vger.kernel.org On Fri, 30 Jun 2023, NeilBrown wrote: > > I agree that an a priori cap on number of threads is not ideal. > Have you considered using the xarray to only store busy threads? > I think its lookup mechanism mostly relies on a bitmap of present > entries, but I'm not completely sure. It might be event better to use xa_set_mark() and xa_clear_mark() to manage the busy state. These are not atomic so you would need an atomic operation in the rqst. #define XA_MARK_IDLE XA_MARK_1 do { rqstp = xa_find(xa, ..., XA_MARK_IDLE); if (test_and_set_bit(RQ_BUSY, &rqstp->rq_flags)) { xa_clear_mark(xa, rqstp->xa_index, XA_MARK_IDLE); break; } } while {rqstp); xa_find() should be nearly as fast at find_next_bit() NeilBrown