From patchwork Fri Dec 1 02:27:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yajun Deng X-Patchwork-Id: 17374 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp833912vqy; Thu, 30 Nov 2023 18:27:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvzOdhm7H98kfgekxSUQoHTcL4RNH8Ja412IPV3/g69c6jZrJEeITvGMGf/7lNKmfd1ddn X-Received: by 2002:a17:90b:1989:b0:27d:1862:a494 with SMTP id mv9-20020a17090b198900b0027d1862a494mr24127367pjb.11.1701397660597; Thu, 30 Nov 2023 18:27:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701397660; cv=none; d=google.com; s=arc-20160816; b=HcpEy9rt6aTV8oOsZ/M/G4vtv2ay30sSMsaSzyRj6X4uckFQ35y19tYDKuUoW1z6if 8aiwV8595EVEeeGXj+m93Q4Tm9WFVvFBhCFO79PpqT3cl2fyV2l2/WVZGx0gC0MlQGgt zJrPOCvtYfYz8YSw0RN/OVTJvwLCbQOKXRtVm4CnSFgwEytwK3c1XsItIDIZz3dZrttY WZkCukRoVNaaTc/UzZWIhgXRaSND7RBZaF053kwBMMFolGEOfd1IgM0AWdnqiTqLR+I8 /taRej9exk8HitRqffWzrHw8SY4Jg1uMIHxlL6qIXv7zwCDMXRxcnD2zPIrnL8Dg7eiN 2BEA== 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 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id cl14-20020a17090af68e00b00285807d0f79si4784554pjb.56.2023.11.30.18.27.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 18:27:40 -0800 (PST) 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=@linux.dev header.s=key1 header.b=ZXc7sKho; 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=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 39E638313D30; Thu, 30 Nov 2023 18:27:36 -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 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:36 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784044753112553844 X-GMAIL-MSGID: 1784044753112553844 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(-)