From patchwork Wed Jul 22 05:34:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Nazar X-Patchwork-Id: 11677275 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 528C5618 for ; Wed, 22 Jul 2020 05:35:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3838F208E4 for ; Wed, 22 Jul 2020 05:35:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nazar.ca header.i=@nazar.ca header.b="RdS2JTEV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728059AbgGVFe7 (ORCPT ); Wed, 22 Jul 2020 01:34:59 -0400 Received: from ny018.relay.arandomserver.com ([172.96.188.180]:46427 "EHLO ny018.relay.arandomserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726253AbgGVFe5 (ORCPT ); Wed, 22 Jul 2020 01:34:57 -0400 Received: from nyc006.hawkhost.com ([172.96.186.142]) by se004.arandomserver.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jy7P3-0005QS-R0; Wed, 22 Jul 2020 00:34:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nazar.ca; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=g4oX3BgZ9ods+C0xQm/7CSC1FN00hD+kHzy8iHeuEbg=; b=RdS2JTEVFU47LeCwVu4BND8wHe YTfKSYZ7Gs/FtCIIe69A68i1eHWHYMsvz2hOh9zbzvebGgQcMYTZo5YN2EO4eoVN6svKVPNL6A+h5 edsWW9gnxw9tUJRp7MPYY/c6oYPG95zP9ZIzNvATS2hZuxNrto3JVBjYa1etXDjUD2P6CgPMzDbBS jBcilj9IVGz2FIjNrAaru+lWqWt/FzgtWZowEUMEFlb5f7B06/pxL1YltDPNGYrCjHIM+vRmLdKEo eH5VzDawJ4ixReRqPbrRSm2tueglFoungpSDt1biPDrl+4u6m4I+6LsRksZ+oZzcro++c7a1rHZr6 qPADgIQA==; Received: from [174.119.114.224] (port=44150 helo=wraith.dragoninc.ca) by nyc006.hawkhost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jy7P3-00045O-GS; Wed, 22 Jul 2020 01:34:53 -0400 From: Doug Nazar To: libtirpc-devel@lists.sourceforge.net Cc: linux-nfs@vger.kernel.org Subject: [PATCH 0/5] libtirpc patches Date: Wed, 22 Jul 2020 01:34:40 -0400 Message-Id: <20200722053445.27987-1-nazard@nazar.ca> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Get-Message-Sender-Via: nyc006.hawkhost.com: authenticated_id: nazard@nazar.ca X-Authenticated-Sender: nyc006.hawkhost.com: nazard@nazar.ca X-Originating-IP: 172.96.186.142 X-SpamExperts-Domain: nyc006.hawkhost.com X-SpamExperts-Username: 172.96.186.142 Authentication-Results: arandomserver.com; auth=pass smtp.auth=172.96.186.142@nyc006.hawkhost.com X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.09) X-Recommended-Action: accept X-Filter-ID: Mvzo4OR0dZXEDF/gcnlw0bN4ZX/cCaR95pQ7tQtUF1ypSDasLI4SayDByyq9LIhVco68FsdzuGD4 737Z8XZT0ETNWdUk1Ol2OGx3IfrIJKyP9eGNFz9TW9u+Jt8z2T3KnRr9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-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org While running valgrind on various nfs-utils programs, I came across a leak while destroying a svc_dg object. Second, I noticed that pollfds were being reallocated a dozen times, so added an optimization to batch the allocations. Third, I added destructor functions to clear up some of the static allocations on exit. This is mainly to help with running valgrind. Not too important, more of an RFC if it's desired. Forth, I noticed that the comments expected the main thread to use the static variable, instead of thread specific data but wasn't doing that. The last two patches implement that. Also helps with valgrind as TSD is not destroyed on the main thread. Thanks, Doug Doug Nazar (5): svc_dg: Free xp_netid during destroy svc: Batch allocations of pollfds Add destructor functions to cleanup static resources on exit Add ability to detect if we're on the main thread. Use static object on main thread, instead of thread specific data. src/auth_none.c | 14 ++++++++++++++ src/clnt_dg.c | 12 ++++++++++++ src/clnt_vc.c | 12 ++++++++++++ src/getnetconfig.c | 3 +++ src/mt_misc.c | 20 ++++++++++++++++++++ src/svc.c | 35 ++++++++++++++++++++++++++++------- src/svc_dg.c | 2 ++ tirpc/reentrant.h | 1 + 8 files changed, 92 insertions(+), 7 deletions(-)