Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6016137rwl; Tue, 4 Apr 2023 06:52:04 -0700 (PDT) X-Google-Smtp-Source: AKy350azM8DksTNC7RuFA2JMLtrvUjiX5ADa0fHgCq2heXsY+4bKBlwTXiWE+WXq5mji4rkCNmDb X-Received: by 2002:a17:906:c791:b0:931:d350:9aef with SMTP id cw17-20020a170906c79100b00931d3509aefmr3060957ejb.25.1680616324315; Tue, 04 Apr 2023 06:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680616324; cv=none; d=google.com; s=arc-20160816; b=Oripr0XFx3wVuCoobpI/MnvnmIKPzaIqE8iWuC81APqiBKDhm9rwMen0e/LVAGKoSy b3kW9SJ8LLaXrXbK1FSdNkLJm4Reo/fOzxEQTaEoHKfkCWLMZ5Qpy+raf34XaDydNHGW K2U5doh0rXoceOBYhwWs0Pe4aMaQxAG3z6ygji0ArSMVAvvCP6FjHzvmgV01MaDyd1gD Fm+8JdGJPKZMo4p1qISyPuhYnqlO67NKmIxQTBV9JAzdrWi9Yo5Ius2rjFArwQ84UHG9 artpv7Az4yrY4+kMEs2n8cgSx8YBgg8PA6HM9lmjkArN+rOz1GAM7te2Ovr7JblesW8h 7Qqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=zsTIZUaOt4/p51daq2PZX1n16o1nkazviHKpSzXwqxo=; b=hhuBwY3G5bUp9XMXIJvm72mZrQde9bkkI0CpYdjVIv8NXL/X/GyNuNWuustFkJ2sqh IWspW8G3Jqhzo+sZuwbN1A1zuBt4zTA981MexmoknNNGRIpID1xjWhq/URKD/SORdg2M nWPGLkrn3RkNsouk2XhPstsgsnfFr6PdfQYkIMgQecdBKBuo9uJ62JTlgw/ZzbQHDrsy lIAgVn1cAFacUO5/lrxmFImEGQUCs3sFOC9Y6xJMcZq2wS36aj/aADce2+zlr0pi0obC ru+QONEIgVjv+5ak7lTR4yjsBnNfKmSpmi87Jcg4xQ0Nb9WvO1OhhIwo5i1Xd5XHuyqV OIUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hklnZ82e; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i21-20020a170906251500b009453c587582si7315761ejb.468.2023.04.04.06.51.40; Tue, 04 Apr 2023 06:52:04 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hklnZ82e; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234892AbjDDNtE (ORCPT + 99 others); Tue, 4 Apr 2023 09:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235114AbjDDNsx (ORCPT ); Tue, 4 Apr 2023 09:48:53 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 219EE30ED for ; Tue, 4 Apr 2023 06:48:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680616081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zsTIZUaOt4/p51daq2PZX1n16o1nkazviHKpSzXwqxo=; b=hklnZ82eoe8wqeu8A6TfCpAOc5+OJ20nfGY/AYxgLOZhPCSjUtcg1HDwWP9qWJwRcUM1BH U2hjeJX6o7R71Hu+eRxye0pnP1ieaJUinywSgEmuafk5rrEAJ1DYq1Qd+L42yzFP/dBsz9 /9PicI+XXvKp5Sf9pR1fi5VVTtO7S5w= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-88-4Gj2xrfTOMOWQO5iqsfj2w-1; Tue, 04 Apr 2023 09:48:00 -0400 X-MC-Unique: 4Gj2xrfTOMOWQO5iqsfj2w-1 Received: by mail-wr1-f70.google.com with SMTP id i25-20020adfaad9000000b002cff37de14fso3733797wrc.16 for ; Tue, 04 Apr 2023 06:48:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680616079; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zsTIZUaOt4/p51daq2PZX1n16o1nkazviHKpSzXwqxo=; b=kTbGYPjRHg7zB2aQihXCmraIYtW+gx/I+f4/Ap4cILqcIrjC/Q5Ei5WOQDizqVv3NP 8/OAAG8zwM/1EeAG1ZBC8UC7zbeRbuaUgWTGwHgsm6IIBSr6Lh++B4RU5z5H85WWA/em aNrS3+QMObIyi4xxQo7k3uopurI9Xex24dpN4OQdPjNrcIXQnhm7ZA0zqOZFg2wTowhN IRgGMIoSBMvpKghFzU5mIq6+/bJc3s+OwspcZUPbOHIrBEa6alfPR9X0WOifYIvOjYCE xY+v/IS30ZTk4sJVjf2pe+ZvR1FbYvbl/VXB78TyBjJENmb4NRe1Jwfa0Lh3oQDRj1sX NvWA== X-Gm-Message-State: AAQBX9eWPr08VhLprD1jO0E4Ang/UqdOowHXTF/GCriTdDJ6GNiEvZpL ZKBTqcV74vR9F+JByPTBEJCo7pUGjtHOBeIOeRGo1/MkOve8bvxA+kfWwRBUqSdVAyjPZi0Mn/K BY0cz4WDGuhtGZF/WkMSpMM+L X-Received: by 2002:a5d:4d11:0:b0:2ce:9819:1c1e with SMTP id z17-20020a5d4d11000000b002ce98191c1emr1783336wrt.30.1680616079624; Tue, 04 Apr 2023 06:47:59 -0700 (PDT) X-Received: by 2002:a5d:4d11:0:b0:2ce:9819:1c1e with SMTP id z17-20020a5d4d11000000b002ce98191c1emr1783320wrt.30.1680616079268; Tue, 04 Apr 2023 06:47:59 -0700 (PDT) Received: from ?IPV6:2003:cb:c709:b600:e63:6c3b:7b5d:f439? (p200300cbc709b6000e636c3b7b5df439.dip0.t-ipconnect.de. [2003:cb:c709:b600:e63:6c3b:7b5d:f439]) by smtp.gmail.com with ESMTPSA id d7-20020adfe2c7000000b002d419f661d6sm12391832wrj.82.2023.04.04.06.47.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Apr 2023 06:47:58 -0700 (PDT) Message-ID: <78a31392-8f9b-9705-918a-24edb650f395@redhat.com> Date: Tue, 4 Apr 2023 15:47:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH 1/3] arch: Introduce ARCH_HAS_CPUMASK_BITS Content-Language: en-US To: Yair Podemsky , linux@armlinux.org.uk, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, davem@davemloft.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, will@kernel.org, aneesh.kumar@linux.ibm.com, akpm@linux-foundation.org, peterz@infradead.org, arnd@arndb.de, keescook@chromium.org, paulmck@kernel.org, jpoimboe@kernel.org, samitolvanen@google.com, frederic@kernel.org, ardb@kernel.org, juerg.haefliger@canonical.com, rmk+kernel@armlinux.org.uk, geert+renesas@glider.be, tony@atomide.com, linus.walleij@linaro.org, sebastian.reichel@collabora.com, nick.hawkins@hpe.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, mtosatti@redhat.com, vschneid@redhat.com, dhildenb@redhat.com Cc: alougovs@redhat.com References: <20230404134224.137038-1-ypodemsk@redhat.com> <20230404134224.137038-2-ypodemsk@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230404134224.137038-2-ypodemsk@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 04.04.23 15:42, Yair Podemsky wrote: > Some architectures set and maintain the mm_cpumask bits when loading > or removing process from cpu. > This Kconfig will mark those to allow different behavior between > kernels that maintain the mm_cpumask and those that do not. > I was wondering if we should do something along the lines of: diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 0722859c3647..1f5c15d8e8ed 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -767,11 +767,13 @@ struct mm_struct { #endif /* CONFIG_LRU_GEN */ } __randomize_layout; +#ifdef CONFIG_MM_CPUMASK /* * The mm_cpumask needs to be at the end of mm_struct, because it * is dynamically sized based on nr_cpu_ids. */ unsigned long cpu_bitmap[]; +#endif }; But that would, of course, require additional changes to make it compile. What concerns me a bit is that we have in mm/rmap.c a mm_cpumask() usage. But it's glued to CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH ... shaky. At least if we would properly fence it, there would be no accidental abuse anymore. > Signed-off-by: Yair Podemsky > --- > arch/Kconfig | 8 ++++++++ > arch/arm/Kconfig | 1 + > arch/powerpc/Kconfig | 1 + > arch/s390/Kconfig | 1 + > arch/sparc/Kconfig | 1 + > arch/x86/Kconfig | 1 + As Valentin says, there are other architectures that do the same. -- Thanks, David / dhildenb