Received: by 10.223.164.202 with SMTP id h10csp2543573wrb; Mon, 27 Nov 2017 19:39:08 -0800 (PST) X-Google-Smtp-Source: AGs4zMZCLFxQZA7+ZIytmzra0eY4v1ZAn9HlxuT4Tkz2Jv/TNVwcoEw2AnlUNHQ6wwyPzZsHYXDk X-Received: by 10.99.176.69 with SMTP id z5mr26845211pgo.131.1511840348703; Mon, 27 Nov 2017 19:39:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511840348; cv=none; d=google.com; s=arc-20160816; b=DHYr+TjXM4x83OxgzU4+IWuqIaD5itE57YdVG32iCAIeJDvOaLGkD8SZX9/nfnTCmt 9fWmX3njU/YhhpbYM5sb9ZWVL/WtBp9sLsqJzVzTvXrjBhX2Zmcu98ccOCxEUdGhg3+H IPgqQ0nLClUWgKA9PpuQxyvju3Y0jxxtr46OYq5P/41vIxnwOKfWDc31PQ0Oh/dI7QEo oqgnTL4bxtO1rfuJKEQX9WUP6dlB0vvlEd8pE00IOUItqtKbTeNScEP7884wdnlWXzvt 2hE4l3XCKgWVqrDmO2AhP9PVKhUbY/GR4j2tnRzPv2k3XWtPgZda6Qk/dWO3g+J/SWIC HR/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=LBXg3GRr7m1ecqDzvqnhN68iL8xiJ9KGbroRl7FfhQE=; b=Mp9AktM+2W6pFkaQjQufIK3fKTBiu2/zlndfmy8jpxXO4BDgpvJWVM19wuRLSCHubK Zy2+oAiUbgLt/1yIqZCAvGMIDC7tGJQWF1UUgW+c6xd/w9uUMjZDcGANwQOkFmFk0xre 3mfOQaP5p1KT3dllEl5P0MTOtQqQzHqQ+GjP/UuLivjnu3x7BIU5NJZI0u5a9Bh5bnfn D0lFaZctJ5IVM5HOPM2mdU4QplhSLzR5bmSkqPBWnEUrubWUC9ars9lsjLbqabYYOrhO uwnl/q0+MO18kunykMY6INACSAgWZPCN+AoWaPdljoAzJ7ZvmhbJRyETyYyz9/8dP+PM ji1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=WCbahaig; dkim=pass header.i=@codeaurora.org header.s=default header.b=D8qv6aM4; 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 g3si18197010pld.709.2017.11.27.19.38.57; Mon, 27 Nov 2017 19:39:08 -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=pass header.i=@codeaurora.org header.s=default header.b=WCbahaig; dkim=pass header.i=@codeaurora.org header.s=default header.b=D8qv6aM4; 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 S1753678AbdK1Dh5 (ORCPT + 77 others); Mon, 27 Nov 2017 22:37:57 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:47600 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752277AbdK1Dhz (ORCPT ); Mon, 27 Nov 2017 22:37:55 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2EEE86A36F; Tue, 28 Nov 2017 03:37:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511840275; bh=8FGbV80ih2JPJ+okFhEtRxEi/QdkOXz5A0oYdOT9axU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=WCbahaig/i5hbvR64wF6NxdNSRk5gmL6VdYj8YiUQtVGLVGvaviae3mF2+JhFOT7b D2tt8pyrRId0mU1We0YyJ8h1LIQUP5eiD50CwK6sK1tYUP3qtYs4HisTixkR4UfuYk RrgfAkNLy8qykTcUHzLgzg/VlDJGcd4qGst19868= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.204.82.97] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vinmenon@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id DAEB068D18; Tue, 28 Nov 2017 03:37:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511840273; bh=8FGbV80ih2JPJ+okFhEtRxEi/QdkOXz5A0oYdOT9axU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=D8qv6aM4hUiOYdrBC1nrLtb4YnBhBcLvvdBHPNIQpMPwbGnw+1sevnwuH5gmvoFLk wC44x0UulWP4ZSVhO+ot0kGqrHcXsqdLGbeyDCLhd+IEE4cCzbQCBMQycU/V/TI3Xq GNRifWYW/URp48SV30XcT+W3gNAFR+7+0y/u1rr8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DAEB068D18 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vinmenon@codeaurora.org Subject: Re: [PATCH 1/1] stackdepot: interface to check entries and size of stackdepot. To: v.narang@samsung.com, Michal Hocko Cc: Dmitry Vyukov , Maninder Singh , "kstewart@linuxfoundation.org" , "gregkh@linuxfoundation.org" , "jkosina@suse.cz" , "pombredanne@nexb.com" , "jpoimboe@redhat.com" , "akpm@linux-foundation.org" , "vbabka@suse.cz" , "guptap@codeaurora.org" , AMIT SAHRAWAT , PANKAJ MISHRA , Lalit Mohan Tripathi , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , kasan-dev References: <20171124124429.juonhyw4xbqc65u7@dhcp22.suse.cz> <20171123162835.6prpgrz3qkdexx56@dhcp22.suse.cz> <1511347661-38083-1-git-send-email-maninder1.s@samsung.com> <20171124094108epcms5p396558828a365a876d61205b0fdb501fd@epcms5p3> <20171124095428.5ojzgfd24sy7zvhe@dhcp22.suse.cz> <20171124115707epcms5p4fa19970a325e87f08eadb1b1dc6f0701@epcms5p4> <20171124133025epcms5p7dc263c4a831552245e60193917a45b07@epcms5p7> From: Vinayak Menon Message-ID: Date: Tue, 28 Nov 2017 09:07:46 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171124133025epcms5p7dc263c4a831552245e60193917a45b07@epcms5p7> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/24/2017 7:00 PM, Vaneet Narang wrote: > Hi Michal, > >>>  We have been getting similar kind of such entries and eventually >>>  stackdepot reaches Max Cap. So we found this interface useful in debugging >>>  stackdepot issue so shared in community. >   >> Then use it for internal debugging and provide a code which would scale >> better on smaller systems. We do not need this in the kernel IMHO. We do >> not merge all the debugging patches we use for internal development. > `  > Not just debugging but this information can also be used to profile and tune stack depot. > Getting count of stack entries would help in deciding hash table size and > page order used by stackdepot. > > For less entries, bigger hash table and higher page order slabs might not be required as > maintained by stackdepot. As i already mentioned smaller size hashtable can be choosen and > similarly lower order pages can be used for slabs. > > If you think its useful, we can share scalable patch to configure below two values based on > number of stack entries dynamically. > > #define STACK_ALLOC_ORDER 2 > #define STACK_HASH_SIZE (1L << STACK_HASH_ORDER) It will be good if this hash table size can be tuned somehow. When CONFIG_PAGE_OWNER is enabled, we expect it to consume significant amount of memory only when "page_owner" kernel param is set. But since PAGE_OWNER selects STACKDEPOT, it consumes around 8MB (stack_table) on 64 bit without even a single stack being stored. This is a problem on low RAM targets where we want to keep CONFIG_PAGE_OWNER enabled by default and for debugging enable the feature via the kernel param. I am not sure how feasible it is to configure it dynamically, but I think a hash_size early param and then a memblock alloc of stack table at boot would work and help low ram devices. Thanks, Vinayak From 1584955497770827380@xxx Fri Nov 24 13:49:10 +0000 2017 X-GM-THRID: 1584763196629983480 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread