From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758434AbbCDTQ6 (ORCPT ); Wed, 4 Mar 2015 14:16:58 -0500 Received: from mail-qa0-f48.google.com ([209.85.216.48]:62770 "EHLO mail-qa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755329AbbCDTQ4 (ORCPT ); Wed, 4 Mar 2015 14:16:56 -0500 Date: Wed, 4 Mar 2015 14:16:49 -0500 From: Jeff Layton To: Daniel Wagner Cc: Boaz Harrosh , Jeff Layton , , , "J. Bruce Fields" , Alexander Viro Subject: Re: [RFC v2 3/4] locks: Split insert/delete block functions into flock/posix parts Message-ID: <20150304141649.3d729c54@tlielax.poochiereds.net> In-Reply-To: <20150304125923.79c4e993@tlielax.poochiereds.net> References: <1425306313-7234-1-git-send-email-daniel.wagner@bmw-carit.de> <1425306313-7234-4-git-send-email-daniel.wagner@bmw-carit.de> <20150302195502.0c3a59e3@tlielax.poochiereds.net> <54F714B1.1070908@bmw-carit.de> <54F71DFE.8040703@gmail.com> <54F725A9.1050203@bmw-carit.de> <20150304125923.79c4e993@tlielax.poochiereds.net> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.26; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Mar 2015 12:59:23 -0500 Jeff Layton wrote: > On Wed, 4 Mar 2015 16:32:57 +0100 > Daniel Wagner wrote: > > > On 03/04/2015 04:00 PM, Boaz Harrosh wrote: > > > On 03/04/2015 04:20 PM, Daniel Wagner wrote: > > >> On 03/03/2015 01:55 AM, Jeff Layton wrote: > > >>> On Mon, 2 Mar 2015 15:25:12 +0100 > > >>> Daniel Wagner wrote: > > >>> > > > <> > > >> I have fixed that stuff and now I am testing it. Though it seems > > >> that there is a memory leak which can be triggered with > > >> > > >> while true; rm -rf /tmp/a; ./lease02 /tmp/a; done > > >> > > >> and this happens also without any of my patches. Still trying to > > >> figure out what's happening. Hopefully I just see a ghost. > > >> > > >> slabtop tells me that ftrace_event_field is constantly growing: > > >> > > > > > > check out the Kernel's leak detector it is perfect in showing you > > > what was the exact call stack of the leaked memory. > > > > Thanks for the tip. Will use it in future :) > > > > I have done a quick bisect limit the search on fs/locks.c. > > I suspect that the file_lock_context refactoring is the source of the leak. > > bisect agrees with me > > > > > > 8634b51f6ca298fb8b07aa4847340764903533ab is the first bad commit > > commit 8634b51f6ca298fb8b07aa4847340764903533ab > > Author: Jeff Layton > > Date: Fri Jan 16 15:05:55 2015 -0500 > > > > locks: convert lease handling to file_lock_context > > > > Signed-off-by: Jeff Layton > > Acked-by: Christoph Hellwig > > > > :040000 040000 4114db9392dc4dadb30664b71a954321e5e87bab 5b9abbaf1808a7c926c09fa2164044e0cc26fd54 M fs > > :040000 040000 bd569f527a195edf673c4f7d0e80bf356c7f8d1b 6362646e04dd83efc1a9e92877900797ac879e9a M include > > > > Thanks. I'll take a look. > Huh. I'm was a bit surprised by this as I didn't really touch how the fasync entries get handled. I added a bit of printk debugging (primitive, I know...) and I see this: [ 458.715319] lease_modify: calling fasync_helper on ffff880035a942d0 So, the fasync_helper getting called on the fasync entry, but it's definitely not getting freed. When I look at the object in the debugger, it looks like call_rcu has been called on it though: fa_file = 0x0, fa_rcu = { next = 0xffff8800ccd6a8a0, func = 0xffffffff8122b1c0 } ...it's almost like the rcu grace period isn't ending properly? I'll keep poking at though to see if I can figure out what's going wrong. -- Jeff Layton