Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2637382rwb; Mon, 19 Sep 2022 07:54:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7UyvJCpwMfOoKpc/Yesr89t+6WPuVJnuv1+qTi8YV/HmnIBhhhQrYklcIHwyR5mrqqtf1M X-Received: by 2002:a17:903:110d:b0:178:2a53:c7ff with SMTP id n13-20020a170903110d00b001782a53c7ffmr120040plh.89.1663599240351; Mon, 19 Sep 2022 07:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663599240; cv=none; d=google.com; s=arc-20160816; b=m9X1YABPKkr90FJuWrtkm2HFQc7mUas/gpNSuzBzsyoEwqN0Geh//nCb+ajNuFSPaG Z2IwyhliyfzvuAvjMB0iQP1jPafxPwW1J2jeBQdDHNnhm4enSlfSjEtr4kalCvOtCdIy W/EakunPc9eqQpgipVPWpY50HmR4Ex5y65EGb8wjfTLcUjUO4licIEf5OQDow7N7LIK+ Oy6ntK7BhBLRrUZB9yJVAr/74ChyQduLXrb5JVB3ySPlUQQxIi6o4FE+0wjIAamU73Sc Xxc60G17CdvNaT1hRiCRze6a+4AP+r1O7E/IOnTcVuMwMlrf/RkW8mO54iadzlzMdUMz QSaw== 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:dkim-signature; bh=YjclUMktNx88A5Ga2p1PmOfLVjv8YGj91znNKqBCP+E=; b=eEAxYETuAVLzbVUkwQYK7dZR2IJtFyVWgiAHA4Am2Qz0a6k3RcFOkSaWLeQRPqJEf/ JfkgpHvIhgb/SwBuIzPxp5eKbYKyYhFTC0A+8ohKWrMu5GkWw2KAl2S2MIThLffRz8y9 9gqz0OEdk1fu4Ol1I3GdonXHOazPLKLPRibheCskRAHGDB0wbDh/Acz4LIH6byoCzwh9 Om6ElNZp3+UR1eeJcNwugglbh+SB6o2wqx+k3oVbPB2I65MifPU+Sfjdg7Ky2ggM3Hgw doDj3UJZpGH8Fujq9TH+5ht3wZGqSrWPUaicDzbVWNsuZ7sp9QBZlojCdJkNwvFyB75I 2rxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="G7lVOz/m"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk13-20020a17090b33cd00b002000fca8d77si13225766pjb.138.2022.09.19.07.53.48; Mon, 19 Sep 2022 07:54:00 -0700 (PDT) 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=@infradead.org header.s=casper.20170209 header.b="G7lVOz/m"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229624AbiISOje (ORCPT + 99 others); Mon, 19 Sep 2022 10:39:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbiISOjL (ORCPT ); Mon, 19 Sep 2022 10:39:11 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 985BA2D1D9; Mon, 19 Sep 2022 07:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YjclUMktNx88A5Ga2p1PmOfLVjv8YGj91znNKqBCP+E=; b=G7lVOz/mIap1ssllZ8n+ISK8rk 8n80KY1FsEieWlq/84fHEK1/1T7cel3/JjAJZRyoWkJMMI1b1DBWlEQAuWtIQ9KHpJWcgyaK0rALw VqJWxpVeSXuuS+TwAEldjl2HFe6TT98FhhXPwbUxTo/7+LUTxaAHXj/tf92DTtV0fSlopt4tsja0O h8At168E9JoSjWikFLYiBAqvxhQjy5Pdz0ZzY33DYkP102+afhnDF5haSUapgGYVFN4rlhD5mbSzy 3esophHivZdt/4Bhcr3izF+dFKnAd515JNsSw85x8qn8MbtbjmHugHDDMuhkjf1k5/sMZ6a2MQbhi 9zmEVW3A==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaHvN-004mJj-9C; Mon, 19 Sep 2022 14:39:05 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5C8F23001F3; Mon, 19 Sep 2022 16:39:02 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 173372BAC7767; Mon, 19 Sep 2022 16:39:02 +0200 (CEST) Date: Mon, 19 Sep 2022 16:39:02 +0200 From: Peter Zijlstra To: Li Zhong Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org, namhyung@kernel.org, jolsa@kernel.org, alexander.shishkin@linux.intel.com, mark.rutland@arm.com, acme@kernel.org, mingo@redhat.com Subject: Re: [PATCH v1] kernel/events/core: check return value of task_function_call() Message-ID: References: <20220917014746.3828349-1-floridsleeves@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220917014746.3828349-1-floridsleeves@gmail.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 Fri, Sep 16, 2022 at 06:47:46PM -0700, Li Zhong wrote: > Check the return value of task_function_call(), which could be error > code when the execution fails. How is terminating the cgroup task iteration a useful thing? Also coding style fail for not adding { } > Signed-off-by: Li Zhong > --- > kernel/events/core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/kernel/events/core.c b/kernel/events/core.c > index 2621fd24ad26..ac0cf611b12a 100644 > --- a/kernel/events/core.c > +++ b/kernel/events/core.c > @@ -13520,7 +13520,8 @@ static void perf_cgroup_attach(struct cgroup_taskset *tset) > struct cgroup_subsys_state *css; > > cgroup_taskset_for_each(task, css, tset) > - task_function_call(task, __perf_cgroup_move, task); > + if (!task_function_call(task, __perf_cgroup_move, task)) > + return; > } > > struct cgroup_subsys perf_event_cgrp_subsys = { > -- > 2.25.1 >