Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1127763pxu; Thu, 17 Dec 2020 02:57:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPAdii4h52Uw6TaPuaQuslRYfmeUZgeM3IHSBOnY2V//6BKp1rZQs9kuAFFoXGs9Mu2Pfw X-Received: by 2002:a17:907:435c:: with SMTP id oc20mr35638762ejb.286.1608202657937; Thu, 17 Dec 2020 02:57:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608202657; cv=none; d=google.com; s=arc-20160816; b=oIq31DBoyLyHqe5pJK0aDWUtORBMuc5lMbBRS8QHPOm5O9IAdRBTtOHBZLAc9BaJGA ekL9vEJpRWSmTtq2f4ZnqmqPjR3BPO7ffUz9HPji9WxByWTmDm5D2BMnz4GaNHeovpii jH0Y02aZWqVbauloLT72yb2+INuViuiZQely+7ljibNeFLh4GWGzJ9t1LAw5nGW7luUT 6O364wMqQD+h0JOFktofioiEWEqRzpZSmipsr8yI3L6/0zDXQhryXH/C57OrQTdMLyfN sZGJgftrFIbtXpssx71UEkIY2uLsdd3+kjQwTyIoENEuP5lHmYzLZ9VZweyOSAATihTT jbxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sh6ZnsaNRvH6fFObdqzFfNsJfBDLItS7EZc+yZ7OoyM=; b=gpsYnu1w9YOHQU7OsejlieltPJfcm2rWUEzBtlJlGbXDsEDUwTTuYk+LsXFCNADrn9 Mk7VY6lrSyxSz1zA6FSHHAqsBnInBfzGPBcikodqqn9dyVjwdMqOITsmSbjIoWtXShvR SUpeZDW76OCKRPlUEy30c0cI1X/duZYG0y/xD4GCCK5KmpXF55AFIwAFI6grMe97qLoV oQun068U1bncKWwjNaZ25EHrUpObHAFbgOC+lH+PmiKxzrIXqO10JI7SsC9I5TrWgehL b8oRY8OCRopMtYK9KWlvRyoeevvn69RxbFU5Lu4j46i4gYVHoMlx7M+OTQpEpOjt6L6q YcYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cktvz8iy; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co1si4123024edb.571.2020.12.17.02.57.14; Thu, 17 Dec 2020 02:57:37 -0800 (PST) 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=@google.com header.s=20161025 header.b=cktvz8iy; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728041AbgLQKza (ORCPT + 99 others); Thu, 17 Dec 2020 05:55:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbgLQKz3 (ORCPT ); Thu, 17 Dec 2020 05:55:29 -0500 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C16C0617B0 for ; Thu, 17 Dec 2020 02:54:49 -0800 (PST) Received: by mail-qt1-x82c.google.com with SMTP id 7so19797926qtp.1 for ; Thu, 17 Dec 2020 02:54:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sh6ZnsaNRvH6fFObdqzFfNsJfBDLItS7EZc+yZ7OoyM=; b=cktvz8iyymm/hF3fCobUejCYA6uMLR/8L0y78pCxB2LCyGdpY8uwRvyMTtL6sH3Q8G QKcp4htfA64JxcyeqV6TnQ1/ZBmTxDCWvxJaStyD3mZfss32yIHmhu4w9w+GwisrUhUO NE1c5l7tsc5pd57P4yQYK3kiIbFtOcL8pcjpL8/TA/1oLhYftAw+JkipXckCzd+v+l8c oZfLiXm6H0N8f4uihVkc1KxsC/6WJ50qdrk8ReW2eyS3uY16s8jq8ru7KfLq3eKLjzDy ACAwUSa4Mcnk45hZCaPq/aBNw40YfnD4P56Km/s2nqsb/9wb8EefACLkzj9yzQMutoMf qV4w== 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=sh6ZnsaNRvH6fFObdqzFfNsJfBDLItS7EZc+yZ7OoyM=; b=bSqAote0d7MX9u3NOsxwStQbcLRQsXwrQCvVsh34YCm2feO3e6NBzYXpnl7GYQg6AU zfuTNyz2oxHOOrO4hg2+I0/eBOZrV+5ki8j2h4dYihoNdO2vW4PCSuI5WjjrGKeso+Iw er87V6rZGj8W1kqnl6cg4wd7CPAK8Sxic/CUsmxLFdfBA1JgfQUCaLrMW3kWy1it4erc 2F68PtVEEpIomXLVzcluv0YB+I5HO6L1rP1m6btE3aE+4AD5/aF8zj7g9KSIlyqIyYQA AD0hxBGgfk+KrMt4aNi5T0UciAw50rf4RT+KJh+8odoeUPs9rfKVZhSSKhjVuLnaRF3d EVfw== X-Gm-Message-State: AOAM531mxj+AU6Y45Mideik55iA0OWDzaOjl+OyViiOGc7ZuYwjfpaF8 WbxiXpTtTXgdRTv/SVJLN6GnPcJj0NjKdnTRvXENGg== X-Received: by 2002:ac8:6f3c:: with SMTP id i28mr46368743qtv.8.1608202488317; Thu, 17 Dec 2020 02:54:48 -0800 (PST) MIME-Version: 1.0 References: <1607576401-25609-1-git-send-email-vjitta@codeaurora.org> <77e98f0b-c9c3-9380-9a57-ff1cd4022502@codeaurora.org> <6cc89f7b-bf40-2fd3-96ce-2a02d7535c91@codeaurora.org> <255400db-67d5-7f42-8dcb-9a440e006b9d@codeaurora.org> <7f2e171f-fa44-ef96-6cc6-14e615e3e457@codeaurora.org> <601d4b1a-8526-f7ad-d0f3-305894682109@codeaurora.org> <9e0d2c07-af1f-a1d3-fb0d-dbf2ae669f96@codeaurora.org> In-Reply-To: <9e0d2c07-af1f-a1d3-fb0d-dbf2ae669f96@codeaurora.org> From: Alexander Potapenko Date: Thu, 17 Dec 2020 11:54:36 +0100 Message-ID: Subject: Re: [PATCH v3] lib: stackdepot: Add support to configure STACK_HASH_SIZE To: Vijayanand Jitta Cc: Minchan Kim , Vincenzo Frascino , dan.j.williams@intel.com, broonie@kernel.org, Masami Hiramatsu , LKML , Andrew Morton , Andrey Konovalov , qcai@redhat.com, ylal@codeaurora.org, vinmenon@codeaurora.org, kasan-dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Can you provide an example of a use case in which the user wants to > > use the stack depot of a smaller size without disabling it completely, > > and that size cannot be configured statically? > > As far as I understand, for the page owner example you gave it's > > sufficient to provide a switch that can disable the stack depot if > > page_owner=off. > > > There are two use cases here, > > 1. We don't want to consume memory when page_owner=off ,boolean flag > would work here. > > 2. We would want to enable page_owner on low ram devices but we don't > want stack depot to consume 8 MB of memory, so for this case we would > need a configurable stack_hash_size so that we can still use page_owner > with lower memory consumption. > > So, a configurable stack_hash_size would work for both these use cases, > we can set it to '0' for first case and set the required size for the > second case. Will a combined solution with a boolean boot-time flag and a static CONFIG_STACKDEPOT_HASH_SIZE work for these cases? I suppose low-memory devices have a separate kernel config anyway? My concern is that exposing yet another knob to users won't really solve their problems, because the hash size alone doesn't give enough control over stackdepot memory footprint (we also have stack_slabs, which may get way bigger than 8Mb).