Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2915003ybk; Tue, 12 May 2020 11:11:39 -0700 (PDT) X-Google-Smtp-Source: APiQypLV61DchpyBY9u1eUa6YmqJ8a+z7EIjEwFjdj7/y6WT7dIdtn7WlFUHwd9EWAY9l+vjW3p7 X-Received: by 2002:a05:6402:1a2f:: with SMTP id be15mr19453902edb.385.1589307099323; Tue, 12 May 2020 11:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589307099; cv=none; d=google.com; s=arc-20160816; b=vKFKtyZgV3lypypaDAzYmc0qDF8nxhuJWat7jw8mIN/pClxY0WcNKC7NbGhhoTelUq /UsbSmt8qveNDKSB4HLBmPLZoko9Q7rNLLdVhdDNsUcGNVdjy2OpUL2ZxAT8Y67wOXg7 1xFjwVust5EXOMGXlGwSfFUJSeKV4NPMOwI7enpYP1cAmWjSH8NvkCguVoBC+pphMmRe Sp18344lMHzn3Ilm6isfoqGdZkAig9M8Fbzs+wAan7GDq1YA9EYbeve/tvBXwqkpVSZT y8RKS02morwAVmOlQrpDIQ4xe9RKPWgZn7W+Brg6uvNr/UnxOUtcLOEwgwVDKO1eK23z da4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=fw0mhRHjB0Y+7l+AID2aLmXiWkjNKhnoC4UhC7gwssg=; b=wNx954zq1Yd5OBWOkxmYOs/RXx2d33JtEwuQwpDSs43CIc/b0IIdaeNJQcFqQrv12E rntO42+eWCmJvRiooRFP9PZDfSBfOO+dRqkJpu3CeyU6fxlG8n3uxZW4w40D3WiZ27d7 TjdngP2CBHJUVaITLnEIRxFGgpKdxMsFHdK86FLzVAyyuyFSSvjEEqO0+9+FsZvJii7K DDFZphbX9MfII1F3EwD/Zs8Z0TQeqvXjpUEqg6KEIG9KEOOL6tfNLr98RvPM67gFoT2/ lKB36WlefkFybmsormIR64qXN02rVdkYf+tIvMBURsEHQjKMrOFo2xLOWk8FMuFKKyrm PjOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=JeNJEtRS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v26si8316243eje.322.2020.05.12.11.11.16; Tue, 12 May 2020 11:11:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=JeNJEtRS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728113AbgELSJe (ORCPT + 99 others); Tue, 12 May 2020 14:09:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbgELSJd (ORCPT ); Tue, 12 May 2020 14:09:33 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F1DAC061A0C for ; Tue, 12 May 2020 11:09:33 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id f189so8946197qkd.5 for ; Tue, 12 May 2020 11:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=fw0mhRHjB0Y+7l+AID2aLmXiWkjNKhnoC4UhC7gwssg=; b=JeNJEtRSwJAHNNTz/K8kGHym+MMr/c+i4V2pS3G2g7vrOVKBJFj2ZciHOA/U2eIv1i nQ9DNPocygaVtyWonaj9MzhFteaFA0n1sSb6TnOCUDw66y8sMc40c8gL2ofgkoM5G3zy 0gmRwZhtkvwoXy5h1Z9/a/M9sc828DkLGJSscBTL/btiKimL5lbBorSsmpOEWV2d4BrD 8AAVM/5czOorxoihZATpY/7c2QheeOyzLoZiWcclZ9sdbA6ySuuNmZHBREvgog2wa0/O SDXoF3BC3fYsv9CbQnEj9HlgplFa+QkwJtf1K3YX7jSBs41hYh+KuUV+7Moo4o8nDYS7 WcSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=fw0mhRHjB0Y+7l+AID2aLmXiWkjNKhnoC4UhC7gwssg=; b=KAvf7s3XQg4ah/PCo9fmSpW/suH6PeF4gf+IlDMuD3QQjFHmrsU74blBYyNQzHgXdZ L+kfWwNHxdijZlQlakw/CpiWKK1QpFL5TkH9NZDU3QpkbF59RWDjqWwdB5Eb1YXEQZnk Gc6CTMrqUglFzclLCrkgN+JIpLEjo7KRme9hWGxkjaZ08yp9zkMnDP3cw5fO4qhsN7NJ MinJGzQqjQpggXt08Ya3CqD8oHWNckFjxLyM89E8pKJbKqLWTgrD+DQ8KV8jFofum8rW BFEkMrzuskO68c1NAfj6rl6jP5J3r2JYGh6a5qOt/iL4iapItvOfS9Uzt4LnhHLBW+pH TDyQ== X-Gm-Message-State: AGi0PuamDzYXTLYDaatOaYE4U2RhngBuwollq7guiUjdD8hqHooyaFAP KPOSAnkS9hXUaEcVdvP6sGixNrFJMbP2lw== X-Received: by 2002:a37:8786:: with SMTP id j128mr22665963qkd.63.1589306972618; Tue, 12 May 2020 11:09:32 -0700 (PDT) Received: from [192.168.1.183] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id i23sm11817133qke.65.2020.05.12.11.09.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 May 2020 11:09:31 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Qian Cai Mime-Version: 1.0 (1.0) Subject: Re: Kmemleak infrastructure improvement for task_struct leaks and call_rcu() Date: Tue, 12 May 2020 14:09:30 -0400 Message-Id: References: <20200512141535.GA14943@gaia> Cc: Linux-MM , LKML , "Paul E. McKenney" In-Reply-To: <20200512141535.GA14943@gaia> To: Catalin Marinas X-Mailer: iPhone Mail (17D50) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On May 12, 2020, at 10:15 AM, Catalin Marinas wr= ote: >=20 > In this case it uses kref_get() to increment the refcount. We could add > a kmemleak_add_trace() which allocates a new array and stores the stack > trace, linked to the original object. Similarly for kref_put(). >=20 > If we do this for each inc/dec call, I'd leave it off as default and > only enable it explicitly by cmdline argument or > /sys/kerne/debug/kmemleak when needed. In most cases you'd hope there is > no leak, so no point in tracking additional metadata. But if you do hit > a problem, just enable the additional tracking to help with the > debugging. Well, we would like those testing bots to report kmemleak (I knew there woul= d be many false positives) with those additional information of refcount lea= ks in case they found ones, albeit never saw one from those bots at all yet.= Since some of those bots will run fuzzers, so it would be difficult to repro= duce. Thus, the option has to be enabled by default somehow. Otherwise, they= could easily miss it in the first place. I=E2=80=99ll look into the see if w= e could make it fairly low overhead.=