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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 3450BCF31AE for ; Wed, 2 Oct 2024 09:44:30 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4XJVJX4g2Qz2yNs; Wed, 2 Oct 2024 19:44:28 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2a0a:51c0:0:12e:550::1" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1727862267; cv=none; b=JixslhgjhiNJYbOq1k5gRLagV4yenUWkhEBurxsi1rlACUlEueTPoXews8X/FBGDj3m1TMcFyrpd0Rn9ZuHxNGfuh1DASsl6Ul6ul9k4s4BuqR92+7h5YnOyOMDsxBNX9QhKxVnt2PyWjEFMPn7W0b2bVkDJ5R4oNBANg+N56d5xuJBFS1Yev9UlZbTbQ3oQRYMJFzWK74QCAiy/pjiYZyTnJPXGUsExIvlpM4gDHrMl7YfATlUqc3yD0lbYh2+S/85BhNxmmiijl4yOnseZFlrt9ny/1NQXAyKV275Jm5pYoNjUkKOXfeMkoUger24l3DNDqlG4Zfaf4eaXBbfggQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1727862267; c=relaxed/relaxed; bh=KbNeEOBRlBQ4W4QTFBiGzbZCYE8gT06BwQpa9ZprJWg=; h=From:To:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ULHLCFiaX6WgYl5qjBXmVcrR2ywuZEzsJlUP8dnoylFnGr7C4A4j7yoPm4UVDmO9Trp28bfsnXUQkPO8YiYblzMif1zUoSQXQ+sx98u88fiHMpxgeCCtyKf4Bs8ClUijE/OwGDOgUPAt8+9uyrD0jcx/eHA+aTnD1ANejE2an4i6PlHWKBi83Xcuq3XU9MXWx60MfKcOihWYLNLYoVhGmAW0OKtrDbVm5pc48waZWKSh/7lsTM5p7aGXGO/9EVDDUyvewkFTjaiM0FRrMnWpmyW0eR4YHYgYP8f4Gkyre9CioFpA3+nrhwteCFCEURw3F351hWVtfX8lDipukNSQow== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=WfstEY9P; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=E1m6jm20; dkim-atps=neutral; spf=pass (client-ip=2a0a:51c0:0:12e:550::1; helo=galois.linutronix.de; envelope-from=tglx@linutronix.de; receiver=lists.ozlabs.org) smtp.mailfrom=linutronix.de Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=WfstEY9P; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=E1m6jm20; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linutronix.de (client-ip=2a0a:51c0:0:12e:550::1; helo=galois.linutronix.de; envelope-from=tglx@linutronix.de; receiver=lists.ozlabs.org) Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4XJVJW478cz2xpf for ; Wed, 2 Oct 2024 19:44:27 +1000 (AEST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1727862262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KbNeEOBRlBQ4W4QTFBiGzbZCYE8gT06BwQpa9ZprJWg=; b=WfstEY9PzoFots3K8sjQFzkfjgmJ36EbTbOY3KCsRX+I7jfyn9lhennyOmf6CaW/WnN/Mp ypz0utH0oCVCkl9xAoZzh+i1EZKgqkmrbtjFGWGCWCRK4ifaPzxdy9+Wro3hPywAyS1EdN kalyXkjMAiE3CTYq6CNxpYsAD+/dyZP9KZ/zSjlDOEiaOLZKlbHpyKHe4pgafIIvGOsJJA hVRvlXFWudfM6XMYkAIJKLdedfA7S9QR1EypbppSzpJGrNafiOrpsDAL5OX5BfAa3ex6Tt ijt+DkUulNHeEzOWa9Q17JYhb1dUKrrcrQn6wy8PPfaOCOvmiYUgM77Viv+rng== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1727862262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KbNeEOBRlBQ4W4QTFBiGzbZCYE8gT06BwQpa9ZprJWg=; b=E1m6jm20jqxHfOCJ/Xt2T2iLoTRcMbXtWawTfdP8xBkMd/MowmPhKLCziAKxbsFzBr/BDr lgV66gndQLwT+vDw== To: Costa Shulyupin , longman@redhat.com, ming.lei@redhat.com, pauld@redhat.com, juri.lelli@redhat.com, vschneid@redhat.com, Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Zefan Li , Tejun Heo , Johannes Weiner , Michal =?utf-8?Q?Koutn=C3=BD?= , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Costa Shulyupin , Bjorn Helgaas , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [RFC PATCH v3 1/3] sched/isolation: Add infrastructure for dynamic CPU isolation In-Reply-To: <20240916122044.3056787-2-costa.shul@redhat.com> References: <20240916122044.3056787-1-costa.shul@redhat.com> <20240916122044.3056787-2-costa.shul@redhat.com> Date: Wed, 02 Oct 2024 11:44:22 +0200 Message-ID: <87jzeqyh3d.ffs@tglx> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Post: List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Mon, Sep 16 2024 at 15:20, Costa Shulyupin wrote: > +/* > + * housekeeping_update - change housekeeping.cpumasks[type] and propagate the > + * change. > + */ > +static int housekeeping_update(enum hk_type type, const struct cpumask *update) > +{ > + struct { > + struct cpumask changed; > + struct cpumask enable; > + struct cpumask disable; > + } *masks; > + > + masks = kmalloc(sizeof(*masks), GFP_KERNEL); > + if (!masks) > + return -ENOMEM; > + > + lockdep_assert_cpus_held(); > + cpumask_xor(&masks->changed, housekeeping_cpumask(type), update); > + cpumask_and(&masks->enable, &masks->changed, update); > + cpumask_andnot(&masks->disable, &masks->changed, update); > + cpumask_copy(housekeeping.cpumasks[type], update); > + WRITE_ONCE(housekeeping.flags, housekeeping.flags | BIT(type)); So this sets the bit for the type > + if (!static_branch_unlikely(&housekeeping_overridden)) > + static_key_enable_cpuslocked(&housekeeping_overridden.key); What's the point of doing this on every iteration? > + kfree(masks); > + > + return 0; > +} > + > static int __init housekeeping_setup(char *str, unsigned long flags) > { > cpumask_var_t non_housekeeping_mask, housekeeping_staging; > @@ -327,8 +357,11 @@ int housekeeping_exlude_isolcpus(const struct cpumask *isolcpus, unsigned long f > /* > * Reset housekeeping to bootup default > */ > + > + for_each_clear_bit(type, &boot_hk_flags, HK_TYPE_MAX) > + housekeeping_update(type, cpu_possible_mask); Even for those which are clear > for_each_set_bit(type, &boot_hk_flags, HK_TYPE_MAX) > - cpumask_copy(housekeeping.cpumasks[type], boot_hk_cpumask); > + housekeeping_update(type, boot_hk_cpumask); > > WRITE_ONCE(housekeeping.flags, boot_hk_flags); Just to overwrite them with boot_hk_flags afterwards. That does not make any sense at all. Thanks, tglx