Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6538252rwb; Mon, 14 Nov 2022 23:13:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf4NwpzToZYWO3ZnpBzkxd4Li749MGHn1VpfsLVVxNMGd1Psak6gL6chlGhUZaaQ/LOmqAMy X-Received: by 2002:a17:902:dace:b0:186:944d:47b with SMTP id q14-20020a170902dace00b00186944d047bmr2852897plx.42.1668496415611; Mon, 14 Nov 2022 23:13:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668496415; cv=none; d=google.com; s=arc-20160816; b=BaZFkUtBY7w8Vrwpwcm0KtbRqTt65j6fxTRz2qQGmJKYbBYhwXgROKu7fUy1o5cQuP MXOEgfe76/W7a304gcmRsAEzyXe7wM4o88rZxKMNOL5zHo0ysjCP0mlUHE7m1RcNO6wQ n8f5nlzulolgE49RRjva5KyI8fVlVHWf/1JWVm2BBEEjsDdojQy8sWN8XQP3L8cpNqdY uyIQZPbXOXjIL/59WRlDt0mStbL+jToE3P8AMaBeXDVD+jW2LlUzilLalh4NyhCo72Hz xEm9RrgUxU/GqTQo8Iqj+JKmgQ9WDdeD2m4R8dnErO1N52wUZfNTFi8yEdzxPthF8TJ5 eFWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=noh/j1I2Nfqmg70jSTXPnVlIuOy6GPQXk/DeN87GQSc=; b=OAY4nmWZdyP1hlH1d0JqlDBpGLAJR0dq4mcsH+8RwCz6R6uRrpVXSe0Mx+opTZlqrW m8aUBTFzAMEk9id57qWQJL3+791xZDtwqlO60Q9aCHPdX8u9UDeN3/8aXsWtseZx7gur Ex9A385N9Soy2DatdPlDN2aVpZpuUVhbPgzXgA1Pw4u+4y5gxrBbNlhkWyKY9i3WQynz KTTsJtWG3wUBXSylgJ1SQvs2iM9qrTKfhQyVpjbAsGT6uRcFPguivqELHi2AcwJwDUZw /JNw5RN/UdkGvFKxW96JgEe2K167UfAlOuNwdeCCuwpgvUdALYlQy9YmCcPRoyI89Bwz DjTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=lAr927BT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oa9-20020a17090b1bc900b00214021e87d1si17928193pjb.173.2022.11.14.23.13.24; Mon, 14 Nov 2022 23:13:35 -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=@google.com header.s=20210112 header.b=lAr927BT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232306AbiKOHIv (ORCPT + 88 others); Tue, 15 Nov 2022 02:08:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231602AbiKOHIt (ORCPT ); Tue, 15 Nov 2022 02:08:49 -0500 Received: from mail-vk1-xa35.google.com (mail-vk1-xa35.google.com [IPv6:2607:f8b0:4864:20::a35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCA05124 for ; Mon, 14 Nov 2022 23:08:48 -0800 (PST) Received: by mail-vk1-xa35.google.com with SMTP id g4so6136920vkk.6 for ; Mon, 14 Nov 2022 23:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=noh/j1I2Nfqmg70jSTXPnVlIuOy6GPQXk/DeN87GQSc=; b=lAr927BTluZcNXMKOC0MimOAVuXGSqAeMbyqx8/z/YUM5s6un9kPKNbevgVOeVyNzp y4K89hIVCru8LGLs2H/RB59XSLlvuSt1x8KcxBDLtvK6lRSJGk5U8m298v3sfYp411uy MDGUrmmpS3gawg4x28r+zm27HHHxSIybpR9rAWsbfSTEM3eV5qvjGL8MO9wYtfnvC8Hb vk505YIa4DrODRClGQy6iK7K0z7MkvRJHzZsoovvzSpopQpy4b/rzHd6U/OhVp32A49P zIQe/O5Od2sOYr5qSgwwaAici055IvE8Gwy5sbCiUuot03OE2NNuRTFYa9NJvLN+o5ux 1BiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=noh/j1I2Nfqmg70jSTXPnVlIuOy6GPQXk/DeN87GQSc=; b=3v1t3lnlFkt1DrQcP7745lSa22/a77mIrgH0UdwcoiueHHWyNTScBFciEy+/WfI+T/ ZboaLLUV+M1/wTb1GVKNDTfqatJX3CSq3tYfLTFV5Pmskn0/rmLqcw4T+NsgY4ouwVqK eV1GVmXumycWzl33Uc77dG6yIVHk6DipoOqfPLAmALXlBsibFkDLwsQaofZsw+mBEm9L 7eD5m8ZIq68OtP8J/5wLymh9Pnw+8K/bVL7Fr4jpupBjRCLs52aGkZ0pwtUoxp0QEmOi L7U9mPZAVAZneyrUU8DAZFXDL+TGIt7IUv38o+Cv+5t/cDyKzo+jG0qx+cXaomxDKSXQ /b6w== X-Gm-Message-State: ANoB5pllgKwhyqBfojk0lx+pS2xKNwm2w4309V0jdnIcyKnOHRtlSErd tFPM9SdzhERhCgyo9s5yOiMWBdFb9sMLyEfqbpmAyO85C94X X-Received: by 2002:a05:6122:2007:b0:3b8:3b0b:222f with SMTP id l7-20020a056122200700b003b83b0b222fmr8510224vkd.36.1668496127733; Mon, 14 Nov 2022 23:08:47 -0800 (PST) MIME-Version: 1.0 References: <20221003232033.3404802-1-jstultz@google.com> <20221003232033.3404802-3-jstultz@google.com> In-Reply-To: From: John Stultz Date: Mon, 14 Nov 2022 23:08:36 -0800 Message-ID: Subject: Re: [PATCH RFC v4 2/3] sched: Avoid placing RT threads on cores handling long softirqs To: Alexander Gordeev Cc: Joel Fernandes , LKML , "Connor O'Brien" , John Dias , Rick Yiu , John Kacur , Qais Yousef , Chris Redpath , Abhijeet Dharmapurikar , Peter Zijlstra , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Thomas Gleixner , kernel-team@android.com, "J . Avila" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Sun, Oct 23, 2022 at 12:45 AM Alexander Gordeev wrote: > > On Sat, Oct 22, 2022 at 06:34:37PM +0000, Joel Fernandes wrote: > > > In my reading of your approach if you find a way to additionally > > > indicate long softirqs being handled by the remote ksoftirqd, it > > > would cover all obvious/not-corner cases. > > > > How will that help? The long softirq executing inside ksoftirqd will disable > > preemption and prevent any RT task from executing. > > Right. So the check to deem a remote CPU unfit would (logically) look like this: > > (active | pending | ksoftirqd) & LONG_SOFTIRQ_MASK > Alexander, Apologies for the late response here, some other work took priority for a bit. Thanks again for the feedback. But I wanted to follow up on your suggestion here, as I'm not quite sure I see why we need the separate ksoftirqd bitmask here? As run_ksoftirqd() basically looks at the pending set and calls __do_softirq() which then moves the bits from the pending mask to active mask while they are being run. So (pending|active)&LONG_SOFTIRQ_MASK seems like it should be a sufficient check regardless of if the remote cpu is in softirq or ksoftirqd, no? thanks -john