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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2ECDC4167B for ; Fri, 16 Dec 2022 22:08:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbiLPWIB (ORCPT ); Fri, 16 Dec 2022 17:08:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229787AbiLPWHx (ORCPT ); Fri, 16 Dec 2022 17:07:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 045631740C; Fri, 16 Dec 2022 14:07:52 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 8BEBD621A5; Fri, 16 Dec 2022 22:07:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D718C433D2; Fri, 16 Dec 2022 22:07:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671228472; bh=zTo+zHpQ3FKbyUHKDoeV/N0D43S8xikzmzbD68oM+mE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XEYKhyhxiK0VHZSEumzuCt+yABNQTaGSR2NZEpef+49wHoZpyBS3s3gfcqwRnmfo0 ep2nVlWQ7SlL5HFbya8zmwQf92qkOvbvfr/a4gDXY4VJyqwV308npYdZDALedDWMCO 7lSk8AnEFClHCUbQbEcgGmxW0mElrdDPfhNxqiHA9hV/ZacjXhw+0/13NqeeCI3gTf HJpzZ/G/DolUn+88NW/TfEYFBHZELke1Ew5ThQRitUCHptyGWLcCtPM2PxxvgkjhYb 2efQ06JS57zvNqv/bhrFl/xjF3VRXiuw9Mdc/fOvqa+dNUHeqrVFfViufOknvbFJme NR9WIggBYNYqw== Date: Fri, 16 Dec 2022 23:07:48 +0100 From: Frederic Weisbecker To: Peter Zijlstra Cc: Srinivas Pandruvada , rafael@kernel.org, daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, len.brown@intel.com Subject: Re: [RFC/RFT PATCH 1/2] sched/core: Check and schedule ksoftirq Message-ID: <20221216220748.GA1967978@lothringen> References: <20221215184300.1592872-1-srinivas.pandruvada@linux.intel.com> <20221215184300.1592872-2-srinivas.pandruvada@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 16, 2022 at 12:19:34PM +0100, Peter Zijlstra wrote: > On Thu, Dec 15, 2022 at 10:42:59AM -0800, Srinivas Pandruvada wrote: > > + /* Give ksoftirqd 1 jiffy to get a chance to start its job */ > > + if (!READ_ONCE(it.done) && task_is_running(__this_cpu_read(ksoftirqd))) { > > + __set_current_state(TASK_UNINTERRUPTIBLE); > > + schedule_timeout(1); > > + } > > That's absolutely disgusting :-/ I know, and I hate checking task_is_running(__this_cpu_read(ksoftirqd)) everywhere in idle. And in fact it doesn't work because some cpuidle drivers also do need_resched() checks. I guess that either we assume that the idle injection is more important than serving softirqs and we shutdown the warnings accordingly, or we arrange for idle injection to have a lower prio than ksoftirqd. Thoughts?