Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp4691239imd; Tue, 30 Oct 2018 06:07:46 -0700 (PDT) X-Google-Smtp-Source: AJdET5fK/kQydUnocQc1mmOieGZJOG+ssMd8v4iOISxOHES8qlbRvbR3GWmj+/hhvVyogcqI8aqh X-Received: by 2002:a17:902:7b86:: with SMTP id w6-v6mr8150072pll.62.1540904866518; Tue, 30 Oct 2018 06:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540904866; cv=none; d=google.com; s=arc-20160816; b=CgcnYPTpFWCdnK9T/ap7Fa9e8horwVnOTlqOxazG+rcjKFyfLJnuWf/tV/0/HfGuq5 TS94uLk4yVIKwuFbG27h8OiYS1TiDiWYPPARQGlfA93d9OIykhUZzuIh9CxZxvKHPx/k mjD6v9lCHMDrTI2aUj+5XVeMzBuo94n31wm6duVcVFlpEEMpQZ3DA3+RD1BtWjVlquZH zJZ++P8EAJWqq20qhvXKvsFxj0mFmkpGfwCdl5SFJnHil2UhKHkBVK5W6S2voBXFJ2mA lgnAE+NXwCyBzJv80PIG8ZSHk3M4SvBbYkwvEOAaK9oGv36oOxnnmES/n8JHiih6x2jX 9+7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=TLkbK4ePOFQb2vm2fy10UEbtUwiMoyTbBIZrBW9EDLk=; b=vAFKiuIZyAvULbw1sUZrXR99ZHUQnXaGNHgSHssPgI/oSwL27KnYVDKsGSBWIFb1bn Q9qwq06+EVWHqJZrPdxAbWx+I0n4GZRpzynEZC1nnz63aepfRdCusu5o8lKx/e8MnBvV rhYVdTs4lYrnQNWefWODXeUDEcGhPvLwSmfhIE5NPnaPa0oJJxirY0mMUZHZagjgF8AL XLMb2amcf+1lBA7lQJvzKFL5dNGB60pEXI4GCEf84+lLWSbZbETl5t1gio8IyHZyYNWI OQ7nu5UVjh5qZMo19CDqXlLfEuBLPAk6HDjzxTPDChgteBg/Mr2jqOyQtdFgMXKeKooe THAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n67-v6si23677857pga.290.2018.10.30.06.07.27; Tue, 30 Oct 2018 06:07:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728009AbeJ3V72 (ORCPT + 99 others); Tue, 30 Oct 2018 17:59:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22524 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725853AbeJ3V72 (ORCPT ); Tue, 30 Oct 2018 17:59:28 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C37FF2DE416; Tue, 30 Oct 2018 13:06:06 +0000 (UTC) Received: from [172.16.176.1] (ovpn-121-196.rdu2.redhat.com [10.10.121.196]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 185271084261; Tue, 30 Oct 2018 13:06:05 +0000 (UTC) From: "Benjamin Coddington" To: "zhong jiang" Cc: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, LKML Subject: Re: [Qestion] Lots of memory leaks when mounting and unmounting nfs client to server continuously. Date: Tue, 30 Oct 2018 09:06:06 -0400 Message-ID: <1DEE371C-69EB-4D92-8F78-535AA5203007@redhat.com> In-Reply-To: <5BD85266.6000301@huawei.com> References: <5BD85266.6000301@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 30 Oct 2018 13:06:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi zhong jiang, Try asking in linux-nfs.. but I'll also note that 3.10-stable may be missing a number of fixes to leaks in the NFS GSS code. I can see a more than a few fixes to memory leaks with: git log --grep=leak --oneline net/sunrpc/auth_gss/ Ben On 30 Oct 2018, at 8:45, zhong jiang wrote: > Hi, Herbert > > Recently, I hit a memory leak issue when mounting and unmounting > nfs with the way of krb5. > The issue happens to the linux-3.10-stable. > > I find that slab-1024 and slab-512 will take up most of the memory. > And it can not be freed. > Meanwhile, it result in rpcsec_gss_krb5 can be unregistered as well. > > nfs-sve1:/home # cat /proc/modules | grep krb5 > rpcsec_gss_krb5 31477 239730 - Live 0xffffffffa0334000 > auth_rpcgss 59314 3 rpcsec_gss_krb5,nfsd, Live 0xffffffffa0123000 > sunrpc 300546 25 rpcsec_gss_krb5,nfsd,auth_rpcgss,nfs_acl,lockd, Live > 0xffffffffa013b000 > > I open the slab-1024 trace by enabling > /sys/kernel/slab/:t-0001024/trace and get the following > > [123420.989831] Call Trace: > [123420.989834] [] dump_stack+0x19/0x1b > [123420.989837] [] > alloc_debug_processing+0xc5/0x118 > [123420.989839] [] __slab_alloc+0x400/0x48f > [123420.989841] [] ? __crypto_alloc_tfm+0x45/0x170 > [123420.989845] [] ? setkey+0x57/0x110 > [123420.989847] [] ? kzfree+0x2d/0x30 > [123420.989850] [] __kmalloc+0x1c8/0x230 > [123420.989852] [] __crypto_alloc_tfm+0x45/0x170 > [123420.989854] [] crypto_spawn_tfm+0x45/0x80 > [123420.989857] [] ? __kmalloc+0x1f3/0x230 > [123420.989859] [] crypto_cbc_init_tfm+0x27/0x40 > [123420.989864] [] __crypto_alloc_tfm+0x101/0x170 > [123420.989866] [] crypto_alloc_base+0x4c/0xb0 > [123420.989869] [] > context_v2_alloc_cipher.isra.2+0x2b/0xc0 [rpcsec_gss_krb5] > [123420.989871] [] > gss_import_sec_context_kerberos+0xbf8/0xf00 [rpcsec_gss_krb5] > [123420.989875] [] gss_import_sec_context+0x7d/0xb0 > [auth_rpcgss] > [123420.989878] [] gss_proxy_save_rsc+0x137/0x1b0 > [auth_rpcgss] > [123420.989884] [] > svcauth_gss_proxy_init+0x147/0x1e4 [auth_rpcgss] > [123420.989886] [] ? dequeue_entity+0x106/0x520 > [123420.989890] [] svcauth_gss_accept+0x3da/0xb70 > [auth_rpcgss] > [123420.989892] [] ? check_preempt_curr+0x85/0xa0 > [123420.989894] [] ? ttwu_do_wakeup+0x19/0xd0 > [123420.989897] [] ? > ttwu_do_activate.constprop.86+0x5d/0x70 > [123420.989900] [] ? try_to_wake_up+0x162/0x330 > [123420.989908] [] svc_authenticate+0xc0/0xe0 > [sunrpc] > [123420.989914] [] svc_process_common+0x21a/0x6f0 > [sunrpc] > [123420.989921] [] svc_process+0x103/0x170 [sunrpc] > [123420.989928] [] nfsd+0xdf/0x150 [nfsd] > [123420.989932] [] ? nfsd_destroy+0x80/0x80 [nfsd] > [123420.989934] [] kthread+0xcf/0xe0 > [123420.989936] [] ? > kthread_create_on_node+0x140/0x140 > [123420.989939] [] ret_from_fork+0x58/0x90 > [123420.989943] [] ? > kthread_create_on_node+0x140/0x140 > > I am unfamiliar with crypto. I will be appreciated if you could > give me some suggestion. > > Thanks, > zhong jiang