From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B07DBC6FD1D for ; Tue, 4 Apr 2023 13:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=q5sihOaUs9UuGA3eetHmXZ/VLOdvFsVjKLqp7TWNK6U=; b=yg52cPHMEd+efd 63RiOLCN09aTpUt1z1G0r5cgm7c6RNWofBfrRok1EaVInXsUUxI+N4ubQfG7uB95zA7boTlboSySi aOpE2xkifWrL9t1A/LX7wXeBDPL8jTyKbWSustlAWLNGeI7Lk4XYkPTB1vyB4dR90kQIrwHlHy88v Mwl5Mz9YVb8kCsFuka27zFNu6Jr0U/qlXOshBYn2uqRh+z0hzUl7xJ+Njx7l7mOGqszOLchXECaB+ p0aTVj/4/LhAfVZTiv9uXk+5Ha2vYaTl/n1B5/cwe8L0fKIiAf6fn/cOFJW+KzaD9YDMPm8K07PHf XouS+Zg4IgzCb92O9M2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pjh18-001YVO-0G; Tue, 04 Apr 2023 13:48:10 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pjh14-001YQq-16 for linux-arm-kernel@lists.infradead.org; Tue, 04 Apr 2023 13:48:07 +0000 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-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-Qjxo2V6wPkeB01RGHSUGPQ-1; Tue, 04 Apr 2023 09:48:00 -0400 X-MC-Unique: Qjxo2V6wPkeB01RGHSUGPQ-1 Received: by mail-wm1-f71.google.com with SMTP id m21-20020a05600c3b1500b003f05f614318so771662wms.0 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=u9uHKFCf1EYxkdxkNS0qMJdLV6vlbieeaHV8h6Mr2og3dZo3aMiuXkaV38y4e6m17w 6PwFp9292jR0gMNvVui3zrgRRxNEd2RKU9DgRK3UiIp2U+AWAag1Pu+gUJbO/pmsar9g I7Kvu1O+kpWl2muXPJmrU+x0EdLsLjIU1j8MiLuWj9/FFfQ1sICDMKDTiYFp84dXWnYK mfc/AmCDKGoX7m1rpShF+AjHZItxEM3T6R026nGwa7ZgPQ/FIq2zbhUCgQs+tGoN7tGU vDvCU3scnsXmh6Xr3K4vOdq+EXsxiLC6GX3/5sax4Rcluv2jCDLuHgQm3O+yM3hfXcJP uraQ== X-Gm-Message-State: AAQBX9c/QzU6kLql8ScQ5R7Z69CU5JAKPkQ8Qa7VjWq75KmrK8/dKvSx cN125AZ2kkYUaqGtGPnlSK1KtEZnWDpgbXuNBRR5y+6J9Pk0luwkrEYsgtiNBhDtlXwqHmdPBhq 7wkUmzPJQusSW2MXouuW44OzLdh68ReE4lKQ= X-Received: by 2002:a5d:4d11:0:b0:2ce:9819:1c1e with SMTP id z17-20020a5d4d11000000b002ce98191c1emr1783358wrt.30.1680616079627; Tue, 04 Apr 2023 06:47:59 -0700 (PDT) X-Google-Smtp-Source: AKy350bmtLhdkOTL49G5hyyIR/dGwEI3AOPEAjf+veEKXRQyea3PV+FawQK0/io3jdVH76JN5ImpWw== 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 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> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230404_064806_495329_B87F9336 X-CRM114-Status: GOOD ( 17.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel