Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2484980rdb; Wed, 4 Oct 2023 02:40:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9EXdT18mMw+XsQgyg+oAukEalJ6RgX48HogZQI8P0UQ1iDvfoO42/aaFIpiw54DVRylk1 X-Received: by 2002:a17:902:e547:b0:1c7:56d8:9068 with SMTP id n7-20020a170902e54700b001c756d89068mr1895959plf.31.1696412407492; Wed, 04 Oct 2023 02:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696412407; cv=none; d=google.com; s=arc-20160816; b=kJpOtB50Qo3MSkqOD+tU+e9VAWtTFM1b+ftppLD7yphoEaUpYaub/9HWcCjcVJ0loc cQVRZ0jgYBDYgPkI8tq/Fk//xbnXcihEJ3nSac5zdqfZguX8k6QFZQtW9E6Bpd+FAnim ISETte3vBGEi/LcX59d4NotLQrAfVCEkJVqrXyWA00usvkT02zmGFArDvn4mFsEawG7k n9KeWZ/W7wbwJyj5QAlyCmIPyY9h9uJ0jT7XFGFtWmqfOEO5LcZ3YRhnPU9AmWWaXCIA jzhsL7lVSuEx3p3tTz8COZaVZaktgo/kUQL5u/qRFfxGnatli8tePWXl5XhqHwuezNO+ fnDg== 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:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=Oigu8aAhegucB1u9jLNtc55kOYYLgQuWD8KQg9b2gcI=; fh=8D7ckHZGUyMIkWlhEBcdiFQASx78c3gsUEcLuNNbj84=; b=JFttDWguDWVhnDdeeE5DHxbAy+qRyfTa4QXORZZWVbUWmnCV2axBMGYVXWBO2s0gUe ifBjbVp66XGyN3sajwfSRfHer8FoKEKnCM/ApG24Rmx1wLKwww3t8lyvLzZNJoNWv0a3 yO1dITcUJRr1ClIegexIcmU/GxcAj3fKLv2Kp1Z9Z85TPJMo6Jfdh1coV4gLRz6GwF1B JUU//D6pbgp3csYg262BstioOE6u1D03c3CwTIUjC86epb3V5YoRoIlmcjl3MhijbHXC uyHeeP/SHX1VPrEIBiY0LcYKIWaVptfs4CHGs0Lh62I79z7vtIfmdgnx3qKWFSFk/bLd O2eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UZ5SV8Su; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id p7-20020a170902e74700b001b8b437b01esi3537615plf.350.2023.10.04.02.40.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 02:40:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UZ5SV8Su; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1F658833CE1B; Wed, 4 Oct 2023 02:40:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242081AbjJDJkC (ORCPT + 99 others); Wed, 4 Oct 2023 05:40:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242068AbjJDJkB (ORCPT ); Wed, 4 Oct 2023 05:40:01 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95AD8E8 for ; Wed, 4 Oct 2023 02:39:57 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5334d78c5f6so3323067a12.2 for ; Wed, 04 Oct 2023 02:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696412396; x=1697017196; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=Oigu8aAhegucB1u9jLNtc55kOYYLgQuWD8KQg9b2gcI=; b=UZ5SV8SuguDyJ+aWRr6ew979bdHVgucYiOH7iAlKmgQnwK3UrQxqtsRQ0UiRRay7As UFiVU30SB58REX6YuLIl9lUY5ON7yRpJtJXKj8t1qtjXLWtHwb+a5ShkFa4bknxxsuD2 ue0LY9d4n75CsYs7HtFJv1/yzF0XF8/UW/7imbwG339uPnYLJwsuV6FhXLjij1T02S+0 57t6qMjgOIfTP5qRmzYapNLb+s0xbr3SiDhNMj0Yg/nKGRacmo0jYEUMNMXpX41VnWt6 RXWLuSP6GttsF+sBcUJXCtwk4YgguIJEQx6bIEWbiYzibIkeh0GQ8L45geYPZKpaRDZE OntQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696412396; x=1697017196; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Oigu8aAhegucB1u9jLNtc55kOYYLgQuWD8KQg9b2gcI=; b=O9vmE1DPgjLI5OLLErsqmuiVjCvgqv23//KqR1tUvK5nCrLfBeAQt4R7cnv/gMT67b XMDVVlEJQJqGsaJAtNir0o0Qu3lGfYRHk+/mSaFsxwtBA8ldFeOktX/O3ZkYtfRg7HGf bfMyOsfjSkHNPW/lXYQkixIo4m41yf7VtSVrB2Or/eIHvIRaOOREDPJQXPxNsCJnOMh5 Rsx4/SLyRBfzBoxFGsfDBQkDY+N0UstxY6kigTtDDRCjJZS6Hc3txf9NVPVRWHNNadXK VS1/Cyj+IRZ0br+7hbE8qWZaSCkF/mP/byA2ESx6Y8sttfovUeYTAFdI1eDZ58ToKpi3 pw3w== X-Gm-Message-State: AOJu0YyMb7S1pK+qil7tuoR4WFbwge4rZg89Ed6a2+0nyOOKxZVHAiiy 2zOgZvgrdWb7+gAEN7GeDCZ4jG3G8Co= X-Received: by 2002:a17:906:73d1:b0:9b6:4b5d:7758 with SMTP id n17-20020a17090673d100b009b64b5d7758mr1643793ejl.68.1696412395859; Wed, 04 Oct 2023 02:39:55 -0700 (PDT) Received: from gmail.com (1F2EF530.nat.pool.telekom.hu. [31.46.245.48]) by smtp.gmail.com with ESMTPSA id l11-20020a170906a40b00b009b64987e1absm2488023ejz.139.2023.10.04.02.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 02:39:55 -0700 (PDT) Sender: Ingo Molnar Date: Wed, 4 Oct 2023 11:39:53 +0200 From: Ingo Molnar To: Peter Zijlstra Cc: Zhang Qiao , mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH] sched/core: Update stale comment in try_to_wake_up() Message-ID: References: <20230731085759.11443-1-zhangqiao22@huawei.com> <20231004093323.GK1539@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231004093323.GK1539@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 02:40:06 -0700 (PDT) * Peter Zijlstra wrote: > On Wed, Oct 04, 2023 at 11:31:26AM +0200, Ingo Molnar wrote: > > > > * Zhang Qiao wrote: > > > > > Since commit 9b3c4ab3045e ("sched,rcu: Rework > > > try_invoke_on_locked_down_task()") renamed > > > try_invoke_on_locked_down_task() to task_call_func(). > > > Now, update some comment about it. > > > > > > Signed-off-by: Zhang Qiao > > > --- > > > kernel/sched/core.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > > index 0d18c3969f90..540ac33ddb80 100644 > > > --- a/kernel/sched/core.c > > > +++ b/kernel/sched/core.c > > > @@ -4186,7 +4186,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) > > > * Pairs with the LOCK+smp_mb__after_spinlock() on rq->lock in > > > * __schedule(). See the comment for smp_mb__after_spinlock(). > > > * > > > - * A similar smb_rmb() lives in try_invoke_on_locked_down_task(). > > > + * A similar smb_rmb() lives in task_call_func(). > > > > Except the matching smp_rmb() doesn't live in task_call_func() anymore, so > > you now turned a stale comment into a misleading one ... > > It moved, *again*, it's now in __task_needs_rq_lock() :-) Yeah, I know, see: bdf85bec2b1e ("sched/core: Update stale comment in try_to_wake_up()") Thanks, Ingo ====================> From: Ingo Molnar Date: Wed, 4 Oct 2023 11:33:36 +0200 Subject: [PATCH] sched/core: Update stale comment in try_to_wake_up() The following commit: 9b3c4ab3045e ("sched,rcu: Rework try_invoke_on_locked_down_task()") ... renamed try_invoke_on_locked_down_task() to task_call_func(), but forgot to update the comment in try_to_wake_up(). But it turns out that the smp_rmb() doesn't live in task_call_func() either, it was moved to __task_needs_rq_lock() in: 91dabf33ae5d ("sched: Fix race in task_call_func()") Fix that now. Also fix the s/smb/smp typo while at it. Reported-by: Zhang Qiao Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230731085759.11443-1-zhangqiao22@huawei.com --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 65e10ac34660..f5783cb16791 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4237,7 +4237,7 @@ int try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) * Pairs with the LOCK+smp_mb__after_spinlock() on rq->lock in * __schedule(). See the comment for smp_mb__after_spinlock(). * - * A similar smb_rmb() lives in try_invoke_on_locked_down_task(). + * A similar smp_rmb() lives in __task_needs_rq_lock(). */ smp_rmb(); if (READ_ONCE(p->on_rq) && ttwu_runnable(p, wake_flags))