From: Ido Schimmel <idosch@idosch.org>
To: NeilBrown <neilb@suse.de>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
Chuck Lever <chuck.lever@oracle.com>,
linux-nfs@vger.kernel.org
Subject: Re: [PATCH 13/20] lockd: move lockd_start_svc() call into lockd_create_svc()
Date: Fri, 2 Jun 2023 18:46:36 +0300 [thread overview]
Message-ID: <ZHoO3GRH6h/bcRjm@shredder> (raw)
In-Reply-To: <163816148560.32298.15560175172815507979.stgit@noble.brown>
On Mon, Nov 29, 2021 at 03:51:25PM +1100, NeilBrown wrote:
> lockd_start_svc() only needs to be called once, just after the svc is
> created. If the start fails, the svc is discarded too.
>
> It thus makes sense to call lockd_start_svc() from lockd_create_svc().
> This allows us to remove the test against nlmsvc_rqst at the start of
> lockd_start_svc() - it must always be NULL.
>
> lockd_up() only held an extra reference on the svc until a thread was
> created - then it dropped it. The thread - and thus the extra reference
> - will remain until kthread_stop() is called.
> Now that the thread is created in lockd_create_svc(), the extra
> reference can be dropped there. So the 'serv' variable is no longer
> needed in lockd_up().
Hi,
I'm seeing the following memory leak [1] after unmounting a network
share. High level bisection shows that it started between v5.16 and
v5.17. Using git bisect [2] I've pinpointed it to this patch.
Can you please look into it? I can easily trigger the issue and test
patches.
Thanks
[1]
unreferenced object 0xffff888123cd4a00 (size 512):
comm "mount.nfs", pid 7704, jiffies 4296498183 (age 933.141s)
hex dump (first 32 bytes):
20 97 05 a1 ff ff ff ff e0 0d 06 a1 ff ff ff ff ...............
00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N..........
backtrace:
[<ffffffff8186012a>] kmalloc_trace+0x2a/0xe0
[<ffffffffa0fc02d9>] __svc_create+0x59/0xa10 [sunrpc]
[<ffffffffa1345db7>] lockd_up+0xa7/0x4d0 [lockd]
[<ffffffffa13370b9>] nlmclnt_init+0xb9/0x3d0 [lockd]
[<ffffffffa142555a>] nfs_start_lockd+0x2ca/0x420 [nfs]
[<ffffffffa142a0c7>] nfs_init_server.isra.0+0x6e7/0x11e0 [nfs]
[<ffffffffa142cd0f>] nfs_create_server+0x16f/0x610 [nfs]
[<ffffffffa18a942b>] nfs3_create_server+0x1b/0x1b0 [nfsv3]
[<ffffffffa1465a11>] nfs_try_get_tree+0x4d1/0x9c0 [nfs]
[<ffffffffa14c0fc4>] nfs_get_tree+0xa94/0x15e0 [nfs]
[<ffffffff81a1530d>] vfs_get_tree+0x8d/0x2e0
[<ffffffff81aadf0a>] path_mount+0x136a/0x1e90
[<ffffffff81aaf998>] __x64_sys_mount+0x298/0x320
[<ffffffff82e3aa58>] do_syscall_64+0x38/0x80
[<ffffffff8300008b>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
[2]
$ git bisect log
git bisect start
# status: waiting for both good and bad commits
# bad: [f443e374ae131c168a065ea1748feac6b2e76613] Linux 5.17
git bisect bad f443e374ae131c168a065ea1748feac6b2e76613
# status: waiting for good commit(s), bad commit known
# good: [df0cc57e057f18e44dac8e6c18aba47ab53202f9] Linux 5.16
git bisect good df0cc57e057f18e44dac8e6c18aba47ab53202f9
# good: [22ef12195e13c5ec58320dbf99ef85059a2c0820] Merge tag 'staging-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
git bisect good 22ef12195e13c5ec58320dbf99ef85059a2c0820
# bad: [51620150ca2df62f8ea472ab8962be590c957288] cifs: update internal module number
git bisect bad 51620150ca2df62f8ea472ab8962be590c957288
# good: [3fb561b1e0bf4c75bc5f4d799845b08fa5ab3853] Merge tag 'mips_5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
git bisect good 3fb561b1e0bf4c75bc5f4d799845b08fa5ab3853
# good: [f56caedaf94f9ced5dbfcdb0060a3e788d2078af] Merge branch 'akpm' (patches from Andrew)
git bisect good f56caedaf94f9ced5dbfcdb0060a3e788d2078af
# bad: [cb3f09f9afe5286c0aed7a1c5cc71495de166efb] Merge tag 'hyperv-next-signed-20220114' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
git bisect bad cb3f09f9afe5286c0aed7a1c5cc71495de166efb
# good: [87c71931633bd15e9cfd51d4a4d9cd685e8cdb55] Merge branch 'pci/driver-cleanup'
git bisect good 87c71931633bd15e9cfd51d4a4d9cd685e8cdb55
# bad: [175398a0972bc3ca1e824be324f17d8318357eba] Merge tag 'nfsd-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
git bisect bad 175398a0972bc3ca1e824be324f17d8318357eba
# good: [59d41458f143b7a20997b1e78b5c15d9d3e998c3] Merge tag 'drm-next-2022-01-14' of git://anongit.freedesktop.org/drm/drm
git bisect good 59d41458f143b7a20997b1e78b5c15d9d3e998c3
# bad: [6a2f774424bfdcc2df3e17de0cefe74a4269cad5] NFSD: Fix zero-length NFSv3 WRITEs
git bisect bad 6a2f774424bfdcc2df3e17de0cefe74a4269cad5
# bad: [6a4e2527a63620a820c4ebf3596b57176da26fb3] lockd: move svc_exit_thread() into the thread
git bisect bad 6a4e2527a63620a820c4ebf3596b57176da26fb3
# good: [2a36395fac3b72771f87c3ee4387e3a96d85a7cc] SUNRPC: use sv_lock to protect updates to sv_nrthreads.
git bisect good 2a36395fac3b72771f87c3ee4387e3a96d85a7cc
# good: [d057cfec4940ce6eeffa22b4a71dec203b06cd55] NFSD: simplify locking for network notifier.
git bisect good d057cfec4940ce6eeffa22b4a71dec203b06cd55
# good: [5a8a7ff57421b7de3ae72019938ffb5daaee36e7] lockd: simplify management of network status notifiers
git bisect good 5a8a7ff57421b7de3ae72019938ffb5daaee36e7
# bad: [b73a2972041bee70eb0cbbb25fa77828c63c916b] lockd: move lockd_start_svc() call into lockd_create_svc()
git bisect bad b73a2972041bee70eb0cbbb25fa77828c63c916b
# first bad commit: [b73a2972041bee70eb0cbbb25fa77828c63c916b] lockd: move lockd_start_svc() call into lockd_create_svc()
next prev parent reply other threads:[~2023-06-02 15:46 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-29 4:51 [PATCH 00/20 v3] SUNRPC: clean up server thread management NeilBrown
2021-11-29 4:51 ` [PATCH 17/20] SUNRPC: move the pool_map definitions (back) into svc.c NeilBrown
2021-11-29 4:51 ` [PATCH 10/20] NFSD: simplify locking for network notifier NeilBrown
2021-11-29 4:51 ` [PATCH 19/20] lockd: use svc_set_num_threads() for thread start and stop NeilBrown
2021-11-29 4:51 ` [PATCH 02/20] SUNRPC: change svc_get() to return the svc NeilBrown
2021-11-29 4:51 ` [PATCH 03/20] SUNRPC/NFSD: clean up get/put functions NeilBrown
2021-11-29 4:51 ` [PATCH 12/20] lockd: simplify management of network status notifiers NeilBrown
2021-11-29 4:51 ` [PATCH 06/20] SUNRPC: use sv_lock to protect updates to sv_nrthreads NeilBrown
2021-11-29 4:51 ` [PATCH 01/20] NFSD: handle errors better in write_ports_addfd() NeilBrown
2021-11-29 4:51 ` [PATCH 07/20] NFSD: narrow nfsd_mutex protection in nfsd thread NeilBrown
2021-11-29 4:51 ` [PATCH 09/20] SUNRPC: discard svo_setup and rename svc_set_num_threads_sync() NeilBrown
2021-11-29 4:51 ` [PATCH 18/20] SUNRPC: always treat sv_nrpools==1 as "not pooled" NeilBrown
2021-11-29 4:51 ` [PATCH 14/20] lockd: move svc_exit_thread() into the thread NeilBrown
2021-11-29 4:51 ` [PATCH 05/20] nfsd: make nfsd_stats.th_cnt atomic_t NeilBrown
2021-11-29 4:51 ` [PATCH 15/20] lockd: introduce lockd_put() NeilBrown
2021-11-29 4:51 ` [PATCH 11/20] lockd: introduce nlmsvc_serv NeilBrown
2021-11-29 4:51 ` [PATCH 04/20] SUNRPC: stop using ->sv_nrthreads as a refcount NeilBrown
2021-11-29 4:51 ` [PATCH 08/20] NFSD: Make it possible to use svc_set_num_threads_sync NeilBrown
2021-11-29 4:51 ` [PATCH 20/20] NFS: switch the callback service back to non-pooled NeilBrown
2021-11-29 4:51 ` [PATCH 16/20] lockd: rename lockd_create_svc() to lockd_get() NeilBrown
2021-11-29 4:51 ` [PATCH 13/20] lockd: move lockd_start_svc() call into lockd_create_svc() NeilBrown
2023-06-02 15:46 ` Ido Schimmel [this message]
2023-06-02 21:28 ` NeilBrown
2023-06-03 9:33 ` Ido Schimmel
2023-06-03 14:58 ` Chuck Lever III
2021-11-29 17:45 ` [PATCH 00/20 v3] SUNRPC: clean up server thread management Chuck Lever III
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZHoO3GRH6h/bcRjm@shredder \
--to=idosch@idosch.org \
--cc=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox