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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 2AF33C43387 for ; Wed, 19 Dec 2018 11:59:01 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CFF20217D6 for ; Wed, 19 Dec 2018 11:59:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="n8PcL7So" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFF20217D6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.91) (envelope-from ) id 1gZaUj-0006Ir-VA; Wed, 19 Dec 2018 06:58:33 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1gZaUi-0006Il-HO for kernelnewbies@kernelnewbies.org; Wed, 19 Dec 2018 06:58:32 -0500 Received: by mail-wr1-x444.google.com with SMTP id r10so19212084wrs.10 for ; Wed, 19 Dec 2018 03:58:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zZH0BTPYxfU9EFIuspnr/ywT8OcoNawH0V3zd0do1+Q=; b=n8PcL7SoAHZbR5RHYcIz7goUd3kvpgLewCN9mqz984qobM/8apXmzITSLddRuJ6HdP R9CKTA3ATLjOmrzFOrD490Q+SRtF9LRdtEHYAtJHKzj+bBMEooTJIaccydn5GIEV/Nlr OmAauMuXX8YbJTDBvkp/9SsG+lVikx7UqfJogcaOb4eabxIeQcwERS4rD3Dua6W/9kNw Qj6pqPBXXEfY39FCZ952izb9EKsOB83VdJkQ9SQzxFiWIwHdP3ehNmPWR9pkMcciTfx4 /1AQNtwQdxXNuZ1a+Hvj0tXO3ezMPcIy7lr5Op6PdhrFp066l9p7ZwGcknvME/Wr/GTE 5LUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zZH0BTPYxfU9EFIuspnr/ywT8OcoNawH0V3zd0do1+Q=; b=JPhN1gbUSBxWq3JZW2fcCnCpUjyaHvRrcPP+ll5499Eeh+shMs93Rxk8orcm/56x9M izY0S6+iK6xza2Gm5iAlPfeSs5HnnV7fPnRt0RfwEAFWibDzdS6o2DV/pLVWi8Hd3Smz QXx50RWv8OwEdhwDhA5ToW1WD/sPOw7TDRsHixOvAYpJJmlr+rTYzT/ysoJ8kwdNQNGf 7L4tnwm5viWFloMzXBKiI5WJJDCkeN5s8YLxI+D20G/JjGAPlcpghQkPIYnobajoCcg0 dT2muBvOvp+/hO7WIWoVaJ+T78Qy3NNn9fXX0y9Fdud5D2rkJvLr8VgyxKOCIWyrxSvZ wfog== X-Gm-Message-State: AA+aEWbj5LwT5Rf8t17IhkxOoUTGYzGANYmmyw0/e1Vus8l2MWUGtBy2 PGLTKzUPv7ZHR2c3rIC34h9Y7P826FW42tFCXwc= X-Google-Smtp-Source: AFSGD/UlhTTs0WN228bF7I+vWTzdFVJ1Hn359LUieVq5SNPjmGn3XgBNF7ENPeMO2tqOhGvciP8pbVaKpfXskVbtAb8= X-Received: by 2002:adf:aa9c:: with SMTP id h28mr18054015wrc.216.1545220709033; Wed, 19 Dec 2018 03:58:29 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Naruto Nguyen Date: Wed, 19 Dec 2018 18:58:16 +0700 Message-ID: Subject: Re: How to detect slab memory leak To: Harsh Jain Cc: Mulyadi Santosa , kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Hi Harsh and Mulyadi, Thanks a lot for your reply. Just another question, in the slabtop output, I see that we have kmalloc-64 and kmalloc-96 cache, when these caches increase their size, is it calculated in the "cache" of the "free" command or in "used". Is it reclaimable? and count in SReclaimable or SUnreclaim of cat /proc/meminfo? I know some cache like dentry or inode cache will be calculated in "cache" of free command output and SReclaimable of cat /proc/meminfo and can be freed by "echo 3 > /proc/sys/vm/drop_caches" but not sure if it the same situation for kmalloc-64 and kmalloc-96 cache. Thanks again, Brs, Bao On Tue, 18 Dec 2018 at 15:31, Harsh Jain wrote: > > You can try kernel config option "CONFIG_DEBUG_KMEMLEAK". > > > https://www.kernel.org/doc/html/v4.10/dev-tools/kmemleak.html > > On Tue, Dec 18, 2018 at 1:14 PM Mulyadi Santosa > wrote: > > > > > > > > On Sun, Dec 16, 2018 at 1:25 PM Naruto Nguyen wrote: > >> > >> Hi everyone, > >> > >> When using slabtop to display the cache size growing, I see that > >> kmalloc-1024 and kmalloc-256 are increasing about 200MB after 1 hour. > >> Is there any way to detect which kernel components cause this slab > >> increase? > >> > >> Thanks a lot, > >> Brs, > >> Naruto > >> > > > > Hello Naruto > > > > I think you can do it by instrumenting call to kmalloc(). These days, eBPF is the hot stuff to try for this matter. See if it fits yours too. > > > > regards, > > > > Mulyadi > > > >> > >> _______________________________________________ > >> Kernelnewbies mailing list > >> Kernelnewbies@kernelnewbies.org > >> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > > > > > > > -- > > regards, > > > > Mulyadi Santosa > > Freelance Linux trainer and consultant > > > > blog: the-hydra.blogspot.com > > training: mulyaditraining.blogspot.com > > _______________________________________________ > > Kernelnewbies mailing list > > Kernelnewbies@kernelnewbies.org > > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies