From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED148C47076 for ; Tue, 12 May 2020 18:09:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B17DE20673 for ; Tue, 12 May 2020 18:09:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="JeNJEtRS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B17DE20673 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 43ADE9000DA; Tue, 12 May 2020 14:09:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3ECDA900036; Tue, 12 May 2020 14:09:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2DAE99000DA; Tue, 12 May 2020 14:09:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0004.hostedemail.com [216.40.44.4]) by kanga.kvack.org (Postfix) with ESMTP id 15F3F900036 for ; Tue, 12 May 2020 14:09:34 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id CD19B4DD0 for ; Tue, 12 May 2020 18:09:33 +0000 (UTC) X-FDA: 76808854626.23.shake24_8dac300277c52 X-HE-Tag: shake24_8dac300277c52 X-Filterd-Recvd-Size: 4192 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 May 2020 18:09:33 +0000 (UTC) Received: by mail-qk1-f175.google.com with SMTP id z80so9095938qka.0 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=tTwzH78phKiQkuU0WNC+IMXXGzN3t9gG+kMoFoDv1G8oxzs4r7oZAfy0NH7GXa1sTM Ku7kD9GS5ETPcQm2LuED6R1uPCWe4UAsmw7GLQ04N+OSAgGUGcJhNIdxKQePGj+unNx3 D89YoknBjpKmpneqYocODju5Jy1g4S6WWDduZZAzTevdjh/c5PkfNHdudshBaqs6Il3W tR1Net2r/qYLz1pCksNoWgbqWP8prNndaboDUfoUfi1mhV7w8QnjVtaOYpqD1CnpQDCL wG7ZvCVzBpt8Sg5CX3BoPHNb3O6uwDf6ZDQvqXAycvrneJ5sZnCYqGmVYiC4YMcwrBc1 Nr6w== X-Gm-Message-State: AGi0PuYbLW02Dy6z5sRzMF1wfi/qPuCBTzODWdH1BlKh13ZRTJ2legzL 0WXlFsZwSWIUGipSmhB33/wLX/OYVGiJAQ== X-Google-Smtp-Source: APiQypL89ez88XKLzXv1q7szzOQuFQVrwRlN6/zc1GhyQMbs6oD/nJj1F+lTqJMFbYd0PqxY91bmDw== 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) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > 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.=