Received: by 10.223.185.116 with SMTP id b49csp5360319wrg; Wed, 7 Mar 2018 10:24:28 -0800 (PST) X-Google-Smtp-Source: AG47ELspu1gk1Ccp6Zw4KqQkfI/h4hCpuOFJRVVIMfgV0JTuE5eiGCOz6b8BQ/MURlFnDLD4MZbs X-Received: by 10.101.66.193 with SMTP id l1mr18656764pgp.57.1520447068013; Wed, 07 Mar 2018 10:24:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520447067; cv=none; d=google.com; s=arc-20160816; b=N8KvYIPM772TJvdYbGH+MWMt1xK8igLsKzCq63xHBTPyMV/VqoY+rp5wGm8bXN2U3K yG/svbs8m4FJgondpXxv7hjy/BsHP1X1e6K9NvuS5Ic0Gca4M+XXRi0Ij7glU/jJ2PlX VChdH2naq31JT7s4x4TSo9D8hMg5AH7/4Jh0J1PSMyS7aXzSS+n3d0WQNqVKikPkYoKo 7ktWHULAlLbNGQCtFB6KF4bM34EwAxL5CMPh3Hp9b0YKiTmTxxIoG4PlNOToqp+hYcFW tatMyy1/q37ViiQMAf+nyn+QyG9vj1BADcXVX1WFYI1CetafGfrWS45NELif6X/lOyeW Bivw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=C3l/Q6YhSNvMi5I8Pi37g7lhug6kuwLbnGOhF6eH1f4=; b=hB5FSm8AFGyhB3m6Mxf8Kr8ikwqDjwwi+miiN4porpOe128NZGXTae4NkGQnLcSjAu W1J3G/KU/p7qn0uXF1cjN1/IcP+qkrVa1xsbgRnmZaq6XgshwwJnP09X1tV4hBSrKqZi Lionoek2l8g1m5DLAg6/0JAT79r/2yf5LlL9pWBu3LBaku2uQ/3bO0fJfYLzdk24MwDB Xw0+ZlwQroKhHBKsvW01sl5HWv/+T7vuI64c72re+9Tj1NOJemEetWOTRmi3B2tp0Rww tQ1qQD7aGXZl96ugQGjnOthwpT+++2RnFeDVEKbY7DUqesb+pZmzaGZVf5rxMIlrICh+ f3qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rLnlWXy+; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si11578216pgf.713.2018.03.07.10.24.12; Wed, 07 Mar 2018 10:24:27 -0800 (PST) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rLnlWXy+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933674AbeCGSW2 (ORCPT + 99 others); Wed, 7 Mar 2018 13:22:28 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:51212 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754547AbeCGSWR (ORCPT ); Wed, 7 Mar 2018 13:22:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=C3l/Q6YhSNvMi5I8Pi37g7lhug6kuwLbnGOhF6eH1f4=; b=rLnlWXy+Wdgd7s0sFW4ZAhhR3 dQPY//mpSqncZuf5IS3sM1PHOEVJRFMdPnQFpioEitnEB/ksYrTL+0gTIdgs1Y1HP+Vmz8L9+2JfL +UdPEpY5aH7SdNotxVZelXETy7i9TBEWeDQu+9v5lHhVqWnXst5uFs3ZvZGXk2lN/hr8FMCxhfj92 pnA9JG5q8KgRHvFh6npyDKAeQgQmCGnnaXoSXO41LKaWK94Dn6Zh1IhbtezKoNaB7oH2J2vGQuSqp FMPpqjp1me8L6jAK0art8KSKnGpCeyYfKxlotmiidza1w+vvlNR+yeqbrvy4GbL2ebzsuVwP9lgvi X6CMDWyFA==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1etdhd-0007Dv-7d; Wed, 07 Mar 2018 18:22:13 +0000 Date: Wed, 7 Mar 2018 10:22:12 -0800 From: Matthew Wilcox To: Christopher Lameter Cc: Chintan Pandya , penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] slub: Fix misleading 'age' in verbose slub prints Message-ID: <20180307182212.GA23411@bombadil.infradead.org> References: <1520423266-28830-1-git-send-email-cpandya@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 07, 2018 at 12:13:56PM -0600, Christopher Lameter wrote: > On Wed, 7 Mar 2018, Chintan Pandya wrote: > > In this case, object got freed later but 'age' shows > > otherwise. This could be because, while printing > > this info, we print allocation traces first and > > free traces thereafter. In between, if we get schedule > > out, (jiffies - t->when) could become meaningless. > > Ok then get the jiffies earlier? > > > So, simply print when the object was allocated/freed. > > The tick value may not related to anything in the logs that is why the > "age" is there. How do I know how long ago the allocation was if I look at > the log and only see long and large number of ticks since bootup? I missed that the first read-through too. The trick is that there are two printks: [ 6044.170804] INFO: Allocated in binder_transaction+0x4b0/0x2448 age=731 cpu=3 pid=5314 ... [ 6044.216696] INFO: Freed in binder_free_transaction+0x2c/0x58 age=735 cpu=6 pid=2079 If you print the raw value, then you can do the subtraction yourself; if you've subtracted it from jiffies each time, you've at least introduced jitter, and possibly enough jitter to confuse and mislead.