Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1468039pxb; Thu, 14 Apr 2022 06:57:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMe0naZf+XofWZrJp1bOCjknmwDBwgGIEoXuK7nG+8rQSPxkq57EC4Nwsh3GqFQo7Ufey1 X-Received: by 2002:a17:90a:1b02:b0:1cb:a256:c0a7 with SMTP id q2-20020a17090a1b0200b001cba256c0a7mr3769071pjq.185.1649944646206; Thu, 14 Apr 2022 06:57:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649944646; cv=none; d=google.com; s=arc-20160816; b=HPHq8ZHuZnM2eVhP1KxzsBTBm7WaFooBTuL9ms+SOh2sZfR72kWKdaSsH3anNMRMMh vBs+7cjl0VlmQ2CkFFyO9/qaxG8wx3+wts82MCbpY6z+7qcBF1MxTMNoAAKNoqSJVcRP yDDX92Nj9LuLQNVYFFOHTSWxWOPkPNjxFxwco7cZNgbyOIiqHzK2p+c+/uLdUSG//z+y 4R3bBDpUDDllPp7lPyiAnB3S3DzTq4kGxQfAMgq+GKYleW6dhgYXkaUu6mWXMsy+r677 h9l1TXRnqO7CrePU79XidblXjMVCH24Utrk4pfQnbMYg0rFgqqYY9W9K68Df9uPJ4T/O JRcA== 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; bh=4uCfkN0nKML0LYVm4ermKD3fNv7kg9rQw/xGF79dKdI=; b=s5OG3bUHUywV3Fsksnh1WhIPPqT/wAtZjLIbGTj2SW+IH0kh6i0tA9Pju2uAkQAYEs 6xaAblNQf2yOV9ieVVZcXSfl4zjv/lnuMpX1QDl+FefVsnUwKCTFYG3tUMeSozeV/bFf U7SRHfLgZqZ3z1QX8iFfdz8LaZxgQoC0jJEpp3EHBXZLu0VGZg50QPKloe0FkQaklBpF WcEmWHin0+gnI5myn/yUZ5rgHSvRPYTUC+dvTLdavLUStbTuYrYqKurdeGU53eQMlivC Filwf51muBWWmh28J/QULcmOBHhU8cR32qd0ZlxJMiAy/op36UuDkRMAgw2Pf0rfZSUN HMgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9-20020a170902ed8900b00153b2d165c0si16593779plj.456.2022.04.14.06.57.11; Thu, 14 Apr 2022 06:57:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237483AbiDMUzI convert rfc822-to-8bit (ORCPT + 99 others); Wed, 13 Apr 2022 16:55:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231935AbiDMUzA (ORCPT ); Wed, 13 Apr 2022 16:55:00 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50AAC51E54; Wed, 13 Apr 2022 13:52:36 -0700 (PDT) Received: from mail-wr1-f53.google.com ([209.85.221.53]) by mrelayeu.kundenserver.de (mreue009 [213.165.67.97]) with ESMTPSA (Nemesis) id 1Myb8P-1nsx2d3BBV-00yvqp; Wed, 13 Apr 2022 22:52:34 +0200 Received: by mail-wr1-f53.google.com with SMTP id p18so3497398wru.5; Wed, 13 Apr 2022 13:52:34 -0700 (PDT) X-Gm-Message-State: AOAM532MGznbL9PtJVRpWYbGAZndxNBeukYfaIEqqVzDKOWc+OEpBtWK swVjmukK9ZZY1U7/z7dDRWGR9kb10rlwvOhRmEA= X-Received: by 2002:adf:d081:0:b0:1ef:9378:b7cc with SMTP id y1-20020adfd081000000b001ef9378b7ccmr462036wrh.407.1649883154251; Wed, 13 Apr 2022 13:52:34 -0700 (PDT) MIME-Version: 1.0 References: <20220412231508.32629-1-libo.chen@oracle.com> <20220412231508.32629-2-libo.chen@oracle.com> <157cb46a-d134-2e72-4a65-14e378dd2b8e@oracle.com> <26855467-107d-4ba1-4f32-2afd5918d5b7@infradead.org> <4c6b3445-78b2-090f-c7c9-291d49c45019@infradead.org> <506db9a9-47ff-658a-a821-27315949e8c3@oracle.com> <8eb6f58a-2621-0977-1b67-b2c58e4d5fba@infradead.org> In-Reply-To: From: Arnd Bergmann Date: Wed, 13 Apr 2022 22:52:18 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RESEND 1/1] lib/Kconfig: remove DEBUG_PER_CPU_MAPS dependency for CPUMASK_OFFSTACK To: Libo Chen Cc: Randy Dunlap , gregkh , Masahiro Yamada , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Vlastimil Babka , Andrew Morton , Linux Kernel Mailing List , Linux Kbuild mailing list , Linux ARM , linux-arch Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K1:An3chnDGr1I8GidqyoHMbUplRNrokioKZVAGUfv66V3JMecg+No sNolDVZPTC/ZVyhJUrj19SvIf1xEDrFAShmWPhA/y6jmjw1qJcwZKq6fpqCgmaYpIApRuNQ fnXgt/lSyOrtfTLak9FxaoHI4chxAkrRsCS8dyIQCdqCQeqSnz5X+ZbdW6qnsvO4v+0CVJR qLjxUzh/DtCeoEEXhpLuA== X-UI-Out-Filterresults: notjunk:1;V03:K0:ZaJVOHwGEHc=:qYZPjyFXn97Lj6M0vBV557 v5UkizLwpjBfYdpvonA9+0JiH9z1HRVAJpcIrFntInR8ckzX/JNULkvBccLJa3nWbz7mL3KPI PKwnwUIWBEeJrB1FMxoCmEl4z48hM406OJgS0KKWMELL53Xk7d7/AdKWzZBym7fp6YmzR2+Y3 ZoCOrVlVmJpMb9nVOREPaFo3LwCqNk2ri067LuEpsoObFMJQHxjbrA8bx5oDn9ub89TmnY2gP 6zFZrZ8PfzMLtAAmzUSMw/V47IoS/R3dfHuQf60lOYLsi5DAnV9xj+WM5r9pcBm3x1IJyjUNU iVi2sh0ce9OF+mNc2Nu8F9hGqlC4lGcw7eRUZ51EFiQKQFLxb5DA7U+10M6uoaoZftz7Jz8vL TowPbbLIQIgPfMPNB9YG0SQKDOZeCvemDZnXRBh1+9aBgShMkDc9jU3RBencE7pd2Hl+diXsc mqRyRLp7AIi/YgpMdSx9gbKXwKPMmWMv0GVKHdGcKkRRn+KSGk6K+ec7PyzZLbrWMaFCaiqxJ hR37tX1T/gCDNoWAP5Svngf8MjxMSJMAYIZ67+YkOwOREzeqBYCTpRlPVB132zfpa/7Zgy/8n u0h/BiVSMTy6j+Xdy9hiOz9bFpNi5TK9BWNHvGPsH8ZJZG6bsNSoCGyWKx+JkqgIQZrm89oIV oEAfJOkcY4n4Hs3aNyYbEz26FPzGsE1XqPaXqHyFOCVa6IZo7rEwAJsQ/FILGMNhyD5wtJqAN +New10xZ6/tS5A/b6TghVexmE4ujumqYrQGdyjoCxDFp7oag9J+xoErJi4nVjxrtBRv5hWeoP a0PK4JJ4i1IzQpGfVtdHC5qD/nZPh16wOYVT+QXl0JPQbBhcoQ= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 13, 2022 at 9:28 PM Libo Chen wrote: > On 4/13/22 08:41, Randy Dunlap wrote: > > On 4/12/22 23:56, Libo Chen wrote: > >>> --- a/lib/Kconfig > >>> +++ b/lib/Kconfig > >>> @@ -511,7 +511,8 @@ config CHECK_SIGNATURE > >>> bool > >>> config CPUMASK_OFFSTACK > >>> - bool "Force CPU masks off stack" if DEBUG_PER_CPU_MAPS > >>> + bool "Force CPU masks off stack" > >>> + depends on DEBUG_PER_CPU_MAPS > >> This forces every arch to enable DEBUG_PER_CPU_MAPS if they want to enable CPUMASK_OFFSTACK, it's even stronger than "if". My whole argument is CPUMASK_OFFSTACK should be enable/disabled independent of DEBUG_PER_CPU_MASK > >>> help > >>> Use dynamic allocation for cpumask_var_t, instead of putting > >>> them on the stack. This is a bit more expensive, but avoids > >>> > >>> > >>> As I said earlier, the "if" on the "bool" line just controls the prompt message. > >>> This patch make CPUMASK_OFFSTACK require DEBUG_PER_CPU_MAPS -- which might be overkill. > >>> > >> Okay I understand now "if" on the "boot" is not a dependency and it only controls the prompt message, then the question is why we cannot enable CPUMASK_OFFSTACK without DEBUG_PER_CPU_MAPS if it only controls prompt message? Is it not the behavior we expect? > > Yes, it is. I don't know that the problem is... > Masahiro explained that CPUMASK_OFFSTACK can only be configured by > options not users if DEBUG_PER_CPU_MASK is not enabled. This doesn't > seem to be what we want. I think the correct way to do it is to follow x86 and powerpc, and tying CPUMASK_OFFSTACK to "large" values of CONFIG_NR_CPUS. For smaller values of NR_CPUS, the onstack masks are obviously cheaper, we just need to decide what the cut-off point is. In x86, the onstack masks can be selected for normal SMP builds with up to 512 CPUs, while CONFIG_MAXSMP=y raises the limit to 8192 CPUs while selecting CPUMASK_OFFSTACK. PowerPC does it the other way round, selecting CPUMASK_OFFSTACK implicitly whenever NR_CPUS is set to 8192 or more. I think we can easily do the same as powerpc on arm64. With the ApacheBench test you cite in the patch description, what is the value of NR_CPUS at which you start seeing a noticeable benefit for offstack masks? Can you do the same test for NR_CPUS=1024 or 2048? Arnd