Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3554989rdb; Wed, 13 Sep 2023 16:12:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeYufqDbGilx4ucDDHGlXlbeFCGCV4VsgOKMVWQN8zRCbsYa6c933XSz/K1T7d+oTEeadH X-Received: by 2002:a05:6a20:3d0f:b0:133:6e3d:68cd with SMTP id y15-20020a056a203d0f00b001336e3d68cdmr4184257pzi.3.1694646742386; Wed, 13 Sep 2023 16:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694646742; cv=none; d=google.com; s=arc-20160816; b=Ishq4xDl3yJk+xjfZQzIXPa0DzFsQsuFQEqvm9SeKm0QFGuQZa0gMlWzVEDGajr6V8 f3LU8hG9FGlEx96bKvttTbrpojCxdgUOCE1cjj103J8v2rufz9Vm5JBJmLqZAQ/fYcoA PpjYLbwRTfYGfeYzQUmr0CfKU46Cbv1HPwIVUEIW+yV5tanWXgMw257e9ypXJpoJb+Du DpW48Yz2UBRUdB1t9AHa5PcpJ1wJnCkAvVyedyCT43cJiep80QY5gx8w/zRvzxmdp1St wG2B9AFPcSNKjbirLIOW/T0Xg7mKuC4JBn66Ucfhib14xGH9n7izzpl8s9yhbzY3+hkR 9tMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=iAHlwDQj5aLs+kNJzI19rDW68TVeu+jwDvk+z6Yfntc=; fh=WjHOb0y/FYtZmaO/E8L4JCrnxMyERwu35tR6GaUdiBo=; b=rRqjU+aQUjN1/WJ0Pe1eak3psLsr756DDHaxhZ7/LPPI7Ec1upeu4Nrsc+gyoVCbQ4 Nhny8dTyHMfvmQ3/yi5YXlXdBP6h6q+taj+CWGnoOZeEN4Vg4EOZwyLX3l6rE9mqKOst F4+yR6BtUbH9P1Y3LYzKEm8cRwkWlEzlgcfkiG0DnAbsEp8vxuW5zN6Njt+BqjnzYFPl i/KoHaPTx46sIBfixn8YmVCLw6yHMxRHvnjNqkLC6WU/q1+BLVCn0kUphduPqBZR+Agy B15ftLes3VKjLWnlwJXCm0qlxBHUkP8aYvbyWaJCsFHI71kd34Sh6msE5uYEa8PXuCpJ xQjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=USZyy0qZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id v202-20020a6361d3000000b00563fbc0000csi162827pgb.254.2023.09.13.16.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 16:12:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=USZyy0qZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 973FF81129A5; Wed, 13 Sep 2023 10:07:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231512AbjIMRHz (ORCPT + 99 others); Wed, 13 Sep 2023 13:07:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231173AbjIMRHg (ORCPT ); Wed, 13 Sep 2023 13:07:36 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9CA81BD4 for ; Wed, 13 Sep 2023 10:07:32 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-53482b44007so4991453a12.2 for ; Wed, 13 Sep 2023 10:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694624852; x=1695229652; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iAHlwDQj5aLs+kNJzI19rDW68TVeu+jwDvk+z6Yfntc=; b=USZyy0qZ4kxahSLbvU+aUff1ZxPjz2gkGEw9o4gOHFFJ4cgUSwSBCikL8p2IwQe3yC lOZUT6sJkdwcIskTqerzeVM2MAW8bkhkhOFzsJLz8P8qTjYZ38vdcCwOMP3OWUZtRRK0 7Z3Ezcw4lyC111QSlwQhppUKEdg/I2Q0o9/pZTApVvDeuxzMBFecX2fFxwvJ6Pluc17n 5KBYfgWk6EimnFvTnyOUriDl/q30JZqhaunNxCXQQtibOm6r8lT4RNdbmIaHt7hQXNpC wpf60VKUBkr0xVbrKo1eiYlMmCsODiDUeKagZncqmO7qi6R4B+6+ylvLSzHsz7tNIiPJ SSrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694624852; x=1695229652; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iAHlwDQj5aLs+kNJzI19rDW68TVeu+jwDvk+z6Yfntc=; b=bIkufHBe/hk2qWiVd6uHRYTbCGIBaFbhxAtrQbLGUJTKN8EHHF4CNyXMH4RK6zD2+Y KitOlYud+OMCIO+iRdUK2UgKOq5Xg92ZiNfao/aHRE0Ijvat7yGAOjaOT2bQMHVsNrwB yewMManRS1q4XJpVD46Y6nH2Hp3egvYYsTrU67et+niXx+btr9w1fs6WgKr8pJ6PMtWI FAC3OTAax/AZedJg/svK8lY8LHjXBTvG9NY2/ItmerMJT5sVzLQ/SdenYa9AT6eE5/j8 WyudOIhmTPvyq6R7s1L660qtil3Xfat6ISEARsw1Lw9E3+sQUtVt+DMRt1OZUs9DWT04 a4tg== X-Gm-Message-State: AOJu0YwPCDGDDFqIbSmbdmFQnw+iKhVEHhNGgDAQqZ5SozUdZb/Pu2Rc jpbGqbEsAykF6lbUDPMZRNYLxfxyv82h8+Rjq7cAlSNy X-Received: by 2002:a17:90a:887:b0:268:37b:a10e with SMTP id v7-20020a17090a088700b00268037ba10emr2692968pjc.11.1694624852255; Wed, 13 Sep 2023 10:07:32 -0700 (PDT) MIME-Version: 1.0 References: <89c2f64120a7dd6b2255a9a281603359a50cf6f7.1693328501.git.andreyknvl@google.com> In-Reply-To: From: Andrey Konovalov Date: Wed, 13 Sep 2023 19:07:21 +0200 Message-ID: Subject: Re: [PATCH 05/15] stackdepot: use fixed-sized slots for stack records To: Alexander Potapenko Cc: andrey.konovalov@linux.dev, Marco Elver , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Sep 2023 10:07:58 -0700 (PDT) On Wed, Aug 30, 2023 at 10:22=E2=80=AFAM Alexander Potapenko wrote: > > On Tue, Aug 29, 2023 at 7:11=E2=80=AFPM wrot= e: > > > > From: Andrey Konovalov > > > > Instead of storing stack records in stack depot pools one right after > > another, use 32-frame-sized slots. > > I am slightly concerned about the KMSAN use case here, which defines > KMSAN_STACK_DEPTH to 64. Hm, indeed. KASAN also defines the depth to 64 actually. I think it's reasonable to change the default value to 64 to cover all the existing users. And whoever wants to save up on memory can change the Kconfig parameter (I'll add one as you suggested). > I don't have a comprehensive stack depth breakdown, but a quick poking > around syzkaller.appspot.com shows several cases where the stacks are > actually longer than 32 frames. Whichever value we choose, some of stack traces will not fit unfortunately. But yeah, 64 seems to be a more reasonable value. > Can you add a config parameter for the stack depth instead of > mandating 32 frames everywhere? Sure, will do in v2. > As a side note, kmsan_internal_chain_origin() > (https://elixir.bootlin.com/linux/latest/source/mm/kmsan/core.c#L214) > creates small 3-frame records in the stack depot to link two stacks > together, which will add unnecessary stackdepot pressure. > But this can be fixed by storing both the new stack trace and the link > to the old stack trace in the same record. Do you mean this can be fixed in KMSAN? Or do you mean some kind of an extension to the stack depot interface?