Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp749560rdb; Thu, 30 Nov 2023 18:27:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHD/Z0pX5QZpY7bawAHw5CAxlLcDfd5SRZwCXTePYPxOIjrbMQ/Jlg3aHfRSFKrHfedCCBx X-Received: by 2002:a05:6a00:1ca6:b0:6cd:e046:f3f0 with SMTP id y38-20020a056a001ca600b006cde046f3f0mr5743586pfw.13.1701397664169; Thu, 30 Nov 2023 18:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701397664; cv=none; d=google.com; s=arc-20160816; b=ekzoCsSzYP3SmXC5+HstpEFPPrIHTIXrrO1coMyofE1exCyUmeZIdCyiQMqRdpUdie xzoLIb/+1OnrIB5bHP23x5D6JhqnetZ8UyvDAj3hsuROrkRId3mhWmVvkYgKMiJ5bbti SELQJDPn26jKYVLzq4nuPge7dJWdIhENgzZJspmxEIMOKqT8XxoD/fizelCkoMmd8ylG vMhBYSP9KPOZ+Hmw9lq17h7iXPb7sNMi+6O6vGtzG9+VBnwqlufNHujqysFP1EuMPBso Jh2l1k+0VKl/3JybJqo1FOrRjOH5YDT9cDRPNq8qvPysNNZu7Cw5G7/RovtO/QS0O/K0 sq5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1MS+oPnsh/afyTfSaIuacZ3o3KGFvTZ7JLRsMQWeKuU=; fh=kY5sJNvn29qhEh2SatEVpXE2cTkcQ8AnU+xu9Bnn8Ic=; b=GgZDWn50gIbYsNbG1P7N8roQK5vP3VBUPoTed6dvEkyJxe0AGVbNivClpT+hZ1D8cX TZ9NqXjOqyt/IhxbZ8XDCozTCmJ3ZNMYLWe5nhBCuE0DZ3yvkQZrlJIyL4o95EdMNqSD kfduj0bY3fZiF4fmX4MJRfwPZ1xq21pOpH/B0syhBhPd8AowarPCcoZ6cE3+Omhk1zfJ oJYVT7JXZ75qN5EGdPe/ODLw1qzw/1EopqhH4Ut+BynXcK1EaXah7Qor6YfPWc9EOpgL 5Do3jolZREubfeVlvgqoaVHtOnCj0e+CdkYbe+x0WOfsxajwp6vEv2sML+tUD3wSTNt9 PeHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ZXc7sKho; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id v13-20020a655c4d000000b005be264316d6si2351092pgr.598.2023.11.30.18.27.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 18:27:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ZXc7sKho; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 7A37C8313D30; Thu, 30 Nov 2023 18:27:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbjLAC11 (ORCPT + 99 others); Thu, 30 Nov 2023 21:27:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjLAC10 (ORCPT ); Thu, 30 Nov 2023 21:27:26 -0500 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [IPv6:2001:41d0:203:375::b5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51E96198 for ; Thu, 30 Nov 2023 18:27:32 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701397650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1MS+oPnsh/afyTfSaIuacZ3o3KGFvTZ7JLRsMQWeKuU=; b=ZXc7sKhoOMbFTxeGjRr/sgDyfxJKZ48Z9IuHekN/Px60vvgjnWutH/jAp3L7vpozJpyIzS DWfLJ3h7xGrhLDGrmFsfymqhseaDdsksuSa5DZPM1R/1Cj7yItLjxxlSrnw83tYdOrIzbb VaZzC1rCmqJ+/AOqGTxByo+nAzRWTzU= From: Yajun Deng To: mingo@redhat.com, peterz@infradead.org, 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 Cc: linux-kernel@vger.kernel.org, Yajun Deng Subject: [PATCH 0/2] sched: Return NULL when entity isn't a task Date: Fri, 1 Dec 2023 10:27:02 +0800 Message-Id: <20231201022704.3526377-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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, 30 Nov 2023 18:27:41 -0800 (PST) If the entity isn't a task, return the task struct is meaningless. Return NULL when entity isn't a task that makes the code more concise. Yajun Deng (2): sched/fair: Return NULL when entity isn't a task in task_of() sched/rt: Return NULL when rt entity isn't a task in rt_task_of() kernel/sched/fair.c | 50 +++++++++++++++++------------------ kernel/sched/rt.c | 62 ++++++++++++-------------------------------- kernel/sched/sched.h | 4 ++- 3 files changed, 44 insertions(+), 72 deletions(-) -- 2.25.1