Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp381398rdb; Thu, 19 Oct 2023 07:14:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQhaN7xGX+Y6nl5NoNQEkES9Nne3kySszGj3opvPtuixIGy+SxAuX9W/SkhxRPTvROe7Wz X-Received: by 2002:a17:902:e88f:b0:1bc:2abb:4e98 with SMTP id w15-20020a170902e88f00b001bc2abb4e98mr2912938plg.21.1697724892275; Thu, 19 Oct 2023 07:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697724892; cv=none; d=google.com; s=arc-20160816; b=yZNHSw3wmvLvjveO2aLoxMSBPNcAQ2kDKb9uheomV4icC8ZoZ+/6lWIRZ5YfQtQTSZ A2x3LIRPP5hSl2mUC5zonZA37Yb50ct/ZvG36n7iMc4QEsMa6RI1J1AKkUrvvnm/9roy qwnDsTlEJVarth0WKHMnGMtfAA4wW1OyqYMyRHUeXfndJtnwUi3LecRnQFMDslnyHIlF caRVoD6F60D7cFvrsUINcqBEWHuVKJtJJzjgc7iONLmcLmDOwdHyqBR1BM7p7ySUC9iq I9bhjEZWq7qTUO2sGBCZ1Pom2E3WxpSK5qIICLG23YIATJ89NXDTj9XRrmQaVp5nZQsp qGzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=NusMDWPntVj/cFGoN/CA5lDcJjp3lS3pYnJHFFANwb8=; fh=7Xb9lSapZYTu/+o9Q+d5eJ+Q9AAEIG1ia7s5L7LNNOc=; b=z8KDAAn2XizDgnvZDBuRzShpJ80eijbv0XoZ8unf47ikbVwSPqy9Fj5IUl7oyz6hef 58qRbid66WjOQONDOM9VW1StcVL0X6kFVgUyNaFT5soXrrGqqJxcA9SUZEjIL8MHOd2W BLH3EB036YuJor+ftCIHXtoUB4IkSbXKeuJ/eZWo9Kv6XSHZMWt314+PRovYDyyYZtV/ UzVyYSX55RlTHWlXcEVdrJhVB+EE02rIZ3QKnbJl8Xhcpr5B1I7mAzjbB2YDHKf3gJco mCNsvwbnDawCltm8uwZ3JVcw6hoSZdN2tfgI6mxmP+AoM1QbjydpetGM/F/s5kun8dP9 k9Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=L4HfJPX3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id l5-20020a170902d34500b001bb3bcd05bbsi2165616plk.471.2023.10.19.07.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 07:14:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=L4HfJPX3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 87A338326686; Thu, 19 Oct 2023 07:14:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345912AbjJSOOl (ORCPT + 99 others); Thu, 19 Oct 2023 10:14:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345569AbjJSOOk (ORCPT ); Thu, 19 Oct 2023 10:14:40 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36601B0 for ; Thu, 19 Oct 2023 07:14:39 -0700 (PDT) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697724877; 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: in-reply-to:in-reply-to:references:references; bh=NusMDWPntVj/cFGoN/CA5lDcJjp3lS3pYnJHFFANwb8=; b=L4HfJPX3bXzjwLEB6PoSV/FzWczlrito8u+5SlE2F29gIKQErTL9jM4AO3nGZtc22u5ZT9 mPj2Joh/m1U153uC2Bbic0Y8lpRc5tqCMBBclgc3LePaVFe9r9Zsmbbde6FjFhWJqLMpNO 3EelWvVpgaSJKQ60A8flMO/fsn1IxeVVbwPDe/lGs0BT8in6OBHLTXwvZPtQgZsggI0IoX VJVM7XKNng9slp8V8d3vjwxDv0jVgMgJLyjgk4Lm8uPpUjiBZgN5oGoSeyeBuDXBHSKxwI yUwF4BrWhW51zbHSbSuYunyDiAX7Fgm7sSweRv1M8zgOZ0C8CE6r7yPz0BcMjA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697724877; 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: in-reply-to:in-reply-to:references:references; bh=NusMDWPntVj/cFGoN/CA5lDcJjp3lS3pYnJHFFANwb8=; b=2YruEtrQwGDK8WLnrFeSSUV/I+6HGhpoC+kHMA99Fc0zD9pem2dL7AB5E/jvhiTT5U/C0w dGfn8s2JiP1yUzBw== To: K Prateek Nayak , linux-kernel@vger.kernel.org Cc: Peter Zijlstra , John Stultz , Thomas Gleixner , Eric Dumazet , "Rafael J . Wysocki" , Arjan van de Ven , "Paul E . McKenney" , Frederic Weisbecker , Rik van Riel , Steven Rostedt , Sebastian Siewior , Giovanni Gherdovich , Lukasz Luba , "Gautham R . Shenoy" , Srinivas Pandruvada Subject: Re: [PATCH v8 00/25] timer: Move from a push remote at enqueue to a pull at expiry model In-Reply-To: References: <20231004123454.15691-1-anna-maria@linutronix.de> Date: Thu, 19 Oct 2023 16:14:36 +0200 Message-ID: <87cyxa8zsj.fsf@somnus> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 19 Oct 2023 07:14:47 -0700 (PDT) Hello Prateek, I'm sorry for the late reply! K Prateek Nayak writes: > Hello Anna-Maria, > > On 10/4/2023 6:04 PM, Anna-Maria Behnsen wrote: >> [..snip..] >> >> Ping Pong Oberservation >> ^^^^^^^^^^^^^^^^^^^^^^^ >> >> During testing on a mostly idle machine a ping pong game could be observed: >> a process_timeout timer is expired remotely on a non idle CPU. Then the CPU >> where the schedule_timeout() was executed to enqueue the timer comes out of >> idle and restarts the timer using schedule_timeout() and goes back to idle >> again. This is due to the fair scheduler which tries to keep the task on >> the CPU which it previously executed on. > > Regarding above, are you referring to "wake_up_process(timeout->task)" in > "process_timeout()" ends up waking the task on an idle CPU instead of the > CPU where process_timeout() ran? Yes. > In which case, have you tried using the "WF_CURRENT_CPU" flag for the > wakeup? (landed upstream in v6.6-rc1) It is only used by wait queues in > kernel/sched/wait.c currently but perhaps we can have a > "wake_up_process_on_current_cpu()" that process_timeout() can call. > > Something along the lines of: > > int wake_up_process_on_current_cpu(struct task_struct *p) > { > return try_to_wake_up(p, TASK_NORMAL, WF_CURRENT_CPU); > } > EXPORT_SYMBOL(wake_up_process_on_current_cpu); > > Thoughts? I didn't look into this again. Back than, I reported the observation to scheduler people (others also already observed this behavior). I'm not so familiar with scheduling, so I will ping scheduler people to give you a feedback. Thanks, Anna-Maria