Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6964115rwb; Tue, 15 Nov 2022 06:05:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf57pEcUOFBuo5Jq3HOoarPoq1rnldzzMXWPAvq4RxeYtRk1xW4rfBi86Oy5m7dDf2ilE+d/ X-Received: by 2002:a62:b60d:0:b0:563:8d32:abdc with SMTP id j13-20020a62b60d000000b005638d32abdcmr18534798pff.47.1668521131888; Tue, 15 Nov 2022 06:05:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668521131; cv=none; d=google.com; s=arc-20160816; b=XksGUpDaeIaztnxGm3aAUAPNFnDRtmYlKJMv4Adaa66FYftdVkn9x8pjA2Xq0BeM2Q QpWRvv2gqxob+bAxEMJo/wyKaFiXUMsaO1YVO92vvPPq3iD2tUBjZA4PJj0jHXJbtN9A iX7UnqHCeCM0jPKWjzGUVi53Vi8GEHF+JpAKgVj1cfWRU06wtMFVk3uKCzyBPXrXTPyI +GoBhY7RNGeTebZYK1wuJHnZzPEB193w/4FSEuxBRBQnL/BKtK/onhZseSMdCaPZs5El Puf7UG3CT0qy15HPYSHjND/blob1/v1852AWJUX9NyM5+Q+R5NONApxOVEqFCoenyEWJ 899w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=PDQRqdsGDb7KukRcb9njb7nsKOBdTVeLeUKpffTCZEg=; b=AbqkjhFzDjz53iu9LcUKXmUI2K0dQaUlHiD1K6uF8roIalb0fecKz1d4sHt2vp8cZs xGwU62CZwmIthGW92iL10mmfO4j5OL3kQje8eiTqWVvb8g5Csfra7SdcqRiYczhfYCBX 7su/XNOP2gwM/va/q9kZPA+muQW4rWJXns7F+eUzS8gwr9ZDPr1q/AN2FHvU5r0eGLzd kqhc6mjIKP4ULy1MfDsS+YycQlTv8ZtAK4aFnoR/0JXJUUErQ9Nk7D73Umckwn4HMO/M 6lVIm2Oh4kXab4xvyfytTdeN9xVlC7vQFqgHmuSHpLRxNXoWbwHRcFBLrs2n4m9t55ZE QSNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NSu8Ppvv; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n66-20020a632745000000b004700a4a4a29si12751343pgn.663.2022.11.15.06.05.06; Tue, 15 Nov 2022 06:05:31 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=NSu8Ppvv; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238445AbiKONlp (ORCPT + 89 others); Tue, 15 Nov 2022 08:41:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238293AbiKONln (ORCPT ); Tue, 15 Nov 2022 08:41:43 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32DA613FA6; Tue, 15 Nov 2022 05:41:42 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E42F7B8162B; Tue, 15 Nov 2022 13:41:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97D14C433C1; Tue, 15 Nov 2022 13:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668519699; bh=mKox1DaCdoOGN/b/rv48hmEDDIpYcldE8+6d+IFTW6g=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=NSu8PpvvI0ptwXg2ezuzWCu8XxXJMJkPRmPQF16lz9GzZhCQQxkoITCiGXvcO3+0n WRgUNcimy7nGeAVK00ZHkuRKeGVggHsRbZXEZvSfsn6A1KvSJxqjU5Q8T/AtFNYw6z we82+NWA/DJsR3batXpSXeQwmQAHcaL5B7ER4J8n3tnZIj1NSYaqlrJ2IwKZIGCrf6 6nLLRelbHB+pFuoVUXYMmF8hXL8U6PFAosNOjV49sCoFYI/V9E9z/+0WyI9IDMYnsO dUVNMSXYgcrlrsTP+DOSymt5xiKhckrcE7+nWIrJvK47J4nEt39l4/LeomRJuZVZ7G 4U5UwgMMrEKcA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 3A0A45C118E; Tue, 15 Nov 2022 05:41:39 -0800 (PST) Date: Tue, 15 Nov 2022 05:41:39 -0800 From: "Paul E. McKenney" To: Sven Schnelle Cc: Davidlohr Bueso , Josh Triplett , linux-kernel@vger.kernel.org, rcu@vger.kernel.org Subject: Re: [PATCH 1/2] torture: use for_each_present() loop in torture_online_all() Message-ID: <20221115134139.GI4001@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20221111125126.3319474-1-svens@linux.ibm.com> <20221111125126.3319474-2-svens@linux.ibm.com> <20221111185331.GA725751@paulmck-ThinkPad-P17-Gen-1> <20221114163009.GE4001@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Tue, Nov 15, 2022 at 07:55:50AM +0100, Sven Schnelle wrote: > Hi Paul, > > "Paul E. McKenney" writes: > > > On Mon, Nov 14, 2022 at 04:35:06PM +0100, Sven Schnelle wrote: > >> "Paul E. McKenney" writes: > >> > >> > On Fri, Nov 11, 2022 at 01:51:24PM +0100, Sven Schnelle wrote: > >> >> A CPU listed in the possible mask doesn't have to be present, in > >> >> which case it would crash the kernel in torture_online_all(). > >> >> To prevent this use a for_each_present() loop. > >> >> > >> >> Signed-off-by: Sven Schnelle > >> > > >> > Looks good to me! Any reason for no mailing list on CC? > >> > >> No, my fault. I setup get_maintainer.pl to be called from git > >> send-email, but looks like i did it wrong :-) > > > > Been there, done that! ;-) > > > >> > Ah, and any synchronization required in case it is possible for a CPU > >> > to leave the cpu_present_mask? Or can they only be added? > >> > >> Hmm... I think the main question is, whether it is ok for a cpu to be > >> removed from the system when rcutorture is running? In both cases it > >> would disappear from the cpu online mask, so i don't think the patch > >> would change the behaviour. But i can check and send additional patches > >> if there are other places that needs adjustment. > > > > Yes, rcutorture has lower-level checks for CPUs being hotplugged > > behind its back. Which might be sufficient. But this patch is in > > response to something bad happening if the CPU is also not present in > > the cpu_present_mask. Would that same bad thing happen if rcutorture saw > > the CPU in cpu_online_mask, but by the time it attempted to CPU-hotplug > > it, that CPU was gone not just from cpu_online_mask, but also from > > cpu_present_mask? > > > > Or are CPUs never removed from cpu_present_mask? > > In the current implementation CPUs can only be added to the > cpu_present_mask, but never removed. This might change in the future > when we get support from firmware for that, but the current s390 code > doesn't do that. Very good! Then could the patch please check that bits are never removed? That way the code will complain should firmware support be added. Thanx, Paul