Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2463253rdh; Sun, 29 Oct 2023 18:14:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF2XLjhywqecBPq+dVDdLCU2R3L/HwCQUT5C8vNOMutRksnml5VzaiweJ9rilbLk8p0qjl3 X-Received: by 2002:a05:6358:9187:b0:168:e58d:8811 with SMTP id j7-20020a056358918700b00168e58d8811mr4965751rwa.5.1698628448729; Sun, 29 Oct 2023 18:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698628448; cv=none; d=google.com; s=arc-20160816; b=UxgNxTJWWer/winb5z/VedpIgS7C1AaKCXp+0m0DEGeZxr0EG7u6o8YSkdsfhxyQS8 018mvrwXa0h4BlJ338pDTPbavoE5fWU0frQ1n8sXEos9RUNp2ESPjq8fnb8C533EJFay sS8p8Bj2XbyxVuOyqNKN8dpclqmwcbsqOqKoF3P6DkPYdLNOmHKTGoE2emF+d7yKiICc yisscaCZZoqYOlTbhNUYP51i5ysNATV0YomsLfHzPI81JaPvGXs34QaHdm63Dd3fqaAR S9jjK0tH3WyAyaVJBI3mKtUBwhV5nSQ29Bz4QAUWLY80z/6bC5379w9kWLfyNp0gIJ3y choA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=ojZuCV534bTw0U7aBMJrNLnbj0icDQy3uMfdZr7uLyg=; fh=oGCWKUgN5rqvEqhxhGaFnCKhx0upqxg87fHnuYmJPFg=; b=RPZw8gV6lh+cvFC3V/nOYazN37L4xu+wpsCI80zTvp9zYjTAN3cbYWm3T1rzZTf/sF Tja5gKdlsg0mndIV0rOsJYaIeq3PGKDM9rvbrzi1byIjHuhd4ttPfYyEFqdaxsLc06cZ ET7Ju5oCvvuovC0yxFCu8LypZP3kfUR87IEgiKyWSdkVPfLRg0X02qL6DPa1pLcY1RsL janh4wNe/Hs6ZaatJf/90WDA4NrHSz/3dTyOB8gFeOzswnM3CubGrv9kNcRCgg/LvdOk kOeL6FEydjMiI9k6iBsin2Wwi2UeDxnUVi5Opej4obrjE7w9I4I7BhdFeNTw5Jv5ZoJu elJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="kDtuDES/"; dkim=neutral (no key) header.i=@suse.de header.b=4TZjUeYN; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id bn2-20020a056a02030200b00578c9144913si4472008pgb.364.2023.10.29.18.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 18:14:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="kDtuDES/"; dkim=neutral (no key) header.i=@suse.de header.b=4TZjUeYN; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5D4B78062374; Sun, 29 Oct 2023 18:14:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231236AbjJ3BNJ (ORCPT + 99 others); Sun, 29 Oct 2023 21:13:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbjJ3BNI (ORCPT ); Sun, 29 Oct 2023 21:13:08 -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 79E80BD for ; Sun, 29 Oct 2023 18:13:06 -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 5CF1821D49; Mon, 30 Oct 2023 01:13:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1698628384; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ojZuCV534bTw0U7aBMJrNLnbj0icDQy3uMfdZr7uLyg=; b=kDtuDES/n2YZAqWyFclbJsVs9+zJ0qI/jjwbu7Df0M/eJxou8Q5io8G7CUZWYn6fJT6sE0 asaGhZncr2XIuXp11JMPuVbJswZUml7XcyjpYkUAAlP6b2SMK0RjeMqQIOBiQaHmgWeqXG RJJxZZQbkubPkdE4HJJ46k8BMpP5t2s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1698628384; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ojZuCV534bTw0U7aBMJrNLnbj0icDQy3uMfdZr7uLyg=; b=4TZjUeYN/xg2FIzlfhvbwI5SbcyccO1zm1mjC6rS3a2duvvBqyTLgoygC4WbJB1267Pn4l FUN7VEx6AER8+qBA== 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 2E3AB13460; Mon, 30 Oct 2023 01:13:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wySMNB0DP2VORwAAMHmgww (envelope-from ); Mon, 30 Oct 2023 01:13:01 +0000 From: NeilBrown To: Chuck Lever , Jeff Layton Cc: linux-nfs@vger.kernel.org, Olga Kornievskaia , Dai Ngo , Tom Talpey Subject: [PATCH 0/5] sunrpc: not refcounting svc_serv Date: Mon, 30 Oct 2023 12:08:33 +1100 Message-ID: <20231030011247.9794-1-neilb@suse.de> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: 0.55 X-Spamd-Result: default: False [0.55 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-3.00)[-1.000]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.35)[76.34%] X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 29 Oct 2023 18:14:06 -0700 (PDT) This patch set continues earlier work of improving how threads and services are managed. Specifically it drop the refcount. The refcount is always changed under the mutex, and almost always is exactly equal to the number of threads. Those few cases where it is more than the number of threads can usefully be handled other ways as see in the patches. The first patches fixes a potential use-after-free when adding a socket fails. This might be the UAF that Jeff mentioned recently. The second patch which removes the use of a refcount in pool_stats handling is more complex than I would have liked, but I think it is worth if for the result seen in 4/5 of substantial simplification. NeilBrown