I applied 2/4, 3/4 and 4/4 on top of kernel 6.6.41 and tested it under our work load, unfortunately leaks occurred. Here is what I got:
crash> p nfsd_file_allocations:a | awk '{print $NF}' | perl -e 'while(<>){ $sum += $_; } print $sum, "\n";' 114664232 crash> p nfsd_file_releases:a | awk '{print $NF}' | perl -e 'while(<>){ $sum += $_; } print $sum, "\n";' 114664221
So yes, 1/4 is needed for fixing the issue.
On Thu, Oct 3, 2024 at 9:54 AM Chuck Lever III chuck.lever@oracle.com wrote:
On Oct 3, 2024, at 3:19 AM, Greg Kroah-Hartman gregkh@linuxfoundation.org wrote:
On Wed, Oct 02, 2024 at 10:12:32AM -0400, Youzhong Yang wrote:
My understanding is that the following 4 commits together fix the leaking issue:
nfsd: add list_head nf_gc to struct nfsd_file https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
nfsd: fix refcount leak when file is unhashed after being found https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
nfsd: remove unneeded EEXIST error check in nfsd_do_file_acquire https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
nfsd: count nfsd_file allocations https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
The first two are essential but it's better to have the last two commits too.
So right now only the 2nd and 3rd are in the tree, do we really need the others as well? And if so, why were none of these marked for a stable inclusion?
IMO 1/4 and 4/4 are not needed in stable, and that's why we marked them that way.
-- Chuck Lever